Best Video Playback Codec

scalf's picture

I have been using Quartz extensively for playing back loops, adding effects, etc, and I was wondering what the fastest video coedc would be for playback in Quartz Composer?

The clips are usually played at 720, but that may be irrelevant. I have been using video programs, so converting them to any codec is not the problem, but there are so many options I was not sure which would be the most tailored to QC - H.264, ProRes, etc

vade's picture
Re: Best Video Playback Codec

You want to avoid any "delivery" codecs like the plague. What pray-tell is a delivery codec? Anything highly compressed with no key frames, which, typically speaking, h.264, mpeg, mpeg2, mp4, sorenson, etc.

Codecs typically have 2 ways of compressing frames. Spatial and Temporal, or Intra and Inter frame compression.

Spatial / Intra frame compression, each frame is its own unique image (a key frame), and is compressed much like a normal image would be, say with JPG, PNG, etc style compression.

Temporal/Inter-frame compression means that many frames are ganged together in a "group of pictures", and that group as a whole is compressed.

Avoid Temporal/Inter frame compression for realtime, and use Spatial/Intra, especially if you plan on scratching or realtime seeking.

You want to stick with Apple Intermediate, Pro Res, PhotoJpeg, and other specialized codecs like that, and all the others.

cybero's picture
Re: Best Video Playback Codec

The stock Movie Importer patch handles just about any movie codec type that QuickTime natively supports. I often use ProRes.

You could also use the v002 Movie Importer patch or else splash out for the Kineme Video Tools and have the luxury of being able to play movies on a non QuickTime thread.

That said, H.264 is definitely a good choice for compressing movies, although you aren't really obliged to use that encoding.

ProRes gives a far more detailed result with better colour IMETD.

Then again, if you found that the Animation codec gave you by far the best results for a particular composition, then it would seem to me that would be the best one to use for such an instance.

Similarly, if you found that ProRes gave you the best result, you would be better advised to go ahead and to use that. ProRes makes for bigger files in data size than H.264 IMETD.

FYI, find attached two screen grabs of the H.264 and the ProRes version of Blue.qtz offline rendered as ProRes and H.264. I wonder if anyone can tell which is which •~ .

PreviewAttachmentSize
blueone.pdf440.96 KB
bluetwo.pdf381.05 KB

vade's picture
Re: Best Video Playback Codec

I'm going with 2, only because I know there are gamma issues with Apples h.264 encoder.

That said, h.264 is almost never a good choice for just in time decoding (i.e., Apples movie player patch, in standard synchronous mode only decodes just in time based on the incoming time base of the patch, this means no pre-roll and latency is very high due to GOP decoding, or seeking / disk access - its an over-all loss in just about every way you can imagine). Seriously, stick with slightly larger, keyframe based codecs for almost every computer based realtime decoding task unless you have specific codec requirements from a client for a playback system/server. Those playback systems/servers tend to have hardware decoders and can guarantee decoding and specific latencies at specific bit-rates. Only in rare cases on specific hardware will Quicktime/AVFoundation leverage hardware h.264 decoders on the Mac, and 99.9% of those times the system is only handling video playback, and no other rendering at all. Secondly, the those hardware decoders on the Mac can only handle a single decode stream at a time, which then falls back to software decode, which is much slower for h.264 and friends.

Seriously, ignore h.264 for realtime playback unless you really test, and have the overhead for it.

I highly suggest Pro Res variants, Photo-Jpeg at ~ 80% quality or AIC for almost everything else, and test based on your hardware.

edit: to be clear, 2 streams of h.264, on a mac with hardware accel decoding, using software that actually leverages it, will fall back to SW decoding for the second streams, since the HW can only handle one stream (or at least, up to a specific bit-rate at a time).

cybero's picture
Re: Best Video Playback Codec

I almost invariably use H.264 for vimeo [delivery codec land] and yes , I'm really appreciating how good ProRes is for incorporating into QC compositions. Sadly I am having to work around an ongoing failure of Movie and Video stock patch inputs in Lion. Thankfully Kineme Video Tools allows for the input of videos, though without looping or sound.

Regards, your choice [actually I'm now guessing that you mean 2 is the ProRes BTW], well argued, but as it happens blueone is the grab of the ProRes offline render and bluetwo, the slightly lighter picture, is actually the H.264 encoded offline render.

Your points regarding Spatial / Intra frame compression and the undoubted superiority that the keyframe per frame gives upon playback, coupled with the HW & SW dependencies and detractions of H.264 are indeed well taken here and informative to all.

Thanks as ever for your diligent and helpful input [oh and all those v002 plugins and the work at NI].

vade's picture
Re: Best Video Playback Codec

I meant 2 is h.264, because of exactly what you explains. It being lighter is sort of a 'finger print' of Apples h.264 encoder. I can't believe it still happens, but you can thank Quicktime. ARGGHHHH.

:)

cybero's picture
Re: Best Video Playback Codec

Now I'm clear on that 2 :-)

franz's picture
Re: Best Video Playback Codec

buy a SSD drive and use PhotoJpeg @Quality 80, then you'll be good to go

scalf's picture
Re: Best Video Playback Codec

Thanks for all the information guys!

So it sounds like H.264 will do an okay job at it. But I am looking for the fastest playback with the most room for effects (mixing, scratching, pixellate, etc).

A few mentioned Apple ProRes, and Wiki describes it as:

  "ProRes 422 is a standard-definition and high-definition lossy video compression format developed by Apple Inc. for use in post production. It was introduced in 2007 with Final Cut Studio 2 [1] and is comparable to Avid's DNxHD codec which has the same purpose and uses similar bit rates. Both are DCT based[2] intra-frame-only codecs, and are therefore simpler to decode than distribution oriented formats like H.264."

With that in mind, it sounds much better for playback, while H.264 is better for distribution.

My question is which Apple ProRes? Attached is a picture from Final Cut Pro X with the ProRes options. - ProRes 4444 - ProRes 422 (HQ) - ProRes 422 - ProRes 422 (LT) - ProRes 422 (proxy)

Which would be the best for video mixing on the fly?

PreviewAttachmentSize
photo.JPG
photo.JPG1.2 MB

cybero's picture
Re: Best Video Playback Codec

422 HQ for high quality editing or 4444.Either for high quality playback, that keyframe information really does work well, especially when you are seeking to achieve great and lengthy installational playback or live VJing. H.264 for uploading to vimeo. Also another little helpful tip. If you are quoting from either a code listing, Console listing or even Wikipedia then you would do well to put in some line breaks, else the post goes well and truly over the extent of one's screen edge. Incidentally, just quoting from Wikipedia you would be best advised to use

Quote:
an example text quote which quote section will still look too long because of the preceding unbroken [[code] but it should have been a quote with a line break]
, rather than a bit of code? between code , /code - use [] for each code markdown tag.

scalf's picture
Re: Best Video Playback Codec

Thanks for the help on both accounts Cybero!

 Cheers!

scalf's picture
Re: Best Video Playback Codec

How about this...

When I render even a 10 second video, at 720, using say ProRes 422, the file is around 400mb! Is there anyway to keep the codec or flexible format but not the huge disk space?

jersmi's picture
Re: Best Video Playback Codec

I have used photo-jpeg/80% for some time, most footage I have is this. My favorite projector runs 1024x768, so a lot of footage I have is rendered at that size. For a while I have been on the ProRes and AIC bandwagon. I'm using AIC lately and seeing good results. This is all for real time. Like vade, never would I use a distribution codec (h.264, etc.) for real time, performance is terrible.

cybero's picture
Re: Best Video Playback Codec

I definitely find that PhotoJPEG works well, though not so well IMETD to date as ProRes does when needing to deal with complex animations and gradients. That is even with PhotoJPEG at 80 to 100 %. It's a subtle thing and given that Crystal takes a very short time to output short clips [10 seconds or less] and given that one can target the time point that might contain potentially difficult to render animations, it works well to do some test renders.

In regards of the resultant file size PhotoJPEG will give file data size of approximately 50 % of ProRes. You can adjust the Crystal output setting for any of these codecs by means of selecting a lower level of quality, if it doesn't adversely affect the resultant render's finer qualities.

IMETD fine quality renders do result in larger files.

For the offline renders, I use a large enough external disk drive [1TB ] and I also think that franz's advice regarding the use of a SSD for real time playback with PhotoJPEG is very sound.

Thanks to all those contributing on this thread, including the original poster. Thanks also to those who I sound boarded off list regarding this matter [Joe]. It was reassuring for me to hear that I was on the right sort of track.