FORUMS: list search recent posts

H.264 gets darker (depending on... what?)

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Tomasz Cieslik
H.264 gets darker (depending on... what?)
on Jan 20, 2016 at 10:45:43 pm

Hi, this is my 2nd post here, and english is not my native language so pllease be lenient.

TL;DR: After Effects animation rendered to lossless AVI (no compression) has correct color, but rendered to H.264 gets darker.

After Effects: animation main color (background) is exact #d3d3d3 (211,211,211) - this is REFERENCE.

I've noticed darkening issue by testnig H.264 embeded by tag in HTML5 where body background color is same as REFERENCE (animation color). First I've only noticed difference between Google Chrome and Firefox - Chrome display correct color, firefox - darker (alot).
Long story short this is what happend:

Option 1: Google Chrome (Hardware Acceleration - ON) = corect color
Option 2: Google Chrome (Hardware Acceleration - OFF) = darker color
OPtion 3: Firefox (Hardware Acceleration ON) = darker color
Option 4: Firefox (Hardware Acceleration - OFF) = correct color

This is not Graphic card issue (as effect is oposite) nor drivers or firmware.
BUT this is not Browser issue either - read further:

I've decided to compare H.264 with Lossless AVI in Media Player Classic so:

action 1: Render to lossless AVI (with preserve RGB - ON) = correct color,
action 2: Render to lossless AVI (with preserve RGB - OFF) = correct color,
action 3: Render to H.264 (everyway possible from baseline 3.1 to High 5.1 with Preserve RGB) = correct color,
action 4: Render to H.264 (with Preserve RGB - OFF) = correct color.

Now here is how far i've got with this issue: I was wondering why Media Player Classic plays all files with fine color, then i've decided to play around with Media Payer Classic Output options and here it is:

MPC Render Options
DirectShow Video: "Enchanced Video Renderer" = all videos correct color (AVI and H.264)
DirectShow Video: "SYSTEM DEFAULT" = Lossless AVI correct color BUT H.264 the same DARK issue as in web browsers...

Notice: by color correct I mean: play video - do screenshot - past it to Photoshop - measure color by color picker and check value with reference color.
Notice: please don't give me "monitor calibration" questions - this is not PERCEPTION issue, it is PIXEL RGB VALUE DIFFERENCE.
Notice: I've chceck it on other computers and it's the same, H.264 plays darker.
Notice: I've also create H.264 using HANDBRAKE 10.xxx - same thing...

http://cieslik.net/color.png

The measured difference is (211,211,211) vs (197,197,197)

And today I've noticed even wors thing, even if Hardware Acceleration is ON in Chrome, there is color diference to but less visible:
(211,211,211) vs (212,210,212) - :(((( whyyyy!? when the same video played by MPC looks perfect (if enhanced video render is ON)...

This is beyond logic...


Return to posts index

Walter Soyka
Re: H.264 gets darker (depending on... what?)
on Jan 21, 2016 at 12:05:22 pm

[Tomasz Cieslik] "And today I've noticed even wors thing, even if Hardware Acceleration is ON in Chrome, there is color diference to but less visible: (211,211,211) vs (212,210,212) - :(((( whyyyy!? when the same video played by MPC looks perfect (if enhanced video render is ON)..."

H.264 does not store RGB internally, but rather Y'CbCr. Because color must be converted from RGB for encoding and back to RGB for decoding, subtle rounding errors are possible, during encoding, decoding, or both. Remember that H.264 is lossy compression. There is no way to ensure that the decoded value will precisely match the encoded value.


[Tomasz Cieslik] "This is not Graphic card issue (as effect is oposite) nor drivers or firmware."

Are you sure? I know NVIDIA cards, for example, have settings that impact video playback:
http://avisynth.nl/images/Nvidia_control_panel.jpg


[Tomasz Cieslik] "First I've only noticed difference between Google Chrome and Firefox - Chrome display correct color, firefox - darker (alot)... DirectShow Video: "Enchanced Video Renderer" = all videos correct color (AVI and H.264), DirectShow Video: "SYSTEM DEFAULT" = Lossless AVI correct color BUT H.264 the same DARK issue as in web browsers..."

It'd be interesting to run your tests with a black-to-white ramp to get a better idea of what the different options are actually doing, but ultimately there may not be anything you can do.

Color management with video is still a bit of a mess everywhere.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Tomasz Cieslik
Re: H.264 gets darker (depending on... what?)
on Jan 22, 2016 at 9:10:21 pm

Hi, thanks for Your comment. I know that we're talking about lossy codec, and that other difference (211,211,211 vs 212,210,212) can be accepted in this context - this values "flowing" a little bit as video is played. But 211 vs 197 gray is not just color difference that codec mess - it's darker video (constant trough entire playback time).

Good point about nVidia video color menagment - I've checked and in my system defalut option is "use the video player settings". So if browsers (to my knowledge) use their build-in player, and just call graphic card for render power (by hardware acceleration option) so why effect is oposite in two browsers? For me this fact excludes video card issues...

What realy bothers me is what is the conection between video player "render engine (enhanced/default)" and two browsers with hardware acceleration options that gives the same render error...


Return to posts index


Walter Soyka
Re: H.264 gets darker (depending on... what?)
on Jan 23, 2016 at 11:33:21 am

[Tomasz Cieslik] "Good point about nVidia video color menagment - I've checked and in my system defalut option is "use the video player settings". So if browsers (to my knowledge) use their build-in player, and just call graphic card for render power (by hardware acceleration option) so why effect is oposite in two browsers? For me this fact excludes video card issues..."

I wouldn't assume. Hardware acceleration refers to different things in different contexts, and the app is still interacting with the OS, which in turn still interacts with the video driver to put video frames on the display.


[Tomasz Cieslik] "What realy bothers me is what is the conection between video player "render engine (enhanced/default)" and two browsers with hardware acceleration options that gives the same render error..."

That's because they are all using the same basic multimedia framework for video: DirectShow [link]. This gets complicated fast, but you may be able to force your browsers to use the Enhanced Video Renderer with something like the Codec Tweak Tool. BEWARE, I do not recommend this, and you could really mess up apps like Ae. I only mention this so you can understand a little better what's going on behind the scenes when you play a video on your computer.

Either way, my point is that you cannot guarantee the experience a user has when you cannot control their hardware, software, and configuration. You'll either need a different approach, or to accept that some subset of users will not experience this as you intend.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]