[erlang-questions] Real time audio transcoding with a port driver
Max Lapshin
max.lapshin@REDACTED
Tue Jul 2 10:52:09 CEST 2013
> When you suggest using libav, do you mean something like the following?
> https://github.com/libav/libav/blob/master/libavcodec/api-example.c
>
Yes, something like this. But I had to add additional thread that
controls parent process and stdin and exits immediately.
Also I had to add additional protocol to ffmpeg that packs frames into
erlang #video_frame{} record in external format and sends
it in packet,4 mode to stdout.
> Using a port driver per stream will not scale?
Are you speaking about port (external program) or about driver
(library running inside erlang VM)?
> Is there an example for using async threads to do a similar task?
> Will my transcoding compete with file I/O because they are using the same threads?
Yes.
> How do I know how many threads to use?
>
Practice.
> Why not use NIF?
> Encoding/decoding a single frame will probably take about 3ms.
> If the NIF will bump reductions, will this be ok?
I can't tell you how will it work with new erlang.
More information about the erlang-questions
mailing list