View Full Version : Color/gamma shift on exported video


K. Tessman
June 20th, 2007, 03:23 PM
I'm back to seeing something I was experiencing a while back and never got a satisfactory understanding of. Now that I'm exporting (supposedly final) color-corrected sequences, I'm seeing it again, so I thought I'd ask for some general input in case I'm just completely missing something obvious.

Sequences are Cineform 720p/23.98. Color correction is done in After Effects, and exported to CFHD. When I bring the exported sequence back into the same AE project for comparison, there's a color/gamma(?) shift.

Attached are three images for comparison. The first is the original frame from AE. The second is the exported footage brought back into AE. The third is split with the original on the left and the exported on the right. (The split is most obvious on the side of the building.)

David Newman
June 20th, 2007, 04:02 PM
Which version of software, number (v3, v4, v5) and product (AHD va NEO vs PHD vs P2K).
Which exporter Video for Windows or the "CineForm AVI" output module.
Which pixel format in AE, 8-bit, 16-bit, 32-bit linear.

I just tested you image with 16-bit mode out to "CineForm AVI" output module. No difference, the attached image is split where yours was.

K. Tessman
June 20th, 2007, 07:23 PM
Aspect HD 4.2.4 Build 72. (I thought I kept pretty up to date, but that seem old. From what I've read, however, I'm going to guess that this wasn't something that was intentionally fixed, since then, if it's a Cineform issue at all.)

The Cineform AVI output module.

16-bit composition.

I'm going to re-post this in the After Effects forum in the event that it's something application-wise that someone's seen before.

David Newman
June 20th, 2007, 08:00 PM
Yes that Aspect HD is several versions old, now at 5.0.2, even version 4 got to 4.3.x, you should at least update to 4.3. While you are using the 16-bit mode in AE, your only using an 8-bit Video for Windows decoding because on Aspect HD itself -- Prospect HD adds 10+ bit decodes. That shouldn't result in a shift, just less gradient precision. Was you composite the 640x272 in size or have you just scaled for web presentation? The reason I ask is you might have some 601 vs 709 colorspace issues.

K. Tessman
June 21st, 2007, 12:03 AM
The image size was reduced and cropped from 1280x720 just for attaching. Yeah, I didn't think the 8-bit-vs.-16-bit issue should result in that sort of a shift. The 601-vs.-709-colorspace did occur to me (or rather, any colorspace mismatch in general) but I wasn't sure where or when or what.

K. Tessman
June 30th, 2007, 10:48 PM
All right, despite the mounting evidence that I'm either hallucinating or incompetent, I thought I'd take one more crack at this. Here are two files, the first an 8-bit TIFF image sequence

http://www.generalcoffee.com/temp/Scene_021-023_TIFF.zip (21 MB)

and the second a CFHD AVI generated by importing the image sequence into AE, in an 8-bit project, creating a simple composition where it's the only layer, and outputting via the Cineform AVI output module setting.

http://www.generalcoffee.com/temp/Scene_021-023_CFHD.avi (3.5 MB)

Finally, to be sure it's not a playback/media player thing, I did an uncompressed AVI output from the TIFF sequence:

http://www.generalcoffee.com/temp/Scene_021-023_uncompressed.avi (88 MB)

The uncompressed AVI looks identical to the TIFF sequence. The CFHD AVI is brighter gamma-wise and less saturated.

Attached is a splitscreen of the first TIFF frame on the left and a capture from WMP of the first CFHD frame on the right.

David Newman
July 1st, 2007, 10:14 AM
Good news, there is nothing wrong with your CineForm AVI renders, the uncompressed AVI and CineForm AVI are identical. The issue is you have setup your Video for Window decoding to default to "Video Systems RGB" (black 16, white at 235), rather than computer graphic RGB (the default for AE, black at 0.) You need to open the VFW CineForm control panel, via the "Configure" button shown in the attachment, restore the top two checkboxes to off. You can do this in the Render Output module controls (yes it impacts decoding as well.)

K. Tessman
July 1st, 2007, 02:22 PM
Hmm. I considered that. My CFHD encoder settings look like this (attached).

(I assume the difference in dialogs is due to the fact that I haven't upgraded to Aspect HD 5?)

David Newman
July 1st, 2007, 03:55 PM
No, this is not as simple as Aspect HD vs Prospect HD thing, you simply using the wrong dialogs which are available in both. I said to access Video for Window controls, not the CineForm AVI controls under the Output render settings. While using CineForm AVI control is best for export, Aspect HD still uses VFW for the importer, at some point you got into that control and set the decoding for Video System RGB, and the controls are sticky -- it has been causing you this issue ever since.

1) Add something to render queue
2) Select Video for Windows
3) Select Cinform compression in VfW
4) Click on "Configure"
5) turn off Decoding as VSRGB
6) Click OK

you are now done.

K. Tessman
July 1st, 2007, 04:16 PM
Ah! I read "Video for Windows", registered it, and then promptly went and checked the Cineform AVI settings instead. Sorry about that.

I was all excited that it was (as expected) my own incompetence and that this would solve my problem, until I saw the attached.

(I had wondered previously if I was missing some decode setting(s), so I looked under HKEY_CURRENT_USER\Software\CineForm\VfW. There were only Encode* settings. I added a DecodeVSRGB 0 of my own (good guess), to no effect. Now of course, having accessed that dialog, the Decode* settings are there, as well.)

Changing the Decode VSRGB value has no effect on what playback looks like.

David Newman
July 1st, 2007, 04:41 PM
Restart you app, and your settings will take hold, otherwise AE will cache. You point you have missed is that your AVIs are the same on my computer (and anyone else who cares to try) -- it is completely a local to your setup.

Also try loading the two AVIs in two vuirtual dub sessions, and see how perfectly they match.

David Newman
July 1st, 2007, 04:48 PM
Have you been playing with other registry settings? If so please stop it -- causes suport issues that would not otherwise exist. We probably have people reading this thinking that something is wrong with CineForm -- rather than we gave a customer too much rope. ;) Start AE and hold down "Ctrl+Shift" during the startup, if you see a CineForm control panel you running the Prospect HD importer, not VfW. You can turn it off, or leave it on. If you use this CineForm (non-VfW) importer, use Interpret Footage "More Options" to get this control:

K. Tessman
July 1st, 2007, 08:39 PM
Have you been playing we other registry settings? If so please stop it -- causes suport issue that would not otherwise exist. We probably have people reading this thinking that something is wrong with CineForm -- rather than we gave a customer too much rope.
No, the only registry change I made was to add (then remove) the then-non-existent DecodeVSRGB value when I wasn't able to see such an option in the (as it turns out, wrong on my part) settings dialog. That exact value has now been added programmatically along with the other Decode* values now that I've accessed the proper Cineform VfW settings panel.

I'm fully willing to believe that this is solely an issue somehow with my setup, uniquely related to me. For anyone reading this: Cineform works just splendidly.

Anyway, here's where I'm at: I haven't been a VirtualDub user, but I downloaded it at your suggestion, and it works exactly as you described. It plays back both the CFHD and uncompressed AVIs the same, and with the same color/gamma characteristics as the TIFF sequence.

It's Windows Media Player (or Media Player Classic) that seems to play them back differently. If you're curious, I uploaded a comparison PSD file to

http://www.generalcoffee.com/temp/various_renderers.psd

The two VD-rendered layers are visually identical to the TIFF-sourced layer. The MP CFHD layer is noticeably less saturated/lighter, and the MP uncompressed is closer but still just a little off (visible flicking the upper layer on and off, or using Difference blending).

For whatever reason, for me (and on my setup, here, not to be extrapolated to anything another user and/or setup may experience!), Windows Media Player, Media Player Classic, and apparently other DirectShow playback (since I see the same thing in my own simple-DShow-based applications) render CFHD AVI files somewhat inaccurately. If I could figure out why that is, I'd be happier and have one less thing to work around in my workflow, but in the meantime, David, thanks for all your help, especially on a Sunday. Happy Canada Day!

David Newman
July 1st, 2007, 09:00 PM
Did you try the AE suggestion? "Start AE and hold down "Ctrl+Shift" during the startup,..."

End the end it is going to be one of two RGB type setting, or something with that older codec, but there have been no reports of any bugs in that area. You should test the latest to rule that out.

K. Tessman
July 1st, 2007, 09:25 PM
Sorry, David: I'd meant to mention that I tried that and saw nothing special when starting up AE with Ctrl+Shift down (nor do I have the option to select More Options from Interpret Footage).

I'm using Aspect HD.

(Since that earlier post, I've updated to Aspecthdv432b77dl070329.zip.)

David Newman
July 1st, 2007, 09:47 PM
Try Aspect HD v5

K. Tessman
July 1st, 2007, 10:36 PM
I tried the Aspect 5 trial just now, and the Prospect trial while I was at it. Same thing: VirtualDub plays it back "right", while the image is a little washed out and brighter in WMP.

David Newman
July 1st, 2007, 11:52 PM
Please stick with your AE issue, as video levels in Media Player is an NVidia bug handling the overlay surface. That has been discussion in great depth on this forum -- it is your AE issue that no one else has reported.

K. Tessman
July 2nd, 2007, 11:38 AM
I have an ATI video card.

What I've been trying to diagnose, on and off, for a few months

http://www.dvinfo.net/conf/showthread.php?t=73069
http://www.dvinfo.net/conf/showthread.php?t=35671

is why it seems that an exported CFHD AVI does not play back with the same color/gamma rendition as in AE (or Premiere Pro) from which I exported it. I have been using Windows Media Player to judge this. I used to think of it as the Adobe apps being incorrectly darker. I have suspected alternately that this was happening either at display time in the application or at export time via the CFHD encoder. Given recent tests with TIFF sequences and uncompressed AVI and playback in other applications like VirtualDub, however, I'm leaning toward it being a WMP (or general DirectShow) playback issue.

I'm not sure the AE issue in my initial post is in fact the issue. I didn't make particularly detailed notes on my test for that post and I've since re-rendered the files several times, so the real valid starting point is probably my post #6, involving TIFF, uncompressed, and CFHD output. You note that on your computer the two AVIs play back identically: but that's not the case for me in Windows Media Player (although it seems to work fine in VirtualDub). That is what I'm now trying to get to the bottom of.

Given that it seems to play properly in VirtualDub, I'm reassured for the most part that the proper image is being exported. I'd just like it to play back properly in applications such as WMP.

It may still be an overlay issue of some sort, so I've tried playback with every combination of renderer and/or overlay on/off combination that's user-available in both WMP and VirtualDub (or selectable via DShow interface in my own applications), to no effect.

It may be that this is not a Cineform issue at all. It may well be that WMP/DShow use entirely different pipelines to render CFHD and uncompressed AVIs, and somewhere in that architecture is the problem that manifests solely on this setup, but I don't know.

David Newman
July 2nd, 2007, 12:11 PM
Sounds like we are down to an overlay issue -- and that isn't CineForm. The overlay screws-up as each graphic card vendor has there own YUV to RGB mapping that is completely non-standard. So when play a compressed YUV file and an uncompressed RGB file, they will look different on the overlay when in fact they are the same. You can prove the fault of the overlay by playing the same compressed clip in two windows at the same time, one clip will get the only overlay, the other will not (use a tool like MediaPlayer Classic which can be run twice.) If they are the same, you have one for the few GFX cards that get this correct (e.g. Matrox Parahelia), ATI normally gets the overlay correct, but the desktop YUV to RGB conversion wrong, NVidia is the other away around. Tools like VirtualDub are get for testing as they don't use the overlay.

K. Tessman
July 3rd, 2007, 08:57 AM
Thanks for all your help and feedback on this, David.