[FFmpeg-trac] #7295(undetermined:new): A/V out of sync with certain input files
FFmpeg
trac at avcodec.org
Tue Jul 3 16:48:54 EEST 2018
#7295: A/V out of sync with certain input files
-------------------------------------+-------------------------------------
Reporter: atrottmann | Type: defect
Status: new | Priority: normal
Component: | Version: git-
undetermined | master
Keywords: a/v-sync | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Summary of the bug:
There are certain input files that make ffmpeg behave inconsistently with
respect to a/v synchronization.
It appears that it affects certain files created by HandBrake from DVD
sources.
How to reproduce:
{{{
% ffmpeg -i test.mkv out.wav
% ffmpeg -i test.mkv -an out.mpg
% ffmpeg -i out.mpg -i out.wav result.mpg
}}}
This creates result.mpg with a noticeable desynchronization between audio
and video.
However:
{{{
% ffmpeg -i test.mkv -ss 5 out.wav
% ffmpeg -i test.mkv -ss 5 -an out.mpg
% ffmpeg -i out.mpg -i out.wav result.mpg
}}}
This creates result.mpg (starting at an offset of five seconds from the
original) with correct synchronisation between audio and video.
Then, it gets even more weird:
{{{
% ffmpeg -i test.mkv test.mpg
}}}
This creates test.mpg that plays back with correct a/v-sync, but if you
then take *this* test.mpg as an input to ffmpeg:
{{{
% ffmpeg -i test.mpg out.wav
% ffmpeg -i test.mpg -an out.mpg
% ffmpeg -i out.mpg -i out.wav result.mpg
}}}
This creates result.mpg which always has wrong a/v-sync, even if you
insert "-ss 5" (or -ss with a different offset).
It affects all versions of ffmpeg that I tried, including the recent
version in git.
The file in question is available at
https://guardian.werft22.net/public/test.mkv
The A/V sync issue can be best observed at about 70 seconds in, when you
see the channel being switched (the push of the button on the TV remote
should be at the same time as the "static" noise, and the lips of the guy
talking afterwards should match the sound). Unfortunately, I was not able
to create a test file where the a/v-sync issue can be observed more
quickly.
I have used mplayer and vlc to verify the a/v-sync on the input and output
files.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/7295>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list