Video Conversion – How to Convert WTV and DVR-MS Files to Smaller Formats

handbrakevideo conversionwindows-media-center

The external hard drive on my HTPC is almost full and so I'm going to need to convert a large number of the films recorded from the television (in WTV format) into something smaller. At present, a 2 hour film is about 3-4GB.

I've tried converting the WTV file to DVR-MS (using the built in wtvconverter.exe) and then running it through handbrakecli with the following command line:

handbrakecli.exe --input "film.dvr-ms" --output "film.mp4" --encoder x264 --quality 20

In Handbrake, this would be by setting the output to MP4, the encoder to x264 and the quality to 20.

The problem is that the resulting MP4 is between 1.5 and 2GB which, whilst smaller than the original file, still seems insane for a 2 hour long SD film recorded off (a PAL) television! I would expect something like that to be 700-800MB, if not less.

Setting the quality to 19 degrades the picture to the point it's unwatchable.

Can anyone recommend settings for Handbrake (or handbrakecli) which will convert a DVR-MS file into a much smaller size?

(I'm not particularly precious about the codec or the container, but would prefer something reasonably standard to ensure it can be watched on a high number of computers and mobile devices)

UPDATE

It's probably not clear, but if you only know what the settings are to convert a file using the graphical version of Handbrake, then that is a perfectly good answer!

Best Answer

Please note: When this answer was written (July 2012), ffmpeg couldn't convert WTV files without loss of audio. However testing on ffmpeg 4.0.0 has shown that it now works fine and, as a result, there is no need to use wtvconverter.exe to pre-convert the WTV file to DVR-MS. As such:

ffmpeg -i "input.wtv" -y -filter:v yadif -vcodec libx264 -crf 23 "output.mp4"

should convert your television recording.

Original answer below

After some research it turns out that:

  1. Handbrake isn't the best tool for this, you should use ffmpeg instead.
  2. When using ffmpeg, you need to use the DVR-MS format (and not the WTV format) as the source file, otherwise you'll end up with no sound.

You need to perform a couple of steps, firstly converting from WTV to DVR-MS:

%WINDIR%\ehome\wtvconverter.exe "Recorded TV Show.wtv" "Recorded TV Show.dvr-ms"

Then converting that DVR-MS file to H.264/MPEG-4 AVC. You can change -crf 23 – higher numbers mean lower quality, sane values are from 19 to 25:

ffmpeg -i "Recorded TV Show.dvr-ms" -y -filter:v yadif -vcodec libx264 -crf 23 "Recorded TV Show.mp4"

Then deleting the temporary DVR-MS file:

del /F "Recorded TV Show.dvr-ms"

Once converted, VLC will give the following details about "Recorded TV Show.mp4":

enter image description here

The file I converted is now 530MB (down from 1.59GB) for 1 hour and 50 minutes of SD content. This means it is approximately 1/3rd of the size of the original WTV file.