Reputation: 1
I try to demux mp4 file with duration about 20h using libav. I have compiled and tested ffmpeg example doc/examples/demuxing_decoding.c.
But after a while I get an error "Failed to add index entry" and mp4 demuxer stops working. This doesn't reproduce with shorter file (less than 15h).
Also I try to demux and mux this file with ffmpeg.exe as follows:
ffmpeg.exe -i input.mp4 -acodec copy -vcodec copy out.mp4
And I have no any errors messages in this case.
What is the difference between demuxing_decoding example and ffmpeg.exe demuxing approach?
Is there a specific use of libav mp4 demuxer with too long or fragmented mp4 files?
Any ideas about reducing/ignoring indexes?
Upvotes: 0
Views: 930
Reputation: 1
The difference between my example of mp4 demuxing and ffmpeg util is in usage of av_max_alloc() to limit the maximum amount of bytes that may be allocated in one piece.
For large mp4 file after a while the AVIndexEntry storage in demuxer reaches down a max alloc size and demux fails on realloc.
As I undestand from mov.c the AVIndexEntry* index_entries may greatly increase on fragmented mp4 stream and mp4 demuxer (mov.c) doesn't contain any algorithms to control indexes table size.
This can lead to high memory consumption on live mp4 stream.
Is there any way to use the libav mp4 demuxer on fragmented mp4 stream without storing the indexes or controlling them?
Upvotes: 0