Ubuntu – Merge VOB files via command line

command linevideo

Is it possible to merge two (or more) video files from the command line? In Windows, one could do this:

copy /b VTS_01_1.vob + VTS_01_2.vob + VTS_01_3.vob + VTS_01_4.vob Output.vob

I find this to be much easier and faster than using a dedicated GUI program. Is there an equivalent in Ubuntu?

Best Answer

cat VTS_01_*.vob > output.vob

Improved version (this will show a progress bar):

cat VTS_O1_*.VOB | pv | dd of=output.vob

Similar to the 2nd:

 pv VTS_01_*.vob > output.vob

Oh and you could also mv the output.vob to .mpeg and have it play in VLC or another videoplayer.


Using ffmpeg:

ffmpeg -i "concat:VTS_01_1.VOB|VTS_01_2.VOB|VTS_01_3.VOB|VTS_01_4.VOB" -f mpeg -c copy output.mpeg

The methods using cat do NOT interpret the files and just add them together. 1 typical thing you will notice is a slight hickup when the player goes from 1 to the next VOB. Avidemux (GUI), for instance, will also demux(is that the correct word?) the files so it is a smoother experience.


If you receive the error message

ac3 in MPEG-1 system streams is not widely supported, consider using the vob or the dvd muxer to force a MPEG-2 program stream

then you will need to specify DVD as the output format by adjusting the above ffmpeg command with ... -f dvd ....