Intermediate Usage of the Matrox MPEG-2 I-Frame HD Codec

UPDATE: A different, simpler way to convert to Matrox’s AVI.

UPDATE 2: Make sure you don’t have both Matrox AVI and a Cineform decoder installed on the same PC, at the same time. When you do that, you’ll get red/black frames and crashes with recent Vegas versions. So only have installed one or the other, depending on your project.

I’ve been suggesting either Cineform or Avid DNxHD to transcode into for your dSLR/AVCHD slow footage, but Matrox just released this bug-fixed version of their intermediate codec, that is pretty good too. It’s free, and faster than DNxHD, but not as fast as the $100 Cineform. DNxHD works on a Mac too though. So if you’re PC-only, and you have no money for Cineform, this might be your best option.

1. Install the Matrox codecs from here.

2. Install the latest 32bit Avisynth from here.

3. Install the latest DirectShowSource plugin, by manually placing it on Avisynth’s “plugins” folder (usually C:\Program Files\Avisynth 2.5\plugins\, or Program Files (x86)).

4. Install the latest full version of AC3Filter.

5. Install the MatroskaSplitter (aka Haali Media Splitter).

6. Install the 32bit version of VirtualDub. Do not use the 64bit version.

7. Install the latest ffdshow-tryouts version. Make sure that avisynth and virtualdub plugins are checked, and h.264 decoding is enabled too (it will ask you all that during installation). If you already have CoreAVC installed, you might either want to skip this step, or you can still install it (if you can’t get sound to work) but disable h.264 decoding.

8. Open Notepad and copy/paste the following in it:

@echo off
set root=C:\Users\Eugenia\VideoFootageFolder
set input=%root%
for %%I in ("*.MOV") do @echo DirectShowSource("%input%\%%~nI.MOV") >> "%%~nI.avs"

In the code above, you will have to edit it, and change the video footage folder name, so it points to your own folder with footage. Also, I’d suggest that your folder path has no spaces, and no non-english characters. If your camera does not record in MOV format, change the two instances of the word MOV, with the suffix of your format (e.g. M2TS, MTS, MP4). Save that script file with the name of avs.bat on the same folder as your footage.

9. Open an MS-DOS Command Prompt, and navigate to your footage folder (it obviously requires that you know how to navigate folders using the command prompt, it’s basic MS-DOS usage). Once there, run the script by simply invoking its name: avs.bat

10. For every .mov file in your footage folder, an equivalent .avs file is now created. E.g. 001.MOV now has a very small 001.AVS companion file. Creation of these .avs files will be almost instantaneous.

11. Open VirtualDub (it’s important you follow the follow the steps in the order presented, or you might hit a bitrate-related bug). Select File, Queue Batch Operation, Batch Wizard. Click the litte […] button, and select your footage folder, then click OK. Then, drag-n-drop in that Batch Wizard dialog all the created .avs files (make sure to only drag the .avs files, not the .mov ones). Click Filter Output Names, and type: “avs” (without the quotes) for the “Search for:” input box, and “avi” (without the quotes) on the “Replace with:” box. click Ok. Then click Add to Queue, and then select: Re-Save as AVI. Then, click OK.

12. Click Video, Full Processing Mode.

13. Click Video again, then Compression. From the long list, scroll down, and select the “Matrox MPEG-2 I-Frame HD” codec. Click Configure. In it, select the data rate you want (I’d suggest about 150 MB/sec), and the right frame rate (same frame rate you shot your footage at). Click OK, and OK again.

14. Click File, Job Control. All the .avs files you drag-n-dropped on step #10 will be listed there. Click “Start” to start encoding them. This will take a while.

15. When everything is done, close down VirtualDub, and load on your Vegas/Premiere/MovieMakerHD video editor the newly created .avi files (not the MOV or the AVS files, but the AVI ones). Edit as usual.

Note 1: If you shot some 720/60p or 1080/30p and you want to slow-motion that to 23.976 fps (e.g. music videos do that a lot), then you can do that during this transcoding (no need to do it through your video editor later). Select “Direct Stream Copy” instead of “Full Processing Mode” on step #12. And then click Video again, Frame Rate, and change the frame rate to 23.976 fps (type it). If you shot in 720/50p, type 25.00 in there instead. If you don’t care about the audio (since it won’t sound properly when the video is slowed-down) you can disable its transcoding by clicking in the main menu: Audio, No Audio. Then, continue with step 13 and beyond.

Note 2: Also, if you’re working with AVCHD or HDV footage instead of progressive dSLR footage, VirtualDub can de-interlace for you, or even remove pulldown, during this transcoding process. You just need to load the right internal filters: If you only want to deinterlace 50i/60i footage, just click Video, Filters, De-interlace, Add, and select “interpolate, yadif” from the list. The continue with step #13. If you want to remove pulldown instead (e.g. for PF24 footage), you can modify the MS-DOS script file above to also add TIVTC commands in the generated avisynth .avs scripts.

Note 3: If Vegas thinks that your progressive footage is interlaced, then use this trick to make it think otherwise.


William Eggington wrote on May 15th, 2010 at 9:34 AM PST:

Welcome back. 🙂

al wrote on May 15th, 2010 at 12:10 PM PST:

Good to see you back, Eugenia.

This is the admin speaking...
Eugenia wrote on May 15th, 2010 at 12:19 PM PST:

Thanks, but I’m not exactly back. This blog won’t have more than a few posts per year, and only when I believe that there’s something that I should be sharing, like this tutorial is.

William Eggington wrote on May 17th, 2010 at 12:56 PM PST:

I can live with that.

Glenn wrote on May 17th, 2010 at 8:31 PM PST:

I’ve been converting my 30P Ixy 510 IS videos to the 35mbs Sony MXF format @25P using a trial version the Vegas Production Assistant. It works nicely and only takes a few seconds to set up the conversion with a preset saved. Probably no use to Vegas Movie Studio users, but with Vegas Pro it works a treat. The good thing is, those 720P MXF files will still play and can be edited on my 6.5 year old Dell laptop.

Sovey wrote on May 17th, 2010 at 9:56 PM PST:

I really value your input on codec information. Please don’t stop blogging on that subject as new info comes up.

Sebastian wrote on May 18th, 2010 at 5:08 AM PST:

Eugenia, do you think this codec is faster on Vegas than MXF 1920x1080i files? MXF seems really fast, especially for multicamera, which is rather impossible with AVCHD.

patryk wrote on May 18th, 2010 at 7:08 AM PST:

what with pp cs5 ? is there still need to that even with i7 and 8gb ram with 9800 gtx ?

This is the admin speaking...
Eugenia wrote on May 18th, 2010 at 4:30 PM PST:

>this codec is faster on Vegas than MXF 1920×1080i files?

Possibly no, maybe a bit little slower. However, MXF is just 35 mbps, so when you transcode 48 mbps to 35 mbps, you LOSE quality. With the Matrox codecs you can go up to 300 mbps. I wouldn’t suggest MXF at that bitrate personally, unless you’re using SD footage.

>what with pp cs5?

You don’t need it if you have the right graphics card for it.

>is there still need to that even with i7 and 8gb ram with 9800 gtx?

If you don’t have the right graphics card and CS5, there’s a need. But with CS5, even the software-only playback is faster than in CS3/CS4. But anything else is slow.

Glenn wrote on May 18th, 2010 at 10:40 PM PST:

There’s a 422 50mbps MXF codec in Vegas Pro also.

eric wrote on May 19th, 2010 at 8:46 AM PST:

Thanks for this Eugenia . . . perhaps I can use this when recording in 30p. The fact that the DNxHD codec doesn’t support 30p has kept me from recording at that framerate. I simply haven’t had the extra $$ to grab Cineform (which is still something I want to do).

Does the Matrox codec produces a higher quality intermediate file than the DNxHD codec? The fact that it’s faster is nice, but the real advantage (for me) is that it supports 30fps (it does, doesn’t it?) . . .

Thanks Eugenia. As always, excellent information.

Eric wrote on May 20th, 2010 at 12:51 PM PST:

Eugenia, I tried your method. Everything went swimmingly until I tried to view the files. Nothing. Just a gray screen. Virtualdub couldn’t view them, Vegas couldn’t view them, WMP couldn’t view them. I was quite disappointed.

The other thing I wonder about . . . installing all these codecs when my system already has all the codecs necessary for regular viewing / editing . . . could this have a negative effect on my system as a whole? I mean, ffdshow was telling me to set up my speakers, etc.

For now, since I couldn’t get this method to work, I’ve uninstalled Haali Media Splitter, AC3, ffdshow, etc. and reverted to a registry saved just before I tried this experiement. Why do you need ALL those things to make this method work?

This is the admin speaking...
Eugenia wrote on May 21st, 2010 at 4:30 AM PST:

The method works, if you got a gray screen, then it seems that you were not using the right codec to decode the Matrox files, or your source footage (you didn’t make it clear if it was the Matrox AVIs that were grey, or your source footage).

As for all these things that need to be installed, it’s because it’s the only way to get an application that has batch encoding to support Quicktime or AVCHD files.

Liam wrote on May 23rd, 2010 at 7:01 PM PST:

Eugenia, I did everything exactly as specified. I’m using 1080 29.97p footage from a T2i, followed all the steps. But when I hit “start” on the job control, every file got an “error” status and didn’t render to AVI. Is this a bug, or what?

Comments are closed as this blog post is now archived.

Lines, paragraphs break automatically. HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

The URI to TrackBack this blog entry is this. And here is the RSS 2.0 for comments on this post.