[FFmpeg-devel] How to write frames in a memory buffer, instead of a file?
Thu Jan 17 14:23:12 CET 2008
Cristiano Belloni a ?crit :
> Cristiano Belloni wrote:
>> Hi to all,
>> I'm using ffmpeg to encode H263 and MPEG4 videos.
>> I take frames from a shared memory buffer, and encode them in a file,
>> opening it with the url_fopen() function, and writing on it with
>> av_write_frame() after the avcodec_encode_video() call.
>> As I' m streaming rtp packets with live555, I'd like to know if it's
>> possible to store in a memory buffer the frame I would write on the file
>> with the av_write_frame() function I use now.
>> And if it's possible, how do you do it? (which functions of the API do
>> you use, and how?)
>> Thanks to you all,
> I found this thread here:
> It says:
>> [...] the suggested method of passing a pointer
>> through an url string is probably more robust against libavformat
>> internal changes. [...]
> Is it possible to pass a pointer to a buffer through an url string? And how?
and its followups
> Also, this page, http://lab.dyne.org/Ffmpeg/UseUrlProtocol, despite
> giving an example of the tcp: protocol, names the function
> url_open_dyn_buf (&format_context -> pb)
> Is it the way to go? if I open a dynamic buffer and av_write_frame on
> it, the frame will be in the dynamic buffer?
Its another possibility, However, implementing your own protocol gives
you more control.
> Please, help me! :)
T +32  2 790 29 41
F +32  2 790 29 02
E mailto:mbardiaux at mediaxim.be
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles
More information about the ffmpeg-devel