[FFmpeg-devel] Possible leak in RTSP to disk copy writing

Reimar Döffinger Reimar.Doeffinger
Mon Mar 15 18:29:35 CET 2010


On Mon, Mar 15, 2010 at 02:28:19PM +0200, Stas Oskin wrote:
> Shouldn't every FFmpeg container support copy? It basically follows same
> pattern as encoding - just instead of being re-coded, the data moves
> straight to disk.

This really does not belong on this list, at least so far.
Anyway what you want is copying without using up more memory if more
data is copied, which is a far higher requirement.
MOV/MP4 is a format with a mandatory index, and at least without very ugly
hacks the index must be in one piece. Which means that the index can only
be written at the end and after all other data was written, which means
that unless you store it in a temporary file (which has quite serious issues),
the index must be kept in memory and grows in size with every audio or video
frame added to the file.
If you don't want that you definitely must one of
1) use a format where the index is optional and FFmpeg supports not generating
   the index (no idea if there is a option to disable index generation at all).
2) use a format where the index can be written in segments and FFmpeg supports that
   (I don't think such a format exists, and such an index is of somewhat limited use).
3) use a format that does not support any index at all, e.g. MPEG-TS or so.

Lastly, if memory usage grows really badly, A-V desync causing audio or video packets
to be buffered is a more likely cause though, but I didn't see any details in your
mails that would allow concluding if that is the case or not.



More information about the ffmpeg-devel mailing list