Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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!

share|improve this question

2 Answers 2

up vote 4 down vote accepted

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.

share|improve this answer
    
Added some info on how to change the quality, if needed. –  slhck Jul 16 '12 at 20:34
    
Very useful. I also found out that you shouldn't de-interlace a video (using -filter:v yadif) if it's not already interlaced otherwise the quality will get worse. There is a question here if people want to work out whether or not the recorded file needs de-interlacing. –  Richard Jul 16 '12 at 20:37
    
Yup – that's how I found this post anyway :) –  slhck Jul 16 '12 at 20:41

I was able to get ffmpeg to do the trick, but took some time to find switches that worked. Not sure these are optimum, and the conversion takes a lot longer, BUT it is clean, plays everywhere I have tried, and the audio is correct and in sync.

ffmpeg -y -threads 8 -i pbsvideofile.wtv -target pal-dvd -deinterlace -async 48000  pbsvideofile.mpg 
share|improve this answer
    
todayiwantedtoprogram.tumblr.com/post/15142587796 has a good description on what -target pal-dvd does. It's worth noting that it sets the video bit rate to a, rather high, 6Mbps! –  Richard Mar 30 '13 at 12:44
    
This would be great if it works, because it avoids the intermediate file that is created, written to disk, and deleted. –  Andrew Mao Jan 7 at 19:22
    
Later versions of ffmpeg may be able to convert directly from WTV to H.264/MPEG-4 AVC, but the version I used when the question was asked resulted in no sound - hence the (slightly annoying) middle step! –  Richard Jan 9 at 14:00

protected by Community Jul 31 '13 at 7:52

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.