Wednesday, 27 September 2017

Combining separate MP4 files into one

Another useful thing I found out that I needed to know that I didn't know that I needed to know (if you still follow!)

Combining two .mp4 files into a single .mp4 file.

So, say you have a NAS and a collection of DVDs and a 'Smart TV'. You decide to "rip" your DVD collection to your NAS so that you can view them on your Smart TV as it is a DLNA device. All good. But what happens when you find out (I mean, remember) that you have a "flipper" - you know a DVD that you have to turn over halfway through playback?

So you know you have to rip it as two separate files, but now it is a stream you don't want the inconvenience of watching the first half of the film only to have to find the second half in your library and start watching that one. No. What you want to do is combine them into a single file.

I have been ripping my collection into MP4 format, but I have read in the original article that this technique will work for any format that VLC Player supports. So, there's the first thing - you need VLC Player.

Here's a link to the original article, but if like me you're a reasonably technically savvy, then here's the boiled down version.

  1. Ensure both clips are in the same format, and the format is one that VLC Player supports
  2. Open a command prompt
  3. Enter the following command with suitable replacements:
  4. [Location of vlc.exe] [first_clip.ext] [second_clip.ext] --sout "#gather:std{access=file,dst=[new_name.ext]}" --sout-keep

    ** Remember that if your paths include long filenames (i.e. spaces), use quotes.

    Here's  a working example of the above command:
    "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" C:\Ripped\Goodfellas-p1.mp4 C:\Ripped\Goodfellas-p2.mp4 --sout "#gather:std {access=file,dst=C:\Ripped\Goodfellas.mp4}" --sout-keep

  5. VLC Launches and starts processing the files. Wait until it is done (the progress bar finishes, er, progressing across the second file), then start monitoring the output folder. It seems to take quite some time until the finished output file grows from 0bytes with no visual output from VLC that it is doing anything! Don't worry - just wait, and press F5 on that Windows Explorer ...
  6. When it is all done, close VLC and the command window

No comments:

Post a Comment