Batch Convert AVI and MP4 files into MKV format

Convert AVI MP4 to MKV Continuing to get your movie collection in order you may find yourself wanting to change order encodes such as AVI or MP4 files into an MKV format. For instance, the easiest way to bypass the new Windows Media Foundation framework inside of Media Center is to use a non-native format such as MKV. Of course, this will also break support on Media Center Extenders as most often they will not support the MKV format.

Converting each movie from it’s current format to another using traditional means can be a task that many would give up before even starting. The idea of converting each file one by one can be daunting for those with large collections. That’s where these files and guide can come in handy. This will enable you to do a batch processing of AVI and MP4 files into MKV files.

Get the tools

Before we get started you will need a couple of items downloaded and installed. The first of which is MKVToolnix, this set of tools will provide the command line program used by the .bat file to convert any AVI or MP4 files which don’t include WMA audio. Install the program using the installer provided on the MKVToolnix website.

Second, this zip file, which includes a .bat file and a directory which should be placed in your movies directory. Also, these files are marked “Hidden” by default and necessity, you’ll need to enable hidden items which you can find instructions for here.

Getting Started

Once you have installed MKVToolnix and extracted the zip file to your movies directory you will need to move all your AVI and MP4 files to the main directory if they aren’t there already. The simplest way to accomplish this is to enter a search in Windows Explorer for .avi/.mp4 and cut/paste into the main directory.

Windows Explorer Search

This is done due to the fact that the .bat file doesn’t use recursive directory codes. There are four different versions of the batch file included in the zip.

  1. Just Convert – Will convert any AVI and MP4 files to MKV
  2. Convert and Move - Will convert to MKV then move to a directory with the same name as the file's name
  3. Convert and Delete - Wil convert to MKV then delete the original AVI/MP4 files
  4. Convert, Move and Delete - Will convert to MKV, move to folders then delete the originals

During conversion, if the file is able to be converted by MKVToolnix’s MKVMerge it will be. This is the fastest method of converting the files to the MKV format as it simply re-muxes the file into an MKV. If the original file uses WMA for audio, however, the conversion will not occur with current versions of MKVToolnix. Support for these files is planned for later versions.

Also, included is a version named simply “avitomkv.bat”. This version includes the ability to convert files encoded with WMA audio by using the HandbrakeCLI from Handbrake.fr. This version is the most robust as it will re-encode all files, however, during this process the original files are deleted. This isn’t optional in this version and is irreversible, use with extreme care!

Stick with Hack7MC

Hopefully, this guide will get anyone looking to do a batch conversion of their media where they need to go. This little .bat file saved me much time recently converting a sizable collection of AVIs to MKV in order to circumvent Windows Media Foundation in Media Center.

Check out more Tips to Organizing Your Movie Collection on Hack7MC!

Merge Multiple Part Videos into a Single MKV Format File

MKVToolnix Have a multipart video you’d like to merge into a single MKV file? MKVToolnix has just the tool for you! Using this handy little app you can pack those multipart AVIs, MP4s, even MKVs and more into a single MKV video file. Just choose the part and let it do it’s thing. MKVToolnix’s MKVMerge GUI takes what could be an otherwise painful task and makes it simple as can be.

To get started download and install the MKVToolnix program from the MKVToolnix website. This amazing little open source product comes in a variation for almost every platform. Once you’ve got it install run the MKVMerge GUI from the programs menu to open the merging program. The interface is simple for beginners but has enough features to satisfy most any user.

MKVMerge Interface

For the basic user, getting started is as simple as adding the separate parts of your video to the input files box using the “Add” button to the right. The file will be read by the program and display the track information below in the “Tracks” box. Separate video and audio tracks should appear for each part added to the input files. Currently, MKVMerge doesn’t support WMA audio however and can’t be merged. An error will appear in the tracks section if this occurs.

Add files to MKVMerge

From here just set the output filename in the input at the bottom of the dialog and press “Start Muxing” to begin the merge. No flash, no fuss, this is one of those apps that just works and that’s the best kind.

Set merged MKV file output

For more advanced users (or perhaps just more demanding) there are also options to include attachments, split files, set chapters and more. All for the same basic interface you have the ability to attach subtitle files and set chapters for your MKV files. There really isn’t much you can’t do with MKVMerge if you have the time or desire to do so.

Attach subtitles and more

Once the process has started merging the files into a new MKV file takes almost no time at all since re-encoding isn’t required to create the new file. This narrows the time spent converting videos down from hours to mere minutes, especially nice for those with larger collections need work. In a matter of minutes MKVMerge will spit out your fresh new MKV file.

Start Muxing MKV file

This really is one of the simplest programs available and the ability to simply remux videos into MKV as opposed to converting them frame by frame is a godsend. Time is precious, save yourself some time by using MKVMerge from MKVToolnix and you won’t regret it. Best of all it’s free!

Become a subscriber to Hack7MC’s RSS Feed or become on of our followers on Twitter and join in the conversation!

Convert MKVs to DVR-MS for Media Center Extenders

WTV Icon Converting MKVs to DVR-MS is the best way to guarantee full compatibility with any extender. Since DVR-MS is the default file type for all pre-Windows 7 (and TV Pack 2008) TV recordings, the file format will have no problem with playback on any Windows Media Center Extender. The DVR-MS file format will also preserve surround sound and full resolution of the MKV files being converted.

Get the Tools

To do this conversion we’ll use DVRMSToolbox which can be downloaded from Andy VT’s Blog. The latest version of DVRMSToolbox will include all the programs we need to do the conversion from MKV to DVR-MS for our Media Center Extender.

The profile for DVRMSToolbox was developed by Ben of Engadget HD with help from Warren Wiltshire of Seagull Consulting. Be sure to head over there and check out Engadget HD as they have lots of great home theater related articles each day.

Let’s Get Started

Once you’ve downloaded and installed DVRMSToolbox launch DVRMStoMPEGSettings from the start menu programs. We will need to tell the profile that we aren’t just working with TV series files and instruct it to not send all the files to Recorded TV.

Since we aren’t exclusively using TV series’, locate “Convert MKV to DVR-MS – mencoder” in the profile listing then press the “Edit Profile” button. Select the line that reads “Read metadata from TvDB and build Sage XML file” and click “Configure”. Check the “ContinueOnFail” checkbox and click OK.

DVRMS to MPEG Settings

Next locate the line reading “Move file specified in Context(‘OutputFile’) to …” and select it then hit “Configure”. Uncheck the “UseRecordedTVPath” checkbox and double-click the DestinationPath dialog box to set the output directory. This will prevent each converted file from being moved to the Recorded TV directory. Alternatively, you could also simply remove this step from the conversion profile. Once this is done, save the profile and exit DVRMSToolbox Settings.

DVRMS Output Directory

After saving the conversion profile you should be able to convert non-TV series files to DVR-MS. Open DVRMStoMPEGGUI from the start menu programs. Once inside, double-click the Input File dialog box and select the MKV file you want to convert (you will need to change the file types dropbox to “All Files (*.*)”). Then set the output file name by double-clicking the Output File dialog box and setting the “Save as Type” dropbox to DVR-MS.

DVRMS Toolbox GUI

Inside the main window set the Process Priority, the higher the priority the faster the transcode should take place. Setting the priority to “Realtime” is not suggested, however, as this can cause system instability. In the Profile dropbox select the “Convert MKV to DVR-MS – mencoder” profile and make sure the “Use Selected Profile” checkbox is marked.

working

Press “Run” to begin the conversion. This process can take quite a bit of time to complete and doesn’t scale well with multiple core systems. The resulting DVR-MS file will most likely take up more space than the original MKV file as well. Any MKV files that have been converted can be deleted after the process is completed.

That’s all there is to converting your MKVs to DVR-MS using DVRMSToolbox. You should now be able to play the converted file on any Windows Media Center Extender.

Be sure to leave a comment on your experience and tips for using DVRMSToolbox and Media Center Extenders below or in the Google Friend Connect at the top of each page!

FFDShow Video in Media Center

logoThere are many choices in the world of codecs (used to play back video and audio on the pc). One of the most popular is FFDShow. While there is already a guide on using FFDShow Audio in Media Center there is the other half to consider as well: FFDShow Video. While we are able to get FFDShow audio to work in all parts of the Media Center including live TV, FFDShow Video isn’t quite as forgiving.

While you can’t use FFDShow Video in live or recorded TV on Media Center, it is possible to use it for just about anything else. The video side of FFDShow offers a wide range of compatibility for playing back the most popular video file formats. It also offers the ability to fine tune and adjust the video output to get the best quality picture.

body of lies

Getting FFDShow to play your movies in Media Center is relatively simple. Just download the latest FFDShow tryouts (and x64 SVN if you’re running Windows 7 x64) and install the package(s). If your movie collection includes MKV files, follow the directions in this guide for MKVs with FFDShow.

Once installed FFDShow should take over playing your media back in most situations. You can double check using this guide on checking codecs with Graphstudio. If for some reason FFDShow has not taken over playing your video files, increase the merit of the codec from the video decoder configuration in the start menu. Slide the control all the way to the right, apply the settings and recheck Graphstudio to confirm this worked.

FFDShow Video Merit

Once FFDShow Video is handling the video output it’s time to tweak the settings from inside the video decoder configuration. This can be found in the start menu under FFDShow and FFDShow64, choose the appropriate one for your system. Configuring both is a good practice to normalize playback all around for your system if you run an x64 version of Windows. Once inside you can see a slew of available options.

FFDShow Video Settings

Some of these options can use quite a bit of processing power (cpu) and currently FFDShow doesn’t support video hardware acceleration (and likely never will). If you have the horsepower to handle it, however, you can improve the quality of all your compressed videos to some extent.

fear and loathing

The settings in the video portion of FFDShow will, to some degree, be subjective. Each user will have to adjust settings to find what works best for their preferences and hardware. Typically, users will focus on post processing, picture properties and blur & noise reduction. These three settings pages can improve the sharpness and contrast of videos in many cases.

Post processing can be used to decrease the amount of blocking (the appearance of pixilated areas) by selecting the checkbox in the navigation pane or the top of the settings page. This filter will require a lot of processing power, however, with the amount of power required being dependant on the resolution of the video. Using post processing on high definition content is recommended only for the highest spec’d machines.

FFDShow Postprocessing

Picture properties can be used to do basic color correction. You can increase or decrease the gamma, brightness and contrast as well as correcting the colors of your output. Adjusting luminance gain and offset can refine the contrast and brightness respectively improving the output quality of videos that seem washed out or dull. Adjusting the gamma can improve the brightness of the video. There is also a full compliment of controls for adjusting the color output.

babylon a.d.

Blur and noise reduction can help to clear up any unwanted noise or static in the picture from compression.  You can also find controls to soften the picture which can be helpful if the video has pixilation around the edges of objects. If the opposite is the problem and the video isn’t clear enough, enabling the settings under the sharpen option can clear it up.

Hopefully this short guide has gotten you on your way to using FFDShow Video for your movies and videos in Media Center. Much of the process will be fine tuning each setting to get the best picture from your hardware and also suited to your tastes. Look for more on FFDShow and other codecs in the future on Hack7MC.

Have any tips on FFDShow settings? Let us know in the comments below!

10 Steps to a Better Media Center

10 Steps to a Better Media Center

Setting up your Windows 7 Media Center is easy, making it your own can be easy too. Here are 10 simple steps you can take to make your Media Center experience more complete, more personal, more enjoyable.

  1. Add ClearQAM to Your TV Listings
  2. Add Custom Apps to Your Extras Library
  3. Do It Better – Add Apps with Custom Icons and Details
  4. Add MKVs to Your Movie Library
  5. Use A Better Movie Library – Media Browser
  6. Expand Your Sound from Stereo to Surround
  7. Play Your Music in FLAC
  8. Check Your Local Weather
  9. Listen To Online Radio through Shoutcast
  10. Add Boxee Streaming TV to Your Media Center

These 10 simple hacks will create a better Media Center for you and your family to enjoy. Don’t forget to check back to Hack7MC to get the latest hacks for your Windows 7 Media Center.

Keep in touch: Bookmark Hack7MC on Del.icio.us, subscribe to the RSS Feed or even Follow along on Twitter.

MKVs for Minimalists on Windows 7

FFDShow Installer Logo Sure there’s nothing wrong with codec packs, Shark007 and CCCP are wonderful products, but there is something to be said for keeping it simple as well. This guide will take you through the minimum steps to install a nice clean setup with the minimum software required to play MKVs and many other less popular codecs as well. For this setup we are going to install only FFDShow and Gabest’s MKV splitters for x86 and x64 if that’s what your running.

Step One: Download a copy of FFDShow Tryouts from here. Those running an x64 version will also need the x64 SVN here. Install the right ones for your system, the latest versions will work.

Step Two: Download Gabest’s Matroska Splitters. There is a version of Gabest’s with an installer for x86 here and x64 here. To install simply extract to your C:\ root drive and right-click to run “gabest_splitter_enable.cmd” as administrator. You should receive one confirmation on x86 and two for x64 versions.  To uninstall simply run “gabest_splitter_remove.cmd” as administrator.

Step Three: Enable viewing of MKV files in Windows Media Player and Windows Media Center by downloading either the x86 registry file or x64 registry file and double-click to add it to your registry. Allow it to be added when prompted. Restart your machine.

That’s all there is to it, this will take you from a clean install to playing MKVs and more in no time at all. For details on using FFDShow Audio settings for your live TV and DVDs in Media Center check this article.

Media Center Movie Library

If you have trouble viewing your MKVs in Windows Media Center or Windows Media Player, try deleting your “C:\Users\YOUR-USERNAME\AppData\Local\Microsoft\Media Player\CurrentDatabase_371.wmdb” file. To enable this file to be deleted you will need to stop the WMPNetworkSvc service from the task manager (ctrl-alt-delete).

Check your codecs with GraphStudio

At times installing codecs for all your music, movies and what have you seems to be 30% science, 70% voodoo. Fortunately, there is a way to double-check our brew to make sure it’s running the way we originally intended.

GraphStudio will allow you to load your media files and show you the codecs being used to render it. It will show your every DirectShow codec, filter and post-processor in-between you and your files. Best of all it’s free and available for download in both x86 and x64 versions on RadScorpion’s blog.

Monogram GraphStudio

Using GraphStudio is fairly straight forward for basic checking of your codec settings. Load your media files by going to the menu “File > Render Media File..” After a few moments you will receive a graph displaying all the processing your file is undergoing between execution and being rendered.

You are also able to adjust the properties of your codecs, simply right click on the codec you wish to adjust and select properties. If there are any properties that are able to be edited you can adjust and save them from this window. This properties window will also display the input and output variables before and after the selected codec which can be good for troubleshooting things such as audio channels.

Graphstudio FFDShow Settings

Through the basic controls on the menu strip you can even view the before and after results of your settings changes. This gives you the perfect opportunity to fine tune your codec’s settings until you get the best picture and audio results for your setup.

Graphstudio Play Controls

Unfortunately, as of this point GraphStudio doesn’t add an easy way to edit which codecs are used for your media files, just the properties of the currently assigned codecs. Though you can edit filter merits through the “Filters > Manage Favorites” dialog it’s certainly not convenient or intuitive. Other programs like Filter Manager offer a much better interface for editing which codecs are loaded for each file type and will be covered in future articles.

Playing MKVs in Media Center

Don’t like codec packs? Try this: MKVs for Minimalists on Windows 7

The first step to playing MKV (Matroska) video files in your Media Center is to make sure your system is capable of playing MKV files in the first place. There seem to be innumerable ways to accomplish this and everyone has their own preference. For the sake of this small post I'm going to recommend a codec pack. Codec packs are often shunned as being bloated and containing conflicts within their own packages but I've found that the Shark007 Codec Pack is an unbloated and simple solution that just plain works. Currently Shark007 has a codec package specifically for Windows 7 in beta and the x64 Components are well tested and will work in Windows 7 as well.

For Media Center, users running an x64 version of Windows 7 who wish to use the codec pack will need both the codec pack and the x64 components. Users running an x86 version of Windows 7 will only need the basic codec pack.

Remember, there are many different ways to install mkv support on your Windows 7 machine, Shark007's codec pack is just one solution that works in both x86 and x64. There are many other resources around that can help you set up mkv support without codec packs and even alternative codec pack solutions to be used. If you’re looking for a more light-weight install try this guide: MKVs for Minimalists on Windows 7.

The second step is to get those mkv files displayed in Media Center (and Windows Media Player as well!). This step is even simpler than the first. To get mkv files to display in your Movie library all you need to do is install a simple registry fix.

Download either this x86 reg file or this x64 reg file to your desktop then double-click to run the file. A dialog will appear asking you to confirm adding the file to your registry, click to allow. Then restart your computer and voila! mkv files should now appear in your Windows 7 Media Center Movies Library (provided you setup your DVD Library to point to a directory containing mkv files).

Don’t forget to Try our guides on MP4 or Flac files!

Hack7MC Has Moved!

Hack7MC has left Blogspot for a new home. Following the original address @ http://www.hack7mc.com will take you to the new home page.