Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.


Go Back   Doom9's Forum > General > Linux, Mac OS X, & Co

Thread Tools Search this Thread Display Modes
Old 7th April 2009, 11:40   #1  |  Link
Registered User
Join Date: Mar 2009
Posts: 1
strange things happening with the audio tracks on dvd ripping.


I've walked into this curiousity when ripping one particular DVD. Please note
that I have managed to convert the DVD into the format that I wish it to be.
This is not a request for illegal activities but rather a curiousity about how
this came to be.

I've copied the data from the DVD onto the harddrive with `vobcopy -l`; which
copied the whole first track to my harddrive. I used the vobfile extracted that
way as a source.

I ripped the audio out like this:
ffmpeg -y -i $vobfile -vn -map 0.1 -ac 2 -acodec libvorbis -ab 128k -ar 44100 sound1.ogg
ffmpeg -y -i $vobfile -vn -map 0.2 -ac 2 -acodec libvorbis -ab 128k -ar 44100 sound2.ogg

The rate conversion is because at 48000hz a vorbis stream chokes. I use 2 channels
because the encoder will crash otherwise. I've been using these settings on
single-audio video streams for a while with success.

The video hard been ripped like this:
ffmpeg -y -i $vobfile -an -vcodec libtheora -b 1024k -me_method full -croptop 80 -cropbottom 80 video.avi

according to mplayer...
video.avi length is 02:12:46
sound1.ogg length is 2:12:46.2
sound2.ogg length is 2:12:33.2

according to lsdvd, the dvd length is 2:12:33.250
according to mpalyer, the dvd legnth is 2:12:33 as well

So here's the first question, where did these ~13 seconds of material come from?
It is on the beginning of the stream; because when I delay the audio of the
second stream, it all works out. However; I don't see the video.avi file
displaying 13 seconds of nothing or soemthing. Any ideas on this would be
greatly appreciated.

Going further:
It seems after muxing them together with mkvmerge; that sound2 misses the first
~13 seconds of audio. the mux command used is as follows:
mkvmerge -o out.mkv --title "title" --chapters "file made with dvdxchap" --aspect-ratio 0:2.4 video.avi --language 0:eng sound1.ogg --language 0:dut sound2.ogg --language 0:eng subs-1.idx --language 0:dut subs-2.idx

using the above command; the first audio stream is perfectly synced, the second
one is ~13 seconds early (or late, it's hard to make out without much reference)

to compensate for the sync i did this:
mkvmerge -o out.mkv --title "title" --chapters "file made with dvdxchap"
--aspect-ratio 0:2.4 video.avi --language 0:eng sound1.ogg --language 0:dut
--sync 0:13000 sound2.ogg --language 0:eng subs-1.idx --language 0:dut subs-2.idx

The second stream was now more or less synchronised nicely; it needed about 100
or 200 more to get in sync perfectly, however; the first audio stream is now out
of sync (1 second); so the final mux was something like this:
mkvmerge -o out.mkv --title "title" --chapters "file made with dvdxchap" --aspect-ratio 0:2.4 video.avi --language 0:eng --sync 0:1000 sound1.ogg --language 0:dut --sync 0:13000 sound2.ogg --language 0:eng subs-1.idx --language 0:dut subs-2.idx

Have any of you noticed similar behaviour from mkvmerge? any idea where the
desynchronization of the first stream came from when I added the sync command
for the second? It seems like something that should be reported in a bug; but
given the curious material that spawned this problem, I am hesitant to so do
now. I've had this problem with two DVD's (harry potter 4 and 5; the dutch
editions); I haven't tried this method of encoding on different dvd's yet so I
can't say how that will turn out, but any suggestions are welcome

EDIT: should it be relevant; this is done on Ubuntu Jaunty beta; all tools save ffmpeg are from the repository. ffmpeg can be either svn version of yesterday or the repository verison; it doesn't matter.
Also; extracting the ac3 streams with tcextract delivers audio files of the same length as the encoded oggs. The same counts for mplayer -dumpaudio.

Last edited by nido; 7th April 2009 at 11:42.
nido is offline   Reply With Quote

ffmpeg, mkvmerge, mplayer, vobcopy

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 00:07.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.