I am trying to convert a VOB file copied from a DVD into an avi in Ubuntu 13.10. I tried dvdrip
, which failed due to a frame count error or something. I tried acidrip as well, but it always choose an audio track I did not want to use. I would prefer to have a command line solution to create an avi with the following features:
- usable with mplayer (i.e. using the step functions)
- with the subtitle as required (or no one at all)
- with the correct audio track
- with video and audio in sync
I tried some ffmpeg
and avconv
commands and managed to create an avi, but the video and audio were completly out of sync. So what options should I use to have the VOB file converted to an avi file?
I would appreciate some explanations on the suggested options!
Additional information:
The
ffmpeg
command gives the following output for the input fileInput #0, mpeg, from 'Videos/Test/VIDEO_TS/VTS_01_1.VOB': Duration: 00:04:53.32, start: 0.045500, bitrate: 29284 kb/s Stream #0.0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x480 [PAR 8:9 DAR 4:3], 7500 kb/s, 27.68 fps, 59.94 tbr, 90k tbn, 59.94 tbc Stream #0.1[0x82]: Audio: ac3, 48000 Hz, 5.1, s16, 384 kb/s Stream #0.2[0x80]: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s Stream #0.3[0x81]: Audio: ac3, 0 channels [buffer @ 0x15ca6e0] w:720 h:480 pixfmt:yuv420p
The following command
ffmpeg -i Videos/Test/VIDEO_TS/VTS_01_1.VOB -ss 589 -t 274 -sameq -acodec copy -ab 320k output.avi
for example resulted in a crash of my Ubuntu session.
The following command
avconv -i Videos/Test/VIDEO_TS/VTS_01_1.VOB -acodec copy -vcodec copy output.avi
for example resulted in the following error:
Application provided invalid, non monotonically increasing dts to muxer in stream 1: 374 >= 374 av_interleaved_write_frame(): Invalid argument
The following command
avconv -i Videos/Test/VIDEO_TS/VTS_01_1.VOB -f avi -c:v mpeg4 -b:v 800k -g 300 -bf 2 -c:a libmp3lame -b:a 128k output.avi
for example resulted in the following error:
Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height
The following command
avconv -i Videos/Test/VIDEO_TS/VTS_01_1.VOB -f avi -c:v mpeg4 -b:v 800k -g 300 -bf 2 -c:a ac3 -b:a 128k output.avi
for example seemed to work for some frames. But very soon I encountered many errors of the form
[ac3 @ 0x120d480] frame sync error Error while decoding stream #0:1 frame CRC mismatch
The following command
mencoder Videos/Test/VIDEO_TS/VTS_01_1.VOB -oac copy -ovc x264 -x264encopts bitrate=2500 -o output.avi
did some converting, but is (i) using subtitles although I did not want to use them (ii) got the audio wrong (audio and video is terribly misplaced) and (iii) seems to be slower than the movie actually goes (might take 2 hours for a 90 minute movie).
I tried to command given here (third post from Xeratul), but it stopped with the error
FATAL: Cannot initialize video driver.
I tried the suggestion made below to look at the mencoder page. This page suggests to use two passes:
the first reads informations about the movie, the second uses that information to encode.
but neither it is explained which information to extract nor how to use them in the second pass. So I used the following command:
mencoder Videos/Test/VIDEO_TS/VTS_01_1.VOB -nosound -ovc x264 \ -x264encopts direct=auto:pass=2:bitrate=900:frameref=5:bframes=1:\ me=umh:partitions=all:trellis=1:qp_step=4:qcomp=0.7:direct_pred=auto:keyint=300 \ -vf scale=-1:-10,harddup -o video.avi
which did convert the video, but with an unwanted subtitle. It is not clear at all how I can avoid using a subtitle.
ffmpeg
is deprecated since long time ago, you are supposed to use its own successor:avconv
.avconv
then to convert VOB files to avi. The commandavconv -i Videos/Test/VIDEO_TS/VTS_01_1.VOB -acodec copy -vcodec copy test.avi
gave an errorApplication provided invalid, non monotonically increasing dts to muxer in stream 1: 374 >= 374 av_interleaved_write_frame(): Invalid argument
...avconv -i snatch_1.vob -f avi -c:v mpeg4 -b:v 800k -g 300 -bf 2 -c:a libmp3lame -b:a 128k snatch.avi
try thisError while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height
mencoder yourvob -oac copy -ovc x264 -x264encopts pass=1:preset=veryslow:fast_pskip=0:tune=film:frameref=15:bitrate=3000:threads=auto -nosub -o /dev/null
thenmencoder yourvob -oac copy -ovc x264 -x264encopts pass=2:preset=veryslow:fast_pskip=0:tune=film:frameref=15:bitrate=3000:threads=auto -nosub -o video.avi
- took that in part from the Arch doc @dg99 linked.