[FFmpeg-user] VOBs With Different Audio Delays

Eric Wilde ewilde at gntrains.com
Sun Aug 14 04:31:01 EEST 2016

There exists a class of DVD files that have multiple VOB files within them,
that are encoded with different audio stream delays.  Now, it may be that
this is done intentionally, in order to make ripping of these DVDs
difficult, but I am more of the opinion that incompetence is the likely
cause.  My main reason for thinking this is that these files are often
found in DVD sets that contain multiple episodes and the broken files
typically comprise only a few episodes, with all of the others being OK.

Be that as it may, these files play fine with whatever player you choose
to use, if the VOB files are played sequentially, one file after another
(i.e. what takes place when your favorite player opens the DVD itself or an
ISO image of it).

However, problems abound when one tries to convert or compress these files
using ffmpeg.  Picture this.  The first VOB requires an audio delay of
500ms (about 15 frames at the typical frame rate) for the audio and video
to sync properly.  However, the second VOB requires no audio delay.

If you process the two VOBs concatenated together and supply a 500ms delay,
the first half of the resultant file plays in sync, while the second half
does not.  If you conversely process the two VOBs concatenated together and
supply no delay, the first half of the resultant file plays out of sync,
while the second is in sync.

Processing the two VOBs separately and supplying a 500ms delay for the
first and no delay for the second produces two resultant files that will
play perfectly on their own but are once again broken when concatenated

The less-than-obvious solution is to rip the audio track off the first VOB,
use some audio editor to insert 500ms (15 frames) of emptiness (i.e. no
sound) and then recombine the sound with the VOB as it is processed to
produce an output file with 15 frames of hard audio delay.  When this
separately-produced resultant file is concatenated with a separately-
produced file from the second VOB, one gets a file that is synched for its
entire length.

In other words, it is possible to fix the problem.  But, my opinion of
tools is that they should be designed to solve problems, not make three
new ones in the process (i.e. splitting audio/video; editing audio;
recombining audio/video -- or four, if you include processing the two
VOBs separately).

It would be so simple for ffmpeg to just bang 15 empty audio frames over
to the audio compressor before it started processing the actual audio
stream, thereby creating the hard offset.  If the audio were out of sync
the other way, it would be likewise simple for ffmpeg to bang 15 frames of
blank video over to the video compressor before it started processing the
actual video stream, thereby creating a hard delay.  Then, when the second
VOB was processed, everything would go together smoothly.

Does anybody know of a command line option to do this (I may have missed
it in my search for a solution)?  Or, what do we think about making this an
enhancement request?

Note that I have never seen a set of VOBs that are broken in any way other
than what I've described (i.e. some amount of non-zero audio delay for the
first VOB and a zero audio delay for the second).  In fact, one could
postulate that VOBs that were broken in any manner other than a fixed audio
delay on the first VOB would not play properly under any circumstances and
would have to be fixed by the DVD creator.  This leads me to believe that
there is only one problem to solve here and it is that of inserting 1 to n
empty audio frames at the beginning of the output stream.

Thanks for your consideration.


Sent from my ....  Oh, wait, my dog has both my gold iWatches.

More information about the ffmpeg-user mailing list