[FFmpeg-devel] [PATCH] movdec: interleave streams better.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Dec 1 08:17:54 CET 2012


On 1 Dec 2012, at 00:42, Joakim Plate <elupus at ecce.se> wrote:
> Hi
> 
> On Fri, Nov 30, 2012 at 11:06 PM, Reimar Döffinger <Reimar.Doeffinger at gmx.de
>> wrote:
> 
>>                  ((msc->pb != s->pb && dts < best_dts) || (msc->pb ==
>> s->pb &&
>> -                 ((FFABS(best_dts - dts) <= AV_TIME_BASE &&
>> current_sample->pos < sample->pos) ||
>> -                  (FFABS(best_dts - dts) > AV_TIME_BASE && dts <
>> best_dts)))))) {
>> +                 ((FFABS(best_dts - dts) <= AV_TIME_BASE / 4 &&
>> current_sample->pos < sample->pos) ||
>> +                  (FFABS(best_dts - dts) > AV_TIME_BASE / 4 && dts <
>> best_dts)))))) {
>>                 sample = current_sample;
>> 
> 
> 
> We have this set way higher in xbmc. It was at 8 secs until we noted issues
> with us having
> a limited desync of exactly 8 sec. So now it's set to 4 seconds.
> 
> 1 second was too small on some apple trailers, casusing severe cache
> thrashing. Sadly it
> was way to long ago to remember the sample.

Why didn't you just make the cache larger?
What you are doing by increasing it is essentially forcing a large cache on the demuxed packets.
Btw. for streamed files with multiple audio tracks Apple really likes to not interleave them at all, the way Quicktime handles this seems to be by having one stream/cache for each audio and video.
But this definitely is an argument for making it configurable, so that you can use standard FFmpeg.


More information about the ffmpeg-devel mailing list