[Libav-user] Writing frames into custom buffer
Anton Shekhovtsov
shekh.anton at gmail.com
Wed Sep 27 18:28:54 EEST 2017
2017-09-27 14:35 GMT+03:00 Michael IV <explomaster at gmail.com>:
> Hi!
> I want to accumulate results of av_interleaved_write_frame() in a buffer
> instead of a file.
>
>
> avformat_alloc_output_context2() file name parameter can be null. That
> probably means I should be
> able to access some internal buffer with the write frames?Or can I supply
> a custom buffer to write the frames to?
> Tnx!
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
>
Something like this
Buffer io;
int buf_size = 4096;
void* buf = av_malloc(buf_size);
AVIOContext* avio_ctx = avio_alloc_context((unsigned
char*)buf,buf_size,1,&io,0,&Buffer::Write,&Buffer::Seek);
AVFormatContext* ofmt = avformat_alloc_context();
ofmt->pb = avio_ctx;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20170927/44ad5713/attachment.html>
More information about the Libav-user
mailing list