2

On Linux, cat is a good way to combine multiple files, and pass them to ffmpeg, as explained in FFMpeg open a DVD VOB chain? :

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

This does not seem to work for Windows.

Question: how to use multiple files as input for ffmpeg, with Windows?

These solutions do not seem to work:

ffmpeg -i a.VOB b.VOB c.VOB d.VOB -c:v copy -c:a copy out.avi
ffmpeg -i a.VOB -i b.VOB -i c.VOB -i d.VOB -c:v copy -c:a copy out.avi
1

2 Answers 2

2
  • You can easily resolve it using this answer from @Gyan

ffmpeg -i "concat:a.VOB|b.VOB|c.VOB|d.VOB|...| nn.VOB" -c:v copy -c:a copy out.avi

In the same way that it is done in mp4, explained here

>input.txt (for %x in (*.VOB)do @echo file '%~x') && ffmpeg -safe 0 -f concat -i input.txt -c:v copy -c:a copy out.avi

This can be done by one line:

>input.txt (for %x in (*.VOB)do @echo file '%~x') && ffmpeg -safe 0 -f concat -i input.txt -c:v copy -c:a copy out.avi

  1. Create/Overwrite file >input.txt with (command block) output

      >input.txt (for %x in (*.VOB)do @echo file '%~x')
    
  2. List all files with Name.Extension to output with layout file '%~x'

      >input.txt (for %x in (*.VOB)do @echo file '%~x')
    
  3. Only if last (block command) execution return 0 (by operator &&), then run ffmpeg command:

    ... && ffmpeg -safe 0 -f concat -i input.txt -c:v copy -c:a copy out.avi
    
  • You can also work with different drivers/folders:

    >"%temp%\input.txt" (for %x in ("d:\movies\last\*.VOB")do @echo file '%~x') && "c:\ffmepg\bin\ffmpeg.exe" -safe 0 -f concat -i "%temp%\input.txt" -c:v copy -c:a copy "d:\movies\last\concat\out.avi"
    
2

In the specific case of multiple .VOB input files (ex: DVD), the simplest way seems to be:

copy /b e:/video_ts/vts_*.vob temp.vob

and then encode temp.vob with ffmpeg.

4
  • This doesn't work well at all for WAV files. Something about the metadata makes it think the audio length is only that of the first WAV file the copy reads. The resulting file is a file the size of all files put together, that for some reason won't play more than the data of the first file. Jun 22, 2022 at 5:16
  • @AntonioBanderéz Yes this is specific to VOB files (DVD) and doesn't work for WAV files.
    – Basj
    Jun 22, 2022 at 6:45
  • What is /b? That seems pretty critical.
    – Sawtaytoes
    Oct 21, 2023 at 6:56
  • @Sawtaytoes Here is the full answer about /b: superuser.com/questions/453245/…
    – Basj
    Oct 24, 2023 at 8:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .