33

I'm new to FFMpeg so this may be a dumb question, but I don't see the answer in the documentation.

I want to decode frames from a DVD vob files. Opening the first VOB in the group works fine, but how do I tell ffmpeg to continue on to the next VOB and read all the VOBs on a DVD?

I have the VOB files in a folder on a hard disk.

Sugrue
  • 3,629
  • 5
  • 35
  • 53

4 Answers4

32

VOB format is a subset of mpeg, so you should be able to combine the VOBs you want to read in just as you would mpeg data: by concatenating them together.

cat first.VOB second.VOB third.VOB | ffmpeg -i - outfile.mp4

Hoisting Matt Gallagher's comment to increase longevity/visibility:

Newer versions of ffmpeg support concatenation as an operator on the input file. So you could use... ffmpeg -i concat:VTS_01_0.VOB\|VTS_01_1.VOB\|VTS_01_2.VOB outfile.mp4

Community
  • 1
  • 1
blahdiblah
  • 33,069
  • 21
  • 98
  • 152
  • Doesn't that copy the vobs to a new combined file first? (which would take several minutes for a DVD) – Sugrue Dec 04 '11 at 08:37
  • 3
    No. The concatenated output from `cat` is piped directly to `ffmpeg` reading from stdin. That's what the `-i -` indicates. There should be no difference in speed. – blahdiblah Dec 04 '11 at 09:23
  • 12
    Newer versions of ffmpeg support concatenation as an operator on the input file. So you could use... ffmpeg -i concat:VTS_01_0.VOB\|VTS_01_1.VOB\|VTS_01_2.VOB outfile.mp4 – Matt Gallagher Oct 07 '12 at 13:08
  • 2
    In Windows command prompt, you can also use double quotes to make the pipe character explicit. Otherwise, you'll get a VLC error. – Sun Nov 21 '15 at 15:00
15

You can actually use ffmpegs builtin concatenation functionality, which is what I think you're looking for:

ffmpeg -i "concat:$(echo *.VOB|tr \  \|)" -f mpeg -c copy -sn -y combined.mpg

See: http://ffmpeg.org/trac/ffmpeg/wiki/How%20to%20concatenate%20(join,%20merge)%20media%20files

Justin Buser
  • 2,813
  • 25
  • 32
  • 1
    you should remove `-sn` since that just strips subtitles which you probably don't want . You should also be able to remove `-f mpeg` – phiresky Aug 15 '20 at 10:22
  • The 'mpeg' format is simply not in the ffmpeg cli documentation – megorit Mar 30 '23 at 10:11
6

The built-in concatenate functionality seems to be *NIX based and didn't work on Windows for me. On Windows VobMerge seemed to work to join the relevant VOB files (which for the main film on a DVD seemed to be the set starting at 1GB in size).

Addenda

You can also join VOB files in Windows directly from the command line:

copy /b "vob1.vob" + "vob2.vob" + "vob3.vob" "voboutput.vob"

You can omit the quotes if there are no spaces in the filenames, but be sure to remember the /b and all the + signs.

SharpC
  • 6,974
  • 4
  • 45
  • 40
0

in windows I preferred to "refactor" concatenation, and also not to rely on predefined filenames:

copy /b  e:\VIDEO_TS\vts*.vob  temp.vob
ffmpeg -i temp.vob .... newfile.ogg

/b means: binary copy; otherwise newlines and such are treated differently.

Caveats:

  • there are sometimes VOB files that aren't part of the movie, and I couldn't find out an automated way to detect which is which
  • on slow I/O systems this adds a huge time hog: it takes time to write and read the temp file.
Berry Tsakala
  • 15,313
  • 12
  • 57
  • 80