My video conversion process

video_projectorOn a daily basis I record TV shows with my TV Tuner card and convert them for viewing on my Zune HD media player, so I automate the process using a wonderful utility called DVRMSToolbox (DTB). In conjunction with another great tool called ShowAnalyzer, I have a process of scanning through a recorded TV show file to find commercials, strip them out, and then convert the edited video file to WMV format for my Zune HD. All completely automatic.

Now, with a video conversion there’s lot of different converters, options, and settings you can use. For the Zune, I have the option of generating WMV or MP4 formatted files. I prefer using the WMV format, since it is designed to run on Microsoft OS devices. The MP4 is equally good, and is more universal as it can run on the Zune as well as the Apple iPod and other video media players. I opted for WMV because I can add more metadata (e.g., TV Show title, category, etc) than with the MP4 format.

With regards to playback quality, I’m not sure which of the formats (WMV or MP4) is better. That is one thing that I want to investigate in the future. Along with picking a format, there is a multitude of settings you can use. Video bit rate, Audio bit rate and frequency, frames per second, smoothness settings, keyframe rate, etc. are some of the different settings you can use. Each setting will affect the video playback quality as well as the final file size, so there’s a trade off. If you don’t care about file size, you can jack up the settings for the best quality. If generating a smaller file size is important, then you need to dial down these settings.

Being the stickler that I am with my videos, I’ll sacrifice having a larger file size if I can get better video quality. It really annoys me when the video I’m watching has a lot of video tearing, pixelation, bluriness, or jumpiness. I want a really smooth and high quality video for playback on my Zune.

In using DVRMSToolbox, I have several different methods for creating WMV files. The ConvertToFile action is one, the external program called DVRMSToWMVHD is another, and there’s the old standby, Microsoft Window Media Encoder. Over the last few days I’ve experimented with all of them, and have discovered that on my newly rebuilt Windows 7 32-bit system both the ConvertToFile and DVRMSToWMVHD methods create videos that have the audio out-of-sync with the video picture. The two second delay in audio is just enough to drive me crazy, and I can’t seem to track down the problem. I’m guessing it must be a bad or conflicting video/audio codec on my system, but I’m not savvy enough to figure out which one. So, I’ve resorted to using Windows Media Encoder (WME) as my main workhorse for converting videos to WMV format.

With Windows 7 Media Center, my TV shows are recorded in WTV format (new for Windows 7). As such, I need to first run a program to convert the WTV file to the old DVR-MS format so I can use the tools in DTB to do the conversion. So here’s basically what I do with DTB for converting my TV shows:

  1. Convert the WTV file to DVR-MS format
  2. Use ShowAnalyzer to identify all the commercial segments in the DVR-MS file
  3. Use DTB actions to cut out the commercials and create a new edited DVR-MS file
  4. Use the program called ffmpeg to convert the edited DVR-MS file to MPEG2 format
  5. Use Windows Media Encoder to convert the MPEG2 file to WMV format
  6. Migrate the metadata from the original WTV file over to the generated WMV file
  7. Grab an image from the WMV file at the 1 minute mark and save it as a jpg file
  8. Insert the jpg image as cover art into the WMV file
  9. Delete all temp files

Now for step (5), I have the ability to specify several different settings that I mentioned earlier to affect the quality of the generated WMV file. Again, I want the best quality video so I use the following settings:

  • 720 x 480 video size (same as TV recording file)
  • Video bit rate: 1200 kbps (a relatively high rate for fast action video)
  • Frame rate: 29 fps (TV show recording is at 29.97 fps, so I wanted to keep this high as well for high motion in the video)
  • Key frame interval: 1 (I want to use every frame available for the highest quality playback)
  • Video smoothness: 40 (The range is from 0 to 100, where 0 is the smoothest and 100 is the sharpest. I’ve noticed that I get a lot of video tearing (jaggedness) around the edges of moving objects during playback if I set this value too high, so 40 seems to work ok for my Zune HD)
  • Audio bit rate: 128 kbps, 44 kHz, Stereo

Now with those settings, the created WMV file for a 42 minute TV show is about 413 MB which is kind of large, but acceptable by me. My Zune HD has a max storage space of about 29 GB, so I can’t have too many videos on my Zune HD at the same time at that rate. But, I normally don’t have more than 8 videos at a time.

So, it took a lot of experimenting to get a procedure in place for generating acceptable WMV videos for my Zune HD. I still get a little bit of video tearing now and then, but the most important thing is that the audio is in sync with the video.

My next series of tests will be to examine the MP4 format, and see if the playback quality is better than the WMV format. I’ll also need to make sure I can migrate the important metadata from the original WTV file over to the MP4 file, so they are available on my Zune HD screen.


One thought on “My video conversion process

  1. Red5 says:

    Great take it to the next level.
    Once your files have been created daily automatically, use your local web server (IIS 7.0), setup a website, and create a rss feed for your zune to subscribe to…and have the content automatically be configured to have only 5-10 episodes on your zune at a time. You may have to flag the genre of your output as podcast??
    I did this myself with some old time radio audio files, and as I finish listening to some on my zune, my zune is automatically giving me new content. These files were static, (never adding new files) so I just created a static rss feed. Your rss feed would need to change as new content is created.
    Once I get my new zune hd (just ordered it) I may try and figure this out myself…
    Great post.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s