03 January, 2014

Converting MTS files to DVD video for free

burn burning encode encoding transcode transcoding transfer transferring render rendering

A Rant

I hate the current state of video formats. It's an utter mess. Every digital still camera will produce jpeg files. Even though jpeg files might come in a few different varieties (e.g. progressive), they're still largely intercompatible. Video recording and playback devices deal in at least 4 major formats, and converting between them is a pain. Downloaded videos are worse. The worst part is the file extension tells you nothing. It's just a "container". So a file ending with .avi might be encoded in mpeg, divx, xvid, H.264 or many other codecs. And files with the same encoding but in different containers are different as well. Companies are well aware of this absolute chaos of formats, and try to profit from it. As a result any searches for converting videos or related terms returns various software offering to do it for you. The websites of these software are usually of dubious intent, bordering on malicious, with a minefield of fake Download buttons and offers to "scan" and "fix" "problems". Which is even more maddening when you know there's software out there to do it for free.

The Situation

Ok so I have some .mts files from a video camera, which are apparently in h264 and mpeg-4 format, and I wanted to convert them to DVD video, which can be played in a DVD player.
  • Windows DVD maker on Windows 7 only supports .avi, .mpg, and a few others, but crucially not .mp4. Typical Windows - only supports the bare minimum of formats.
  • Handbrake can only output to .mp4 or .mkv.
You'd think that converting between these 2 formats would be quite common, but I couldn't find any direct guides.

The Solution

At first I used Handbrake, but it had 2 problems:
  1. In batch mode, some videos were converted wrongly (it resized the videos)
  2. I needed to merge videos, as I had lots of short clips and a DVD can only hold 50 "titles"
So the final solution is to use Avidemux. Here's what to do:
  1. Install Avidemux (64-bit if possible)
  2. Open Avidemux and open your file
  3. If you want to add/merge/append more videos, choose File - Append. Or you can drag videos into the Avidemux window. Check the total length of your video on the bottom left:
  4. Avidemux has built-in settings for DVDs, however if your videos are in 16:9 aspect ratio, this will add black bars to make it 4:3. So, use these adjusted settings for a 16:9 DVD:
  5. Video Output: Mpeg2 (ff). In Configure: Aspect ratio 16:9, Threading Two threads, Encoding mode Constant quantiser, Quantizer 2; VBV Buffer Size 224, Matrices Default, Number of B frames 2, Gop size 18, Max bitrate 9500; Interlaced Progressive, Field Order Top field first; Macroblock decision Rate distortion, Min quantizer 2, Max quantizer 31, Max quantizer difference 3, Trellis quantization off; Filesize tolerance 8000, Quantizer compression 0.50, Quantizer blur 0.50
  6. Filters - Transform - swsResize: Lock Aspect Ratio on, Source and Destination 16:9, Width 720, Height 404, Resize Method Bicubic
  7. Audio Output: AC3 (Aften), Configure - Bitrate 256, Filters - None and all unchecked
  8. Output Format: Mpeg-PS Muxer( ff). Configure: Muxing Format Free, Allow non compliant stream off, Total Muxrate 11000, Video Muxrate 9800, VBV size 224
  9. File - Save (yes, it should be Save As. Yes, Save as type is "All Files", but it'll automatically add the correct extension)
  10. You should have produced a file with extension .mpg. Now you can open Windows DVD Maker and add all your files.

Further Rants

Presets for HandBrake are surprisingly hard to find. I expected there to be lots of lists, with at least "here's the most efficient compression for DVD rips" and "here's the best format for videos going on DVD". Could be because the presets don't seem to save enough settings - at least not Anamorphic.

Workflow 12 August 2014

This is the latest sequence of steps I'm using to convert my videos:
  1. Install and open Avidemux (I prefer 64-bit)
  2. Load your videos. Drag the first video into the Avidemux window and use File-Append (Ctrl+A) to add-on videos. Choose no to loading all the files in the sequence. Sometimes it gives an error if you add too many files. When that happens, I like to close the file (Ctrl+W) and try again with less files. I usually stick to 2-3 files at once. You can always combine them later.
  3. Choose Video Output - Copy and Audio Output - Copy. Output Format - MP4v2 Muxer.
  4. File-Save (see above, yes, it should be "Save As"; don't worry about the extension, leave it blank). At this stage I like to name the file with the names of the input files i.e. if I'm combining 1.mts, 2.mts and 3.mts, I name the output 1 2 3.
  5. It will very quickly produce an .mp4 file.
  6. At this point, check the output file. I haven't found any mistakes but I like to check around the transitions, and that all the clips have sound. i.e. if the 3 clips above are 1 minute each, I'll check 0:55 to 1:05, 1:55 to 2:05 and that there's sound.
  7. If the output is ok, delete the .idx2 files, the original files (keeping copies somewhere else), and move the output file to the output folder.
  8. If you need to combine 2 output files, repeat this. But note you can't combine a .mp4 file with a .mts file. The solution is to convert the single .mts file to a .mp4 file first.
  9. I haven't gotten to this point yet, but I'm going to use the .mp4 files in DVD Flick. This is the long rendering step. This way you only have to render the files once, because in the previous method I was rendering them once with Avidemux to mpeg2, then DVD Flick rendered them again, wasting a lot of time.

No comments:

Post a Comment