[libav-api] Piping in ffmpeg? Using Libav to write to RTMP directly?
Ronald S. Bultje
rsbultje at gmail.com
Sat Apr 16 00:59:10 CEST 2011
On Fri, Apr 15, 2011 at 12:19 PM, Jieyun Fu <jieyunfu at mit.edu> wrote:
> Hi Ronald,
> On Fri, Apr 15, 2011 at 12:12 PM, Ronald S. Bultje <rsbultje at gmail.com>
>> (This may fit better on -tools.)
>> On Fri, Apr 15, 2011 at 2:55 AM, Jieyun Fu <jieyunfu at mit.edu> wrote:
>> > One short version of the question: is there anyway to let Libav write to
>> > a
>> > RTMP server directly? I only know how to write to a file on the disk,
>> > from
>> > output-example.c.
>> > A very slightly longer version of the question: I have a video generator
>> > that generates the video using libav, and is able to write the video
>> > into a
>> > file on the disk. Now, I need to use ffmpeg to send this file to a RTMP
>> > server simultaneously, when this video is being generated.
>> > One way to solve this problem, is to let this video generator write the
>> > video to say, output.flv, and then while this video is still being
>> > written,
>> > fork a process from the video generator that executes:
>> > ffmpeg -re -i output.flv -f flv rtmp://server/output/ ( just an
>> > example,
>> > skipped many parameters)
>> > But is there anyway to use piping to avoid writing to the disk and then
>> > call
>> > ffmpeg, but let ffmpeg takes my video generator as its input directly?
>> Why not just output to rtmp:// directly then?
> Thank you very much for your reply. ffmpeg binaries has an option "-re", in
> my intuitive and unprofessional understanding, this means encode the video
> to rtmp:// at a nearly real-time rate. Aka if the video lasts 10 seconds,
> ffmpeg will deliberately take 10 seconds to stream this video to rtmp://. Is
> there anyway for libav to achieve that?
ffmpeg and libav come from the same origin, so libav' ffmpeg
application also has the -re option.
> Thank you again. BTW, what's the difference between libav-api and
-tools is for questions about the ffmpeg/ffplay/ffserver tools.
-api is about the libavcodec/libavformat/libavfilter/libavutil/libswscale API.
More information about the libav-api