Jump to content

H264 GPU hardware decoding


solaar
 Share

8 posts in this topic

Recommended Posts

What is it with those 'rumours' about H264 encoding on the graphics card floating about for some time? Is it really just a Snow Leo feature? It can't be true as I've heard about Macbook pro owners stating that they can edit H264 natively and really smoothly in video editors like Premiere and FCP. In Leopard, that is.

 

The Canon DSLR cameras like 5DmkII and 7D are recording video in H264 but there are massive problems to edit the footage natively without transcoding it. Some MBP users though report that they've never encountered any problem editing H264 footage in 10.5.x.

 

Is there a way to enable just any Mac - hackintosh included - to decode and edit H264 footage without any hiccups? If so, what are the hardware requirements for the graphics card?

 

Any clue appreciated.

Link to comment
Share on other sites

It's not that it can't be done, but H264 is a much more tightly packed codec and therefore takes a lot more CPU power.

 

For example an optimized codec, like the new 4:4:4 apple codec is optimized for forward and backward scrubbing and rendering for speed. H264 generally has fewer keyframes, so if you need to scrub from a point between two keyframes, it has to backtrack to the most recent keyframe and render forwards to get your frame. With a more complex compression algorhytm, this takes longer. Even worse, H264 doesn't have backwards keyframing, so if you are at the frame just before a keyframe, instead of rendering back one frame, it goes all the way back to the previous keyframe and renders forward..

 

Now, that said, the above is an aside from your original question, which asks for a video hardware decode solution... While I know that some video cards have H264 codecs on board (for example to playback blu-ray) I don't know that all software takes advantage of this. Anyone who scrubs H264 without any lags or performance problems is probably on a very fast machine, or using SD video where it doesn't have as many pixels to crunch as HD does.

 

SD is so small compared to HD (720x480 = 345,600 pixels vs. 1920x1080 = 2,073,600 6X MORE PIXELS), that the difference in processor requirements are well within typical system capabilities, but on HD video, the pixel count is much higher, and let's not forget to multiply this by how many layers you are working with. Sure, simple cut editing between two clips won't be a big deal, but try stacking a few layers with some transparency and masks, and the pixel rendering requirement goes very high, very fast, in addition to your codec processing.

 

I bought two Canon HV30s over the HF10/100s for exactly that reason. The HF10/100 has a super convenient flash card option, but it compresses H264 at 17MBps versus the HV30 which compresses HDV at 25MBps. The HDV codec is less compression efficient than H264, but also much easier to process, and with the extra bandwidth, 25MB/s vs only 17MB/s, it carries well. Think of it like constantly editing your video inside of a RAR or ZIP file, versus having it unzipped. It's a lot more overhead. You might say that acceleration makes this a moot point, but the HF series cameras actually have a warning that flashes up telling you that you are moving the camera too fast, because it's built-in hardware compressor can't keep up with the pixel data. I prefer to be the one deciding what movement I will and will not shoot... and even with hardware acceleration, I would rather reserve the extra speed for layers and effects.

 

The HV30 also had a larger sensor chip than the HF10/100, and with image quality being an important concern, I opted to take the HDV-on-tape option over the convenience of flash, and have had no regrets.

 

Another possibility is that those using FCP are mistaken that they are editing H264. If you digital ingest H264 from a video camera in FCP, it transcodes to ProRes automatically on import, making it essentially invisible that a transcode actually took place. **A friend of mine recently bought one of the new generation H264 Canon flash video cameras, and we did some tests with it. The ingest went very fast into ProRes on Final Cut Pro, and despite my purist apprehensions about transcoding footage before it's ever been touched, the quality was still very good, and I could see myself getting used to it.

 

I have to say I am impressed with how quickly the ingest/transcode works - at more or less the speed of a file transfer, but the downside is that it still is actually transcoding (hence some possible, if only minimal degradation of image). In which case I would say at least use 4:4:4 for the best image (but beware of huge files!).

 

I know that openCL is available for the first time on the Snow Leopard platform, but I don't know what limitations there are to what hardware it will run on (i.e. OSX86 platform hacks, kexts, injectors etc.). In addition to this, the software itself has to be OpenCL aware, otherwise the mere existence of openCL will mean nothing (just like the new Grand Central Dispatch improves multitasking for applications written to recognize it.) I believe I heard that Cyberlink has some hardware accelerated transcoding features in some of their newer windows software (presumably in response to the OpenCL hype), that converts back and forth ridiculously fast working directly with the video card, rather than through an OS API layer, but this will vary from card to card. There are also some other new apps on either platform that rocket through video files impressively fast using the same method.

 

Some applications, such as After Effects, take advantage of OpenGL on video cards to speed up rendering of effects and can create dramatic performance improvments, but the basic I/O function of rendering H264 is something I don't know as much about. Presumably this should be among some of the very basic features of OpenCL, but that is only on Snow Leopard thus far. Anyone telling you they have hardware acceleration of H264 in their video cards pre-10.6 is either otherwise uninformed, (using something that transparently transcodes on ingest to another format without their knowledge, like FCP), or are using software that takes care of video hardware decoding directly rather than through the OS.

 

MrMoebius

Link to comment
Share on other sites

Thanks much for the very detailed info Mr Moebius. Much appreciated.

 

I'm aware that decoding H264 at 1080p is very processor hungry. I can see it in activity monitor when I play such a file. QT goes up to 110%. Now on my machine it's not such a big issue to just play it. It's the editing part in Premiere that makes it peak out several hundred percent until it finally chokes and everything gets choppy.

 

However, there's one thing I still don't understand. How is it that certain MBP users don't have this problem? I've seen it with my own eyes this week. And yes, in Leopard. Here's an interesting article:

http://www.macrumors.com/2008/10/18/apple-...-pros-and-airs/

 

As the screen shot shows the load on the new MBP QT is only 19.7%. I have a colleague who has an MBP of that generation and he can edit the native H264 files from a Canon 7D (which are 44mbit/s !) in Premiere smoothly.

 

How can that be explained? And even more interesting how can I get that kind of performance on my Mac Pro 8 core?

 

Transcoding is not very elegant and can become difficult when exchanging files with other video artists, especially between Mac and PC. It would be more straightforward to always stay in H264 until final render.

 

On a side note, I always transcode to XDCAM EX (35mb/s) for editing in PPro. That's the only codec that is a good compromise between quality and smooth editing. I tried ProRes but that's even worse than H264 or uncompressed. I have a friend I'm planning to exchange 7D footage with. Now unfortunately he hangs on to his PC like white on rice and he would have to buy the XDCAM codec which costs an arm and a leg for Windoze. He swears by Cineform which is actually a nightmare for me. Uncompressed is no option as our broadband speed maxes out at 2500 on the upload side. We wanted to exchange the files via FTP. Leaving the files just at H264 would come in so bloody handy. What are manufacturers thinking when they make those decisions to mass market something that can't even be edited natively?

 

cheers ;)

Link to comment
Share on other sites

Hmmm. I was quite interested to read your posts and MrMoebius answer.

Digginn around I stumbled upon this info:

 

Yup, a quick check of Apple's Web site shows that only the 9400M will be compatible with Snow Leopard’s ability to hand off h.264 video decoding to the GPU.

 

Further:

In other news, OpenCL, the feature that offloads CPU cycles to the GPU, will work with a number of GPUs. And they are:

NVIDIA Geforce 8600M GT, GeForce 8800 GT, GeForce 8800 GTS, Geforce 9400M, GeForce 9600M GT, GeForce GT 120, GeForce GT 130

 

ATI Radeon 4850, Radeon 4870

 

The most interesting point for me is: here is finally an argument to go Snow Leopard.

 

Oh, HERE is another interesting forum you might want to check if you are dealing with the 7d files in FCP

 

cheers,

ninetto

Link to comment
Share on other sites

Cheers ninetto.

 

It's beyond me that a mobile chip is the only GPU with direct H264 capability. What were they all thinking? BTW the test on macrumours was made last year on 10.5.5. "... will be compatible..." - it already is for some time.

 

There might be some hope for my GT120 then. We'll see.

 

I seems like I'll have to rest my case for now and find the best compromise which might include FCP which I find counter intuitive. I do like the integration between PPro and After effects. Adobe admittedly make buggy software but the stuff that actually works is hard to beat in terms of workflow. The posts on the 5D forum don't look too promising either although Snow Leo will give a major boost to many things. The thing is I don't want to just upgrade blindly without making some extensive testing on a separate HD. I've heard a few horror stories from other musicians who jumped into the Snow and got some serious frostbite.

Link to comment
Share on other sites

Ohhh, I didn't realize that the MacRumors Test was a year old and on 10.5.5

There goes a brief moment of Snow Leopard glee...

 

The other thing that I read about the "hardware acceleration" of H264 is that this is not that big a plus for editing if you are doing more than hard-cuts. As soon as any color correction/effects are involved, you are back to all the problems of editing AVCHD.

 

So it seems like there is no way to effectively avoid transcoding.

Although the other option would be using Proxy files, which would be especially useful in conjunction with Final Cut Server, it you are collaborating with other editors on the same footage.

 

That said, I do agree with you that the ADOBE SUITE, long looked down upon by FCP-freaks, is really a VERY good alternative. My experience is that PremPro can handle many more formats than FCP and I truly love the AME endcoder, after many frustrations with compressor.

 

Drop a post here, when you find a good way of working with those 7D files, I'm curious.

 

good luck, ninetto

Link to comment
Share on other sites

 Share

×
×
  • Create New...