[erlang-questions] Using avconv from erlang

pablo platt pablo.platt@REDACTED
Sun Jun 23 00:41:34 CEST 2013


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:// -f
mp3 -"}, [binary, stream]),
    read(Port, <<>>).

read(Port, _Data) ->
        {Port, {data, NewData}} ->
            io:format("~p~n", [NewData]),
            read(Port, <<>>);
        M ->
            io:format("~p~n", [M])

Is there an erlang project that helps working with audio and video streams?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130623/1e9c6333/attachment.htm>

More information about the erlang-questions mailing list