[erlang-questions] Using avconv from erlang

Max Bourinov <>
Sun Jun 23 11:24:43 CEST 2013


Hi Pablo,

check this out: https://github.com/erlyvideo

Best regards,
Max



On Sun, Jun 23, 2013 at 12:41 AM, pablo platt <> wrote:

> Hi,
>
> I'm trying to transcode a live RTMP stream with avconv from erlang.
> How do I need to use open_port to get output from avconv?
>
> The following doesn't work:
>
> start() ->
>     spawn(audio, start_avconv, []).
>
> start_avconv() ->
>     Port = open_port({spawn, "avconv -i rtmp://127.0.0.1/audio/test -f mp3 -"}, [binary, stream]),
>     read(Port, <<>>).
>
> read(Port, _Data) ->
>     receive
>         {Port, {data, NewData}} ->
>             io:format("~p~n", [NewData]),
>             read(Port, <<>>);
>         M ->
>             io:format("~p~n", [M])
>     end.
>
> Is there an erlang project that helps working with audio and video streams?
>
> Thanks
>
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130623/07fb1724/attachment.html>


More information about the erlang-questions mailing list