[Libav-user] A very mysterious question about FFMpeg encoding.
info at denisgottardello.it
Wed Sep 21 21:09:43 CEST 2011
In order to encode a sequence of images to a file I have written a function that works very well. I can produce a h264, theora, mpeg4
and webm files.
With this row:
if (avio_open(&pFormatCtx->pb, "b.mp4", AVIO_FLAG_WRITE)< 0) ...
I decide the name of the output file (in this case is "b.mp4"). If I modify the row in this mode:
if (avio_open(&pFormatCtx->pb, "http://localhost:3000", AVIO_FLAG_WRITE)< 0) ...
automatically the output is sent to that web server. The problem is that I want to send the output at a buffer that I can read.
I have tried in this mode:
if (avio_open(&pFormatCtx->pb, NULL, AVIO_FLAG_WRITE)< 0) ...
pFormatCtx->pb->write_packet= WritePacket; // Callback
but does not work. The file is not correct. mplayers can play it only in mpegts but not with the others codecs.
The question is: Wich is the right way to encode in a buffer and not in a file? I am surfing on the web from many weeks without find the
solution. I am studing the source of ffmpeg and ffserver but nothing. Can you help me?
Videosurveillance and home automation!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libav-user