View Full Version : Intermediate Codecs for Windows Users


Rich Castro
December 29th, 2008, 04:49 PM
Like many others I have been wrestling with these 5d video files. From various posts I've learned that the files created are simply not suited for editing natively.

I've toyed with the cineform and mpeg streamclip. The results were great, but its a bit pricey for a complete amateur / newbie.

With that said, what are the various options for intermediate codecs? What are the pro + cons of the different codecs? What codecs are fast to transcode? What are some affordable options? Are there free options?

Any help would greatly be appreciated.

Daniel Lipats
December 30th, 2008, 04:35 PM
Rich,

I am using the almost free CoreAVC and AviSynth to transcode to the lagarith codec. This process preserves the 0-255 range the camera captures and won't clip highlights and shadows. You can then import into any NLE to edit, I use Premiere.

Rich Castro
December 30th, 2008, 10:15 PM
Thanks Daniel.

I'll try this method out. Too bad I'm out of town and can't test it out now!

Andy Olson
December 31st, 2008, 10:51 AM
Another intermediate codec you might try would be DVFilm Raylight (http://dvfilm.com/raylight/index.htm) AVI's. I'm not 100% that it works with the files from the Canon 5D but mostly like it does. You can download a free demo here (http://dvfilm.com/raylight/RaylightDemoUnzip.exe). It does cost something but it's only about $150 on sale now.

I think there are quite a few options for free that deal with SD, but not with HD codecs. You can always try uncompressed avi's or quicktime's if you have the cpu power and space. I've also heard that Animation codec is a good option and is a base codec on most systems.

Hope this helps,
Andy

Mark Williams
December 31st, 2008, 11:24 AM
Although I don't have the 5d, I have been experimenting with HD 5d files transcoded with the free mpeg streamclip program out to a DV25 file. What is weird is that the transcoded file shows 28.9 Mbits/s which is higher than the 25 Mbits/s DV25 standard (13% higher bitrate). The transcoding is fast and once placed on my old premiere 6.5 SD timeline and rendered, it looks extemely good. If you only have SD editing software and a underpowered computer like me, this might be a good route to go.

Robert Martens
December 31st, 2008, 09:46 PM
New Year's addendum! Daniel, in a post below, reminded me of the built-in DirectShowSource filter in Avisynth, which you should try first in lieu of the QTSource plugin I mention below. All my other instructions remain the same.

----

If, like Daniel (and myself, as will become evident), you're the type willing to install and noodle around with AviSynth, you can take advantage of a couple of little known extras to maybe save yourself the time and disk space of rendering files to an intermediate format. I've only toyed with footage I've downloaded from Vimeo so far--I'm not in the market for a DSLR (my new point and shoot T500 does good enough HD for my taste), and couldn't afford the Mark II if I was--but they are in fact H.264 Quicktime files, and they load up just fine. Could be different with straight-from-the-camera footage, but I wouldn't imagine that's the case.

It's pretty simple, really; takes longer to explain than it does to set up. Beside installing AviSynth, head over to this page (http://www.tateu.net/software/) and grab the QTSource binaries (third item down, unless you also want the source code, which is below it). Copy the DLL, and help HTML for later reference, to your AviSynth plugins directory.

That's all there is to the most basic setup; if you create a simple .avs script with the line QTInput("directory/subdirectory/filename.mov", audio=true) you should be able to load said file in any applications that support AviSynth scripts, VirtualDub being the big one. Problem with the plugin is that for some reason I can never hear the audio in VDub. If I render a file from the software, the audio is in fact present, you just can't hear it in your editing/compositing/transcoding/playback software.

The solution to that is the same solution to the problem of apps that don't work well with AviSynth. Quicktime Player, Liquid and combustion are three that come to mind, as I use them myself. This is where the Avisynth Virtual File System (http://www.turtlewar.org/avfs/) comes into play. Sounds harder to use than it is. Grab the file listed on that page under "Download", then get the latest Pismo File Mount Audit Package (http://www.pismotechnic.com/download/). Free for personal and commercial use, if I read their site correctly, and is useful even without the AVFS addon we'll be installing. By its lonesome it allows you to mount ZIP and ISO files, among others, as virtual folders on your computer.

Run the installer for the Pismo thing first, then follow the instructions in the AVFS readme; a bit more complicated, but not the end of the world. You just unpack the DLL (forget everything else, you don't need it, though more advanced users may want to examine the technical information in "sample.avs") to a directory of your choice, in my case C:\Windows as the readme suggests, open a command prompt, and type "pfm register c:\windows\avfs.dll". No quotes, of course, and change the directory you type if you've chosen to place the file somewhere else. Uninstallation, should you choose, is just as easy. pfm unregister c:\windows\avfs.dll, then delete the file.

Once that's all done, you can right-click any .avs file on your system and choose "Quick Mount" (or Mount, if you want some more detailed options) and the software will go to town. After a moment you'll see a folder with a little blue arrow on it appear where your script was. Open and explore it like any other directory. As far as Windows and all your applications are concerned, there's an AVI file in there, when in fact the usual frameserving capabilities of AviSynth are at work. You might say that since a frameserver only serves the frames as they're requested, long GOP files will still be difficult to edit, and you might be right if not for the fact that the AVFS includes read-ahead functionality (specifics in that sample.avs file I mentioned earlier) that grabs frames beyond what you're requesting, improving performance noticeably. I know not everybody's got a shiny new quad core system, but it still helps. And yes, before you ask, you can have as many files mounted at once as your system can handle. You can even mount them all in one go; just select them all in explorer, right click, Quick Mount, there you have it! Unmount does the opposite, returning everything to its earlier state when you're done working with the files.

An important note! You may need to add a ConvertToRGB24() at the very end of your scripts to get some programs to open the fake AVI files; Quicktime Player, for example, won't work without this, though combustion didn't need it. Try it both ways, see what works with your software of choice. Nobody likes a color space conversion, I know, but if you have to, you have to.

I understand many people are put off by the prospect of installing new software on production machines, but I figure some of the more adventurous among us may get some use out of this; those intermediates can get pretty damn big, especially at 1920x1080.

Daniel Lipats
December 31st, 2008, 10:52 PM
Robert,

I just tried it with After Effects. It works great as long as I use DirectShowSource and CoreAVC. Using QTInput will load but not display.

Thanks a lot for taking the time to share that. This is a much better way.

Robert Martens
December 31st, 2008, 10:54 PM
I completely forgot about DirectShowSource! Sorry, I'll go add that info to my post. Thanks for the info!

Julian Frost
January 1st, 2009, 12:39 AM
I can load the 5D mk II video files into Premier Pro CS just fine, but playback in the project monitor sucks (it's far from realtime), and, if I have more than a coupe of clips on the timeline, Premier crashes when I try to render out using a frameserver into TMPGEncXpress. Premier starts grabbing a bunch of virtual memory and doesn't stop until it's got well over 2.75GB.

I tried the AVSynth method described above, and Premier behaves exactly the same as before.

Julian

George Kroonder
January 1st, 2009, 08:26 AM
since you mention CF in your post, you may be interested in this thread: http://www.dvinfo.net/conf/cineform-software-showcase/140560-cineform-discontinues-neo-hdv.html

George/

Daniel Lipats
January 1st, 2009, 09:08 AM
Canon 5D Mk-II is not an HDV or AVCHD camcorder so it requires more than NEO Scene offers. Neo Scene is HDV/AVCHD only. All our other tools do support Canon 5D Mk-II.

Looks like the only source it supports is M2T, M2TS and MTS. Other than that its perfect. Support 1080, source framerate, 10-bit and 4:2:2. It's really a great deal for anybody working with HDV.
CineForm's Neo Scene - Cinema Qualityfor Consumers (http://www.cineform.com/products/NeoScene.htm)


I can load the 5D mk II video files into Premier Pro CS just fine, but playback in the project monitor sucks (it's far from realtime)...

Premiere will load the .MOV files directly but only the 16-235 range (at least on my system). There are a lot of threads here that cover this so it would not make much sense to go over it again. I did attach an image showing the histogram from the transcoded video, frameserver and original.

Some videos playback in real time, but not all. You would need a proxy for editing if your system can't keep up.

Robert Martens
January 5th, 2009, 02:54 AM
Just a couple of extra notes, if you don't mind, guys:

First a heads up, the final version of Avisynth 2.5.8 was released a few days ago, anyone interested in pursuing an this frameserving setup may benefit from the bugfixes and optimizations: SourceForge.net: Avisynth rev. 2: Files (http://sourceforge.net/project/showfiles.php?group_id=57023)

Then there's this post (http://forum.doom9.org/showthread.php?p=1221305#post1221305), over in a doom9 thread, which contains a link to tateu's latest alpha for QTSource. Changes a few things, he says, so give it a try if you run into any problems. Sorry I didn't see it sooner.

I also neglected to mention the wonderful FFmpegSource (http://forum.doom9.org/showthread.php?t=127037) earlier. I've had little success loading audio with the 2.00 version--though the video does seem to playback a touch faster--but grab the "unsupported, obsolete" version 1.21 and use FFmpegSource("directory/subdirectory/filename.mov",atrack=-1) to get your footage loaded up. Audio input is disabled by default; that -1 argument tells the filter to use the first suitable track it finds as the audio source.

If you really want to go crazy, do what I'm doing. Download and install both versions of FFmpegSource, and use this simple script:

video = FFVideoSource("directory\subdirectory\filename.mov").Crop(0,0,1920,1080)
audio = FFmpegSource("directory\subdirectory\filename.mov",vtrack=-2,atrack=-1)
AudioDub(video, audio)

The words video and audio here are variables, you can name them whatever you like in your own scripts. FFVideoSource is the name of the video source filter in the new version of Myrsloik's plugin, FFmpegSource is the name in the old version. The Crop is there to take care of the extra eight lines in 1080 HD sources, and uses a left, top, width, height syntax. Other types of footage may not require it, and CoreAVC has an option to crop 1088 source already, so eliminate that part of this script as necessary. AudioDub is a builtin filter that does just what it says. In the second filter, FFmpegSource, vtrack is set to -2 so it's disabled--all we want is the audio, no picture--and atrack, again, is set to use the first suitable track it finds as the source of audio.

Read the associated documentation for Avisynth and all the other plugins mentioned to get more detailed options. In particular, fpsnum and fpsden for FFVideoSource that will let you more accurately define the framerate (30000 over 1001 for NTSC sources, for example).

Keith Paisley
January 5th, 2009, 12:03 PM
Robert,

I just tried it with After Effects. It works great as long as I use DirectShowSource and CoreAVC. Using QTInput will load but not display.

Thanks a lot for taking the time to share that. This is a much better way.

Ok, an update. I tried this and everything appeared to be "good", but then after poking around a bit, unless I'm getting some incorrect information back from the tools I'm using, it seems that mine's not using the CoreAVC codec (the reported codec is shown to be divx 6.8). Plus, looking closely at a few clips, even though the histograms of these frameserved files look correct, I'm still losing some detail.

Does anybody know how I can force avisynth to use the CoreAVC codec?

Daniel Lipats
January 5th, 2009, 12:31 PM
Try the Re-Register item in the start menu group.

Also check the configuration and make sure preferred decoder is checked and enable tray icon just to make sure its decoding while playing.

Keith Paisley
January 5th, 2009, 01:52 PM
Try the Re-Register item in the start menu group.

Also check the configuration and make sure preferred decoder is checked and enable tray icon just to make sure its decoding while playing.

Thanks for those tips. I was halfway able to get it to invoke coreavc. The icon pops up into the tray now whenever I "quick mount" the .avs script. To get to this point, I had to uninstall the full divx suite. The problem now is that when i open the synthed .avi file in Vegas Pro, it only pulls in an audio stream. I can view the "synthed" .avi in mplayer2 (old windows media player), WMP 11, and I can confirm that these players are using the coreAVC codec.

Any other ideas? Has anybody else been able to utilize coreAVC from within Vegas Pro using this method?

Jay Bloomfield
January 5th, 2009, 07:55 PM
Any other ideas? Has anybody else been able to utilize coreAVC from within Vegas Pro using this method?

I think we discussed this before. Vegas will not use CoreAVC. Vegas only uses Video for Windows codecs and CoreAVC is a DirectShow decoder. No matter what you do, Vegas will always use it's built-in VFW h.264 decoder (mp4plug2.dll). The frameserving option may work, but I've never been able to frame serve properly into Vegas only out of it.

Keith Paisley
January 5th, 2009, 09:50 PM
I think we discussed this before. Vegas will not use CoreAVC. Vegas only uses Video for Windows codecs and CoreAVC is a DirectShow decoder. No matter what you do, Vegas will always use it's built-in VFW h.264 decoder (mp4plug2.dll). The frameserving option may work, but I've never been able to frame serve properly into Vegas only out of it.

Well, I managed to make it work. But you have to go into the CoreAVC configuration and set it to output RGB24. Apparently Vegas' AVI plugin just doesn't like YUV.

There's a problem, though; the video you get from this is inverted both vertically and horizontally. That can be fixed with AVISynth and/or Vegas, but in the end the preview frame rate on the timeline and scrubbing takes a pretty major hit, which basically makes this option no more attractive than any of the other alternatives that have been explored.

Robert Martens
January 5th, 2009, 09:59 PM
My apologies for scattering all these instructions across two threads, but that inversion can be avoided by doing the RGB conversion with Avisynth instead of with CoreAVC as described here (http://www.dvinfo.net/conf/989439-post43.html); the ConvertToSuchandsuch() filters run faster than a FlipVertical(), if I'm not mistaken.

And although I mentioned it in this thread, I find that the "Crop 1088 to 1080" option in CoreAVC doesn't work, at least through Avisynth, so you'll still need to use a crop filter, making the ultimate process as follows:

1.) Download and install the Pismo File Mount Audit Package, the Avisynth Virtual File System plugin, and CoreAVC.
2.) In CoreAVC, turn on Preferred decoder.
3.) Create your script, which is now much simpler:

DirectShowSource("directory/subdirectory/filename.mov").Crop(0,0,1920,1080)
ConvertToRGB24(matrix="Rec709")

Then, if necessary, use the Avisynth Batch Scripter (http://www.designfoto.nl/ABatchScript.htm) I mentioned in the Vegas thread to create more than one script at a time.

I hope this helps, and again I'm sorry for being all over the place and confusing.

Mark Hahn
January 5th, 2009, 10:56 PM
I've worked with premiere for years now and I'd love to have some codec working decently with my 5D2. I'm willing to re-encode multiple times if the editing is smooth and little quality is lost. I've read this thread slowly several times and it is total Greek to me.

Has anyone on this thread actually gotten any intermediate codec solution that they are happy with? I can't tell from this thread.

Keith Paisley
January 6th, 2009, 10:34 AM
My apologies for scattering all these instructions across two threads, but that inversion can be avoided by doing the RGB conversion with Avisynth instead of with CoreAVC as described here (http://www.dvinfo.net/conf/989439-post43.html); the ConvertToSuchandsuch() filters run faster than a FlipVertical(), if I'm not mistaken.

And although I mentioned it in this thread, I find that the "Crop 1088 to 1080" option in CoreAVC doesn't work, at least through Avisynth, so you'll still need to use a crop filter, making the ultimate process as follows:

1.) Download and install the Pismo File Mount Audit Package, the Avisynth Virtual File System plugin, and CoreAVC.
2.) In CoreAVC, turn on Preferred decoder.
3.) Create your script, which is now much simpler:

DirectShowSource("directory/subdirectory/filename.mov").Crop(0,0,1920,1080)
ConvertToRGB24(matrix="Rec709")

Then, if necessary, use the Avisynth Batch Scripter (http://www.designfoto.nl/ABatchScript.htm) I mentioned in the Vegas thread to create more than one script at a time.

I hope this helps, and again I'm sorry for being all over the place and confusing.

yes, that helps a lot.

I've observed that this seems may be a pretty good solution if you're only frameserving a single clip, but if your working with multiple clips, the framerate falls through the floor. I put together a test project with 5 different clips being frameserved and there's a LOT of disk thrashing and it's only showing around 0.2fps on the preview timeline (which is down from around 6-8fps for a single clip). I'm guessing the Pismo package is a little resource intensive.

Sigh.... I wish there were some way for Sony to simply add full directshow support...

Robert Martens
January 6th, 2009, 06:23 PM
Yeah, it's not perfect; seems we either use up the time and disk space to render intermediate files so we can have faster playback, or we save the space but can't play fast enough. I don't think it's so much the Pismo system as it is just the nature of frameserving so many files at once. Lots of disk access, and slow playback when doing so many things at the same time. Such is life.

If you'll indulge me, however, I just tried something that may help. I copied the single file I'd been using for testing a few times and mounted all of them via AVFS/PFM. Brought them into a Vegas project and, as you reported, slower than you can imagine (less than half a frame per second). I then browsed the AVFS sample file, however, and saw the No Interleave option. Adding AVFS_AVI_NoInterleave=true to the top (the very top, AVFS options apparently have to be the first lines in a script) of each script bumped my timeline playback--with Preview Quality set to Preview (Auto)--up to between thirteen and fifteen frames per second.

I also tried tweaking the AVFS_ReadAheadFrameCount variable, but it didn't make much positive difference. Setting it to 60 slowed everything to a crawl, dropping it to 7 shaved a few frames per second off the playback speed, and turning it off completely barely did anything. I guess there's a sweet spot in there somewhere for certain types of source footage, but I can't find it. For the moment the only setting that seems to improve performance is the NoInterleave thing.

Keith Paisley
January 7th, 2009, 08:50 AM
Yeah, it's not perfect; seems we either use up the time and disk space to render intermediate files so we can have faster playback, or we save the space but can't play fast enough. I don't think it's so much the Pismo system as it is just the nature of frameserving so many files at once. Lots of disk access, and slow playback when doing so many things at the same time. Such is life.

If you'll indulge me, however, I just tried something that may help. I copied the single file I'd been using for testing a few times and mounted all of them via AVFS/PFM. Brought them into a Vegas project and, as you reported, slower than you can imagine (less than half a frame per second). I then browsed the AVFS sample file, however, and saw the No Interleave option. Adding AVFS_AVI_NoInterleave=true to the top (the very top, AVFS options apparently have to be the first lines in a script) of each script bumped my timeline playback--with Preview Quality set to Preview (Auto)--up to between thirteen and fifteen frames per second.

I also tried tweaking the AVFS_ReadAheadFrameCount variable, but it didn't make much positive difference. Setting it to 60 slowed everything to a crawl, dropping it to 7 shaved a few frames per second off the playback speed, and turning it off completely barely did anything. I guess there's a sweet spot in there somewhere for certain types of source footage, but I can't find it. For the moment the only setting that seems to improve performance is the NoInterleave thing.

I will try that and let you know how it goes.

13-15FPS?? That's pretty good. Is this test file you're using from a 5dMkII? I think the best I've seen has been around 8fps, but it's not always steady.

I've been using this (http://www.lunch-productions.de/files/MVI_0082.mov)
as a test clip for most of this stuff since I started fooling around with the colorspace issues, so I've also been using it for most of this testing as well.

Robert Martens
January 7th, 2009, 11:04 AM
I've been using the "Original Quicktime version" file I downloaded from http://www.vimeo.com/2641870 for my fiddling, and the filename's in the same mvi_1234 format with specs that match the MkII's as far as I know, so I think it is a camera file. Correct me if I'm wrong.

In any event, I downloaded the file you referenced, and I see the same behavior as with the darts clip; slower than molasses without the NoInterleave variable, thirteen to fifteen with it, with either a single copy of the file or five of them thrown on the same timeline. The option was added, according to the AVFS readme, to improve compatibility with certain applications, and it seems Vegas is one of those.

Keith Paisley
January 7th, 2009, 11:20 AM
Ok, I tested it a little bit - it doesn't seem to change the preview framerate much for a single clip, BUT the biggest problem I see is that since you're de-interleaving the audio from the video track, it gets out of synch. On the one test clip I've been using, the audio track was shorter by about 1/2 second (0:26:16 vs 0:27:02). That could be problematic on larger projects but not such a big deal if you're using off-camera audio (except maybe in the case you're trying to synch the offcamera audio with the standard track)

Robert Martens
January 7th, 2009, 11:48 AM
I should have known that was too good to be true; there's supposed to be an updated AVFS that includes performance improvements at some point, so keep an eye on the homepage (http://www.turtlewar.org/avfs), but until then I guess we'll just have to use the Avisynth setup only for individual clips.

Looks like it's still intermediate renders for Mark II footage, sorry guys.

Keith Paisley
January 7th, 2009, 09:00 PM
I've been using the "Original Quicktime version" file I downloaded from Darts at Lark Tavern - Albany, NY - 08, Dec on Vimeo (http://www.vimeo.com/2641870) for my fiddling, and the filename's in the same mvi_1234 format with specs that match the MkII's as far as I know, so I think it is a camera file. Correct me if I'm wrong.

In any event, I downloaded the file you referenced, and I see the same behavior as with the darts clip; slower than molasses without the NoInterleave variable, thirteen to fifteen with it, with either a single copy of the file or five of them thrown on the same timeline. The option was added, according to the AVFS readme, to improve compatibility with certain applications, and it seems Vegas is one of those.

13-15fps is better than I've seen yet on my machine. I saw you mention in another thread that you have a Q6600. That's what I'm using too. I wonder why my machine's not pushing those frame rates... What are your project settings?

My Q6600 has 2GB of RAM and an Nvidia 7600GT video card. I have XP and Vista 64, but I have only barely used Vista 64 (in fact, I've only installed it on a test drive), so everything I've talked about here is reference to XP SP3. I have 8GB of RAM (4x2GB) sitting in the drawer - I haven't bothered installing it, but I bought it for when I'm ready to go to Vista 64 full time. I understand there are potentially a bunch of issues with 64-bit software, and having pulled my hair out due to 32/64-bit OS issues in the past on other OS's, I've sort of been loathe to subject myself to the same stuff on Windows. I briefly tried Vegas 8.1 on vista 64 and it did seem a bit quicker but not mind blowingly so.

This Q6600 machine is over 18 months old now so I was considering upgrading to a Core i7 box. I'm pretty sure the Q6600 is more than enough hardware to handle what we need to do, though, so I've resisted the numerous urges to spend on the i7. I'm convinced that all we need is functional software. I'm afraid that the biggest bottleneck we're currently looking at at the moment is VFW on Vegas.

Robert Martens
January 8th, 2009, 12:49 PM
I was up until one thirty last night trying to solve this somehow, but no such luck. Multiple files still cause problems, with the framerate starting out all right but tanking in short order.

Single clips, as I said, I can repeatedly play back at a sustained 13-15 frames per second (takes a second or two to get up to speed, but not too long) over the length of the clip by using the following script:

DirectShowSource("filename.mov",pixel_type="RGB24")
FlipVertical()
Crop(0,0,1920,1080)

Using the pixel_type parameter of DSS isn't normally recommended because apparently some DirectShow filters mess up the conversion, but here it seems like it works, and runs a bit faster than a Convert filter in Avisynth. This script runs at the aforementioned speed with NoInterleave left off, so video and audio stay in sync.

Another quick note, I found that with "Crop 1088 to 1080" turned on in the CoreAVC configuration, using this script, then going into combustion, I ended up with four black lines at the bottom of the picture, despite the image being the correct 1920 by 1080 dimension. The Crop filter in this case should have had no effect if the CoreAVC crop option did what I thought it did, but apparently strange things happen in this circumstance. Explicitly turning the crop option off in the codec configuration dialog allowed the Avisynth script to work the way I'd intended, and combustion saw a proper image, at the correct size, with all the image data and no black pixels.

To finally answer the question you asked, Keith, my Vegas project settings are based on the HD 1080-60i template (not HDV, mind you), but with Field order set to None and framerate set to 30. Why exactly you wouldn't see similar performance with a similar system (I also have two gigs of RAM, XP Service Pack 3, and an even worse graphics card, an AGP 8X 6800GS) I can't be certain, but I do have a SATA II hard drive with a sixteen megabyte cache. With such frequent access of large amounts of data I imagine that might help. Beyond that I have no idea, sorry.

Keith Paisley
January 9th, 2009, 08:40 AM
I was up until one thirty last night trying to solve this somehow, but no such luck. Multiple files still cause problems, with the framerate starting out all right but tanking in short order.

Single clips, as I said, I can repeatedly play back at a sustained 13-15 frames per second (takes a second or two to get up to speed, but not too long) over the length of the clip by using the following script:

DirectShowSource("filename.mov",pixel_type="RGB24")
FlipVertical()
Crop(0,0,1920,1080)

Using the pixel_type parameter of DSS isn't normally recommended because apparently some DirectShow filters mess up the conversion, but here it seems like it works, and runs a bit faster than a Convert filter in Avisynth. This script runs at the aforementioned speed with NoInterleave left off, so video and audio stay in sync.

Another quick note, I found that with "Crop 1088 to 1080" turned on in the CoreAVC configuration, using this script, then going into combustion, I ended up with four black lines at the bottom of the picture, despite the image being the correct 1920 by 1080 dimension. The Crop filter in this case should have had no effect if the CoreAVC crop option did what I thought it did, but apparently strange things happen in this circumstance. Explicitly turning the crop option off in the codec configuration dialog allowed the Avisynth script to work the way I'd intended, and combustion saw a proper image, at the correct size, with all the image data and no black pixels.

To finally answer the question you asked, Keith, my Vegas project settings are based on the HD 1080-60i template (not HDV, mind you), but with Field order set to None and framerate set to 30. Why exactly you wouldn't see similar performance with a similar system (I also have two gigs of RAM, XP Service Pack 3, and an even worse graphics card, an AGP 8X 6800GS) I can't be certain, but I do have a SATA II hard drive with a sixteen megabyte cache. With such frequent access of large amounts of data I imagine that might help. Beyond that I have no idea, sorry.

hehe, the first "big" project I tried (still a test, but a bit of a rigorous one just due to the sheer number of clips) and Vegas choked on the re-wrappered files. There are around 35 different files on the timeline so I didn't bother even trying the alternative method you came up with, simply because it would have been a lot more mouse clicks. Basically any time I tried rendering the file using the rewrapped files Vegas crashed. So I finally ended up transcoding everything into 720p using the built-in Cineform HDV codec and it worked beautifully. Watching the preview and editing at a rock solid 30.000 fps is a thing of beauty too. Oh well, it sure would be nice if Neo HD didn't cost $500. I can't see spending that much just to fix something (colorspace glitches) that we shouldn't have to worry about in the first place.

Robert Martens
January 9th, 2009, 03:44 PM
So close, and yet so far. I guess we have our answer.

There's always Lagarith (http://lags.leetcode.net/codec.html) and the older HuffYUV (http://neuron2.net/www.math.berkeley.edu/benrg/huffyuv.html) if you don't mind rendering, but I can't get them to play back at full speed.

If neither of those codecs works out for you, then I suppose it's right back to square one.

Keith Paisley
January 9th, 2009, 05:36 PM
So close, and yet so far. I guess we have our answer.

There's always Lagarith (http://lags.leetcode.net/codec.html) and the older HuffYUV (http://neuron2.net/www.math.berkeley.edu/benrg/huffyuv.html) if you don't mind rendering, but I can't get them to play back at full speed.

If neither of those codecs works out for you, then I suppose it's right back to square one.

So far from what I can tell, Cineform hdv works beautifully. I just wish my workflow weren't so complicated.

At best case, I'd like to edit the videos straight out of the camera. I've been doing it with satisfactory results using DV and HDV for years now. If I can't do that, then I'd like to have a very streamlined, one step process for converting the footage to something I can use to edit (I'm okay with the 720p limitation for now). It seems like Neo HD may be that thing, but $500 seems to be a bit too much to spend to get something that should work properly in the first place (correct colorspace from our 5dMk2 files).

Daniel Lipats
January 14th, 2009, 04:12 AM
I just bought Morgan Jpeg2000 ($30) and it looks like a great intermediate codec. I transcode using CoreAVC and AVISyth and enable Lossless with 4:2:2. My test video ended up half the size of lagarith with no data lost. It did take a little longer to transcode but 700mb vs 1,500mb is a compromise I am willing to accept.

You can also adjust a global quality setting for realtime playback while editing and enable full when you are ready to render. Seems to be very fast and efficient.

Morgan Multimedia - Home of the MM MJPEG video codec. (http://www.morgan-multimedia.com/M-JPEG2000/)

Yang Wen
January 14th, 2009, 08:08 PM
I just bought Morgan Jpeg2000 ($30) and it looks like a great intermediate codec. I transcode using CoreAVC and AVISyth and enable Lossless with 4:2:2. My test video ended up half the size of lagarith with no data lost. It did take a little longer to transcode but 700mb vs 1,500mb is a compromise I am willing to accept.

You can also adjust a global quality setting for realtime playback while editing and enable full when you are ready to render. Seems to be very fast and efficient.

Morgan Multimedia - Home of the MM MJPEG video codec. (http://www.morgan-multimedia.com/M-JPEG2000/)

Will the Morgan JPEG codec resolve the crushed black issue?

Daniel Lipats
January 14th, 2009, 10:40 PM
No.. Not exactly. To solve the crushed black problem you need a decoder that will read all of the available data in the original .MOV files. The only codec I am aware of that will is CoreAVC. To force Premiere, After Effects, Combustion, Vegas and others to use this codec the frame server AVISynth is required. Or they will just override CoreAVC and use QT or a built in decoder.

While This will fix the crushed blacks and highlights problems the trouble is that editing becomes a nightmare. With AVISynth playback is extremely slow, and as you load up your workspace it becomes much worse.

My solution is to transcode the .MOV using CoreAVC to Morgan Jpeg2000. This solves all of the problems including the full 0-255 range and fast realtime playback I believe in any software. This meets all of my post-production workflow needs.

There are other possible ways you could go about this. For example, I picked Morgan Jpeg2000 because its "Lossless" and very fast but you could use the lagarith codec which is free but has much bigger files and a bit slower playback. You could also use Cineform or some other fast free lossy compressed format.

As a final note, I recently read at some other sources that documentation and support for Morgan Jpeg2000 is horrible. It was a shot in the dark for me because the trial version does not even work (Expired October 2007). I am pleased with it but there are other options.

Perrone Ford
January 14th, 2009, 11:00 PM
Sony Vegas ships with a jpeg2000 codec installed. However, it is not customizable. I've used it and it works well, but the bitrate can get awfully high. I used it on a 1080p file this week and I was seeing rates in the 90Mbps range. That's pushing it for 1080p if you want smooth playback.

I currently use the DNxHD codec for what I do, but it's lossy. Not terribly so, but it is not designed to be lossy. It's VERY similar to ProRes and Cineform. Previously, I've used Cineform as that also shipped free with Vegas but it has no 64bit version and no 10-bit support out of Vegas. Obviously ProRes is Apple only. Lagarith has 32 and 64 bit versions, but I had loss with it and for the file size, that was not acceptable.

There are a multitude of options out there for codecs, but all have tradeoffs and you have to choose depending on need. Because of my workflow, I needed 1hr of material to fit into 20GB of space for writing to BluRay. This gives me the room to write a high quality version as well as an mp4/vc-1 to the BluRay for future use.

Yang Wen
January 15th, 2009, 08:23 AM
Why did Canon ship the camera with such a problematic codec??? Is there a petition going for them to tweak the video codec so it's easier to post with?

Keith Paisley
January 15th, 2009, 08:34 AM
Why did Canon ship the camera with such a problematic codec??? Is there a petition going for them to tweak the video codec so it's easier to post with?

The biggest mistake Canon made was choosing Quicktime. I think the quicktime decoders are what's currently broken at the moment. Apple needs to hurry up and fix the colorspace and gamma issues and then get this code out to all the licensees.

That said, even if those issues didn't exist, doing post-editing with h.264 on the timeline is probably going to be something that will take a while to become truly practical. GPU acceleration would probably go a long ways towards improving it, but that would require support from the NLE packages. Hopefully a standard API will emerge to facilitate this so NLEs can leverage the GPUs regardless of the hardware. I think this is the only way we might see some sort of universal solution. Otherwise it's more likely to be a bunch of proprietary solutions which will be costly and possibly troublesome.

Jon Fairhurst
January 15th, 2009, 12:36 PM
The biggest mistake Canon made was choosing Quicktime.

Yes and no. Quicktime is widely supported, which is good. The only real problem is this 0-255 RGB compatibility issue, which can be worked around today, and which should be improved before long. As you mention, it's a decoder issue.

The h.264 editing issue is independent of Quicktime. High data rate h.264 is CPU intensive, and it's long GOP to boot. For now, we have to expect to encode proxies. It would be nice if there were a transcoder that could fill in the P- and B-frames with I-frames. That would be quick and would remove the long GOP issue.

Personally, I think they nailed the codec in that that the quality is excellent, and the solution fits in the camera and it still has good battery life. We might be struggling to optimize things, but you can do edits (black crush and slow rates aside) out of the box with every HD NLE.

Keith Paisley
January 15th, 2009, 01:23 PM
Yes and no. Quicktime is widely supported, which is good. The only real problem is this 0-255 RGB compatibility issue, which can be worked around today, and which should be improved before long. As you mention, it's a decoder issue.

The h.264 editing issue is independent of Quicktime. High data rate h.264 is CPU intensive, and it's long GOP to boot. For now, we have to expect to encode proxies. It would be nice if there were a transcoder that could fill in the P- and B-frames with I-frames. That would be quick and would remove the long GOP issue.

Personally, I think they nailed the codec in that that the quality is excellent, and the solution fits in the camera and it still has good battery life. We might be struggling to optimize things, but you can do edits (black crush and slow rates aside) out of the box with every HD NLE.

I agree - the codec is fine - the video coming from these files is gorgeous, but as a container Quicktime has been miserable to work with for years (esp. on Windows machines). This RGB colorspace issue just adds another reason supporting my general dislike of Quicktime. Maybe there's a perfectly reasonable explanation for it, but from my perspective it's a really boneheaded glitch. It could be fixed if there were some way to get into quicktime's decoder config so we could manually select the appropriate output, but that's just not an option. Several weeks ago, I poked around the internet looking for possible registry key hacks that could force quicktime one way or another, but I had no luck. That this particular issue is even a problem for Mac users says a lot too (for the record, my day to day machine is a macbook pro, though I choose to edit on the PC platform with Vegas).

I realize that H.264 is very resource intensive, but I think what we're seeing from a performance perspective is due more to suboptimal software at this point. I know it can be decoded and played with a locked down 30fps rate at 1080p with moderate CPU loads on my quad core system. But the h.264 compatible plugins (apple's and mainconcept's) on vegas are both pretty weak.

I think Canon should have gone with an ISO compliant MPEG-4 container in the first place, though MP4's limitations on compressed audio formats may have ultimately killed those chances.

Jay Bloomfield
January 15th, 2009, 01:25 PM
I apologize beforehand, for repeating some basic concepts. Although there are excellent posts in this thread, it appears that a number of 5D MKII users are not all that familiar with a few video terminology and concepts and that's understandable, because many of these folks have migrated from the true DSLR world. Here are some very simplified thoughts :

1. The 5D MKII uses the h.264 codec, also referred to to as MPEG-4 Part 10 or MPEG-4 AVC. To read a h.264 file you need a decoder. To write an h.264 file, you need an encoder. These two types of software are referred to as "codecs". On PCs, you need a h.264 decoder to read the 5D MKII files properly. Most people have the freeware Apple Quicktime Player and decoder installed. If you have Apple Quicktime installed on a PC, QT will not read the 5D MKII files properly, as it defaults to studio RGB (sRGB), which does not use the complete 8-bit color range (0-255). The QT decoder only uses 16-235, so you are losing information at both the black and white ends of the color space. (0 being true black and 255 being true white in 8-bit color). You can see the extent of this problem, if you have an NLE that displays color histograms. CoreAVC makes an excellent (and almost free) decoder that will read the file properly and not crush the blacks. CoreAVC has an option to output computer RGB (0-255).

2. When an h.264 video stream is written to a file, it must also have some type of wrapper, that contains information in its header about the video's frame rate, width, height, etc.. The 5D MKII uses the Apple Quicktime wrapper, which has a file extension of MOV. This file format will work on both Apple and PC systems. There are other types of wrappers used for encoding video. The more common ones that you see are Video for Windows (AVI, the generic wrapper on Windows-based systems), MP4, WMV (Windows Media) and M2T (An HDV MPEG-2 stream). Sometimes the file extension tells you something about the codec used (like M2T) and sometimes it only tells you about the wrapper used (like AVI, which could have any one of a number of codecs wrapped inside). Thus, the 5D MKII produces an h.264 video stream within an Apple Quicktime wrapper. The codec that produced the original h.264 video stream in each MOV file, is built in to the hardware of the 5D MKII.

3. Sony Vegas uses its own built-in h.264 decoder and will not access CoreAVC to decode your 5D MKII MOV files. Adobe Premiere, After Effects also use their own plug-in, but any other video software that uses Windows DirectShow to access codecs will use CoreAVC, assuming that Core AVC has a higher file merit that the QT decoder. What is "file merit"? It is a priority number that signals to the Windows DirectShow video subsystem, which codec or filter to use when more than one option exists (like having QT and CoreAVC both installed). If you Google "DirectShow file merit" you will get a number of links that will explain this concept in greater detail.

Daniel Lipats
January 15th, 2009, 02:14 PM
In theory any software that uses Windows DirectShow should work. But both Adobe Premiere and After Effects will not use CoreAVC.

They automatically give QuickTime priority when decoding .MOV files. Without QuickTime installed they will refuse to open that container. If we could get that to work then transcoding would not be necessary at all (when using adobe products). CoreAVC is fast enough for realtime playback, trouble is that the NLE won't use it.

Keith Paisley
January 15th, 2009, 02:41 PM
In theory any software that uses Windows DirectShow should work. But both Adobe Premiere and After Effects will not use CoreAVC.

They automatically give QuickTime priority when decoding .MOV files. Without QuickTime installed they will refuse to open that container. If we could get that to work then transcoding would not be necessary at all (when using adobe products). CoreAVC is fast enough for realtime playback, trouble is that the NLE won't use it.

That's interesting. But what happens if you open a re-wrapped file in AE or Premiere? Does it use CoreAVC in that case? And if so, is it fast and smooth on the timeline? I switched from Premiere Pro to Vegas many moons ago...

Jay Bloomfield
January 15th, 2009, 05:17 PM
I corrected the error in my post. I just assumed that it worked since I use CS3 & Cineform. What's really interesting is that people that have tried using AviSynth to force Premiere to use the DirectShow codec with the highest file merit still can't get it to work.

Bill Binder
January 15th, 2009, 06:45 PM
In theory any software that uses Windows DirectShow should work. But both Adobe Premiere and After Effects will not use CoreAVC.

They automatically give QuickTime priority when decoding .MOV files. Without QuickTime installed they will refuse to open that container. If we could get that to work then transcoding would not be necessary at all (when using adobe products). CoreAVC is fast enough for realtime playback, trouble is that the NLE won't use it.

I'd be curious to know whether just changing the extension to .MP4 would work in this case if QT was not installed?

Keith Paisley
January 15th, 2009, 06:52 PM
I'd be curious to know whether just changing the extension to .MP4 would work in this case if QT was not installed?


It *might* work but if the software is really strict with respect to the MP4 standards, it should fail to open it as it contains an audio stream ('sowt') that's illegal according to the MP4 standard. That's why you have to re-encode the audio as AAC during the re-wrap process I devised.

Daniel Lipats
January 15th, 2009, 10:55 PM
After some searching I found that to enable MP4 support Premiere needs to be updated to 3.02. I will try tomorrow and see if it works. Right now my version does not support the MP4 container at all.

Yang Wen
January 16th, 2009, 09:09 PM
So I finally ended up transcoding everything into 720p using the built-in Cineform HDV codec and it worked beautifully. Watching the preview and editing at a rock solid 30.000 fps is a thing of beauty too. Oh well, it sure would be nice if Neo HD didn't cost $500. I can't see spending that much just to fix something (colorspace glitches) that we shouldn't have to worry about in the first place.

Hmm So I have Cineform HDV (the stand alone application, not the one that came with Vegas) If you're able to render it to the cineform codec from within vegas, why can't I use NeoHDV's HDLink and render my 5D2 files?

Keith Paisley
January 17th, 2009, 10:00 AM
Hmm So I have Cineform HDV (the stand alone application, not the one that came with Vegas) If you're able to render it to the cineform codec from within vegas, why can't I use NeoHDV's HDLink and render my 5D2 files?

who said you couldn't do that? have you tried it? I think it should work.

Tony Koorlander
January 17th, 2009, 03:19 PM
Hi All,
I've been messing around trying out the limits of the camera and have noticed that as mentioned, direct dragging to the timeline seems to lose some of the dynamic range. I have tried this in Vegas 8 Pro with 32 bit option selected and it seems better. The BEST quick results have been to use the Windows Media encoder direct from the Vegas timeline.
I created a new preset project at 1920x1080 30P 32 bit mode. Then drag the .mov files onto the timeline. Render out as 1920x1080 30P .wmv two pass max sharpness 8MB/s stream and it seems pretty good for wmv.

I've tried to get it to .avi using the Cineform Neo HD which is capable of 1920x1080P .. but it doesn't seem to like the 30P H264 for some reason and crashes out .. or else gives audio but no video.

I reckon Cineform'll probably do something soon .. they're very good people.

BTW if you want tryout files my website has a load of zipped .mov untouched from the camera. These were my own 'evaluation' shots .. so don't expect 'art' ;-)

location is here - Untitled Document (http://www.limelighthd.tv/canoneos)

Robert Martens
June 19th, 2010, 03:58 PM
Ok, I tested it a little bit - it doesn't seem to change the preview framerate much for a single clip, BUT the biggest problem I see is that since you're de-interleaving the audio from the video track, it gets out of synch. On the one test clip I've been using, the audio track was shorter by about 1/2 second (0:26:16 vs 0:27:02). That could be problematic on larger projects but not such a big deal if you're using off-camera audio (except maybe in the case you're trying to synch the offcamera audio with the standard track)

I hate to dig up old discussions as much as anyone, but it's only fair to note that, inspired by this very thread (http://forum.doom9.org/showthread.php?p=1387924#post1387924), the audio truncation issue has been addressed in AVFS 1.0.0.5: http://www.turtlewar.org/avfs/

I haven't been keeping up with 5D discussions since my participation in this thread, so I imagine most of you have moved on to other editing solutions by now, but if you ever have a project that will benefit from AviSynth frameserving and the AVFS plugin, you can now safely disable interleaving without knocking your audio out of whack.

Silas Barker
June 22nd, 2010, 12:38 PM
Is there a way to import 5D footage into Adobe Premier CS3 and then use Media Encoder to get it into a better format? I am thinking about getting the 5D but I don't really want to spend money for software to make it all work if I do not have to. Advice would be appreciated.