[MPlayer-dev-eng] Strange behavior with audio delayed video files

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri Feb 21 09:03:08 CET 2014


On 21 February 2014 08:38:10 CET, "Reimar Döffinger" <Reimar.Doeffinger at gmx.de> wrote:
>On 21 February 2014 00:19:25 CET, "Ingo Brückl" <ib at wupperonline.de>
>wrote:
>>Reimar Döffinger wrote on Thu, 20 Feb 2014 21:21:49 +0100:
>>
>>> On Thu, Feb 20, 2014 at 07:29:50PM +0100, Ingo Brückl wrote:
>>>> When I use FFmpeg (ffmpeg -i file.mkv -itsoffset 60 -i file.mkv
>>-codec copy
>>>> -map 0:v -map 1:a sync.mkv) to adjust an audio delay (60 seconds in
>>this
>>>> example) I'm experiencing a strange behavior with MPlayer playback.
>>The audio
>>>> firstly starts at the very beginning as if no delay had been set.
>>When I jump
>>>> back to the beginning, it runs silent until 60 seconds have been
>>played, and
>>>> every seeking is OK, i.e. the audio is in sync now.
>>>>
>>>> So, is the first playback with immediate audio a MPlayer bug?
>>
>>> MPlayer always plays audio right from the start.
>>> I guess you could call that a bug, [...]
>>
>>I would do so, if audio timestamps say that it should play only later.
>
>That is a feature that is rarely used, and in general rarely useful,
>and in some ways misguided since silence audio packets cost little and
>for many formats could be easily prepended.
>Thus a quite frequent cause of "timestamps say" is broken initial
>timestamps. Ignoring them allows them to "change their mind", if you
>just wait you won't even discover that.

I forgot a few things:
a) delaying audio by more than a few frames or video by more than a few seconds will always cause performance issues. Either through breaking interleaving, through excessive buffering or by delaying highly CPU intensive initialization until the middle of playback. While convenient, that makes it a bad solution technically
b) there is a semantic question that starts to matter for long delays: is delayed audio the same as extra silence? If you play an audio file before, should it end when video starts or when audio starts? What if desktop sounds are set to disable when MPlayer plays, should they be disabled during the delay time?



More information about the MPlayer-dev-eng mailing list