Color distortion when saving as video file I want to create a short animation with Blender 2.78c, which should be included in PowerPoint 2010 on a windows maschine. At the end, avi videos are not an option, because either the file size is incredible huge or the quality is not satisfying. In principle I can import an mpeg-1 compressed video into PowerPoint, which would be my prefered solution.

But here comes the problem (which is very similar to  [Compression &amp; Color change)

I created an animation and saved all frames as png images, which I would like to render as a combined mped file. For integrating the animation seamless into PowerPoint, I chose a white (hex-code #ffffff) background, which works very fine for a single png file. However, when importing the mpeg file, the preview image (the still file displayed before pressing play) also has a white background but when pressing play all subsequent frames have a slightly grayish background (hex-code #ebebeb).

I read that my problem could be related to a RGB to YCbCr conversion, but could anybody please tell me, how to correct this small shift? Or is it just not possible to have a background which is equivalent to #ffffff in an mpeg file? The same problem also occurs for H.264 and mpeg-2 or mpeg-4 compression.

Thanks a lot for your help!

Here is a minimalistic working example:



In an empty Blender file (version 2.78c), I switched to Video editor screen and added to track #1 a color (white, #ffffff in rgb). For the output I chose MPEG. Rendering a single frame as a png is fine, however rendering the mpeg-animation changes the white color to a grayish color (#ebebeb in rgb).



Update

I checked now also the color "black" and as Troy_s suggested, also black is shifted by the value 16 (#101010) when viewed in PowerPoint and VLC (no difference between fullscreen and window mode).

However: When viewing the mpeg-1 encoded videos with Windows Media Player there is no distortion. Is it then right to say, that the encoding part worked, but the decoding failed?
[...] I chose a white (hex-code #ffffff) background, which works very fine for a single png file. However, when importing the mpeg file [...] all subsequent frames have a slightly grayish background (hex-code #ebebeb).


Suspiciously 0xEB ends up being 235, which just happens to be the broadcast YCbCr BT.709 level. That might be a hint that your decoding is failing you. The decode should correctly scale that value back up to 255.

If you read any of the other diatribes I have written on the subject of codecs, encoding, and decoding, you will know that they are absolutely and horrifically bound to complexity. Is the encode correct? Are the proper flags set? Is the decode correct? Were the proper flags honoured? Is the GPU to fault? Is there something else somewhere that is bungled.

The long story short is that while we can't precisely answer your question, we can determine a few possible things:


Did your encoder encode the correct 255 8 bit value to 235? Check also with 0, which should be scaled up to 16.
Did your decoder decode the correct values and scale them back to their original positions?
How are you evaluating the output? Is it a screenshot from a full screen player? Windowed? Are there differences? Are there differences between players?


My best guess is that it encoded correctly but your player of choice is mis-guessing or not displaying the output correctly. Either that or it is encoded correctly but a flag that the player is looking for isn't set correctly.

Best advice is to check the encoded output with several players, at both full screen and windowed. Compare results. VLC, MPlayer, and your resident OS media player are good starting points.

Good luck...