Opened 3 months ago

Closed 3 months ago

#7295 closed defect (invalid)

A/V out of sync with certain input files

Reported by: atrottmann Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

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.

Change History (1)

comment:1 in reply to: ↑ description Changed 3 months ago by cehoyos

  • Keywords a/v-sync removed
  • Resolution set to invalid
  • Status changed from new to closed

Replying to atrottmann:

% ffmpeg -i test.mkv out.wav
% ffmpeg -i test.mkv -an out.mpg
% ffmpeg -i out.mpg -i out.wav result.mpg

This is not expected to keep A/V sync, if it works for some samples, it's just luck.

Note: See TracTickets for help on using tickets.