37 Replies Latest reply: Nov 23, 2012 10:34 AM by stats1979 Branched to a new discussion. RSS

    Color Shifts when rendering to H.264 Blu-ray

    FrankinMD

      Since upgrading to After Effects CS5 I am seeing the following:

       

      Whenever I render out a video file using the "H.264 Blu-ray" Output Module option, the resulting m4v video has a different color appearance than the After Effects composition from which it was rendered. The rendered file appears to have a yellow cast to it, especially evident in red highlights. This appearance is seen within After Effects (after importing the file and dropping it in a composition) as well as in VLC media player. In addition, a blu-ray disc created using the m4v file also has the yellow appearance when viewed on an HDTV. In other words, the color shift is consistant in various players as well as within After Effects itself.

       

      Here is the bug report I submitted:

       

      ******BUG******
      Concise problem statement:
      Steps to reproduce bug:
      1. Create a project with HDTV (Rec. 709) color space, 8 bit.
      2. Import a 1920x1080 video file (any kind).
      3. Render out to H.264 Blu-ray (using project color space).
      4. Import the resulting m4v file and compare it to the original video.
      Results: The color has been shifted; has a yellow cast to it.
      Expected results: the color should appear the same for the rendered file as the original.

        • 1. Re: Color Shifts when rendering to H.264 Blu-ray
          FrankinMD Community Member

          I should give my system as well:

          Core i7 920

          12 GB DDR3 RAM

          Vista Home Premium 64bit

          • 2. Re: Color Shifts when rendering to H.264 Blu-ray
            FrankinMD Community Member

            I'm pretty sure this issue is related to color space. I have seen the exact same color shift using a third party encoder app (MeGUI) which utilizes x264. The solution in that case was to frameserve the video via Avisynth with a line of code that converted the color to YV12 with Matrix=Rec.709. With this conversion done before the encoding, the resulting H.264 file matched the color of the original video.

             

            Unfortunately, I have tried every output module color profile available in my After Effects CS5 and none of them results in correctly preserved color in rendered H.264 files.

             

            Is there a color profile that I can use with After Effects to fix this?

            • 3. Re: Color Shifts when rendering to H.264 Blu-ray
              FrankinMD Community Member

              If someone could tell me just one After Effects workflow that results in an H.264 (.m4v) file that has color that is true to the composition that it was rendered from, I would greatly appreciate it. It really doesn't matter what the source video is or what color management is used, just so the final video keeps its color intact. If I could just see one workflow that works, that would be a great help.

               

              Thank you.

              • 4. Re: Color Shifts when rendering to H.264 Blu-ray
                FrankinMD Community Member

                Are there any Adobe employees who could comment on this?

                Thanks.

                • 5. Re: Color Shifts when rendering to H.264 Blu-ray
                  FrankinMD Community Member

                  This question has been up for 6 days now and still no response. I see that other people are getting answers, often from Adobe employees. As an Adobe customer for years, I would appreciate the courtesy of a response, however brief it may be.

                  If there is some other place where I should be posting these sorts of questions, please let me know.

                  Thank you.

                  • 6. Re: Color Shifts when rendering to H.264 Blu-ray
                    Todd_Kopriva Adobe Employee

                    This is a user-to-user forum. If Adobe employees answer questions here, they are doing so on their free time. Also, virtually all of the Adobe employees are on a holiday break right now.  If you want a guaranteed immediate answer from an Adobe employee, you can contact Technical Support:

                    http://www.adobe.com/support/contact/

                    • 7. Re: Color Shifts when rendering to H.264 Blu-ray
                      Szalam MVP

                      For the record, I never render H.264 from After Effects. Actually, I very rarely render any sort of compression with AE. I render a lossless file then use a different program (Adobe Media Encoder) to encode the final file. After Effects, because of the way it works frame by frame to render, can't do multipass compression. Multipass compression gets better-looking files at smaller file sizes.

                       

                      My suggested workflow would be to render uncompressed out of AE and compress using some other software.

                      • 8. Re: Color Shifts when rendering to H.264 Blu-ray
                        FrankinMD Community Member

                        Todd,

                         

                        Thank you for your response. I apologize for misunderstanding the nature of this forum; given some of the exchanges I have been reading here, it looked to me like the interaction was a bit more official than just people using their free time.

                         

                        I will certainly try that link you provided; in the meantime, if you or anyone else can shed any light on the question I have posed here, i.e. is it possible to render H.264 out of After Effects CS5 and have the color match the composition of origin, I would greatly appreciate it.

                         

                        Message was edited by: FrankinMD

                        • 9. Re: Color Shifts when rendering to H.264 Blu-ray
                          FrankinMD Community Member

                          Szalam,

                           

                          Thank you; that is helpful info. I am currently looking into doing what you suggest. However, given that the intermediate-based workflow (despite its advantages) is significantly slower than rendering straight from AE, I would still like to know if it is possible to render an H.264 file from AE without the noticeable color shift I am seeing. If the answer is "no", then I know where I stand and can proceed with alternatives.

                          • 10. Re: Color Shifts when rendering to H.264 Blu-ray
                            FrankinMD Community Member

                            I'm still looking for an answer to this question:

                             

                            Is is possible to render out an M4V file from After Effects and have the color stay true to the source comp?

                            • 11. Re: Color Shifts when rendering to H.264 Blu-ray
                              FrankinMD Community Member

                              I'm still trying to get an answer to this question.

                              • 12. Re: Color Shifts when rendering to H.264 Blu-ray
                                Dave LaRonde Community Member

                                FrankinMD wrote:

                                 

                                I'm still trying to get an answer to this question.

                                 

                                Well, here's my answer: it's time for Plan B.

                                 

                                The reason: AE renders one frame at a time, making it incapable of multipass encoding.  In a long-gop codec like H.264, multipass encoding can greatly improve image quality.  I'm with Szalam on this score -- if I were doing serious work, I'd never consider rendering in H.264.  What if you need a quick 'n dirty, small-size file to show your progress to a client?  It'll do.

                                 

                                Furthermore, H.264 is a DELIVERY codec; a final-use codec.  It won't withstand re-rendering without losing image quality.  What if you suddenly learn you need a copy of your AE render in.... oh, say, ProRes 422?  If all you have is an H.264 file, you'll have to live with the hit in image quality.  So again, I'm with Szalam in rendering in a lossless or uncompressed codec, and THEN compressing for delivery.

                                 

                                I can't answer your question about H.264 color directly, but I know that a couple of other AE & H.264 shortcomings make it a less-than-ideal codec choice when rendering For The Ages.

                                • 13. Re: Color Shifts when rendering to H.264 Blu-ray
                                  FrankinMD Community Member

                                  Dave,

                                   

                                  Thanks for the response; what you say makes a lot of sense. I agree that H.264 should be considered a delivery format only (well, aquisition format sometmes). My issue is that sometimes all you need is MPEG-4 (say, for a blu-ray) and it would save time if you could get it straight from AE. I know it wouldn't be the most efficient encode space-wise, for the reason you pointed out, but sometimes time is more important.

                                   

                                  When rendering For The Ages, it's hard to pick something that will be one size fits all, since you don't always know what frame size (for example) you will want your delivery format to be, so even a lossless AVI might need to be rendered again before encoding.

                                   

                                  As for Plan B, that's what I'll be doing for the time being, since I can't find a way around the color issue.

                                   

                                  I would still like to know what is happening with the H.264 color in After Effects, and I have the feeling some people are using AE to encode to it and don't realize what it is doing to their color. It would be nice if it were a known, rather than a hidden, issue (if it is an issue).

                                  • 14. Re: Color Shifts when rendering to H.264 Blu-ray
                                    ChrisProsser Adobe Employee

                                    I can assure you this isn't a widespread problem as I've rendered a  fair amount of h.264 directly out of AE and haven't noticed it. Nor have I heard anything from our testing department.

                                     

                                    I would still like to know what is happening with the H.264 color in  After Effects, and I have the feeling some people are using AE to encode  to it and don't realize what it is doing to their color. It would be  nice if it were a known, rather than a hidden, issue (if it is an  issue).

                                     

                                    Well, it really depends how you've configured ae for rendering, what OS version and platform you are on, and if you are using Color Management or not. If you don't have color management enabled, after effects assumes you are working in Rec709 RGB full swing and does a conversion to Rec709 YCrCb 16-235 and then compresses there. We use the transfer functions as defined in the h.264 specification in this case. Different players make different assumptions about converting from Rec709 into display, generally doing nothing.

                                     

                                    It's a whole different can of worms If you have color management enabled. For instance if you've color profiled your monitor, color correct in AE with CM on, render to h.264, and they play that in a non-color managed workflow, you may see some color shifting. That's because your monitor is shifted and AE was correcting for it in our comp window, but the h.264 player isn't correcting for the fact that your display isn't Rec709.

                                     

                                    --chris

                                    After Effects Engineering Manager

                                    • 15. Re: Color Shifts when rendering to H.264 Blu-ray
                                      FrankinMD Community Member

                                      Chris,

                                       

                                      Thanks for your input.

                                       

                                      "I can assure you this isn't a widespread problem as I've rendered a fair amount of h.264 directly out of AE and haven't noticed it. Nor have I heard anything from our testing department."

                                       

                                      Try this simple test:

                                       

                                      Make a 1920x1080 comp in AE with your choice of footage, using any AE settings/color management etc. you want to.

                                      Render to format "H.264 Blu-ray" (or plain "H.264") with any settings you care to choose, with the goal being best color fidelity possible.

                                      After rendering, import the output file into After Effects.

                                      Drop it in the original comp.

                                      A / B the two and compare the color.

                                      Do they match?

                                       

                                      If so, then you have achieved what I cannot, and what no one so far has demonstrated to me that they can do, and at that point I would greatly appreciate your sharing with me the secret of your success.

                                      If not, then join the club, because I can assure you that I am not the only one.

                                      • 16. Re: Color Shifts when rendering to H.264 Blu-ray
                                        kemch1013 Community Member

                                        Just an addition to your conversation.

                                         

                                        I have been rendering video to h264 for awhile from many different software packages. ffmpeg / quicktime pro / ae / etc. I've always noticed the color was a little less saturated in the final render. Particularly annoying when I had to overlay video over a still image and the two didn't match in color.

                                         

                                        When I use AE, I never export directly from it. Do you not use Adobe Media Encoder? You can open up an After Effects project up in it, choose your sequences, and have way more control over compression settings. You can also queue up many different profiles for the same item. Crucial when you need to troubleshoot / try different encode settings.

                                        • 17. Re: Color Shifts when rendering to H.264 Blu-ray
                                          FrankinMD Community Member
                                          • 18. Re: Color Shifts when rendering to H.264 Blu-ray
                                            Dave LaRonde Community Member

                                            FrankinMD wrote:

                                            When rendering For The Ages, it's hard to pick something that will be one size fits all, since you don't always know what frame size (for example) you will want your delivery format to be, so even a lossless AVI might need to be rendered again before encoding.

                                             

                                            True.  but you lose no image quality when you convert that lossless AVI to something else; you only lose what you choose to throw away by encoding to a different codec and size.

                                            • 19. Re: Color Shifts when rendering to H.264 Blu-ray
                                              MatRuel

                                              Hi Frankin,

                                               

                                              Did you solved the problem in the meanwhile (yellow tint on export) ?

                                              • 20. Re: Color Shifts when rendering to H.264 Blu-ray
                                                FrankinMD Community Member

                                                No, never solved. I finally resolved myself to exporting to lossless avi and using third party software to encode H264. Months after I'd "moved on", an Adobe support person contacted me to ask about reproducing the issue. Maybe it was selfish of me, but I didn't feel like taking the time to respond since I had found a reasonable (superior, actually) alternative. At any rate, I've never found anyone who could follow my simple test (described above) and report successful results, so it's hard for me to believe Adobe can't replicate the issue. The truth is, I'm better off with my current process than I would have been if the bug didn't exist, so hurray for "happy accidents".

                                                • 21. Re: Color Shifts when rendering to H.264 Blu-ray
                                                  MatRuel Community Member

                                                  Damn, could you say with third party software you use ? It would help me a lot

                                                  I will use the same workflow than.

                                                  • 22. Re: Color Shifts when rendering to H.264 Blu-ray
                                                    FrankinMD Community Member

                                                    I use MeGUI along with Avisynth (both freeware), but be warned: there's a learning curve to overcome before you can operate them successfully.

                                                    You first render out an uncompressed or lossless avi (I use the Lagarith lossless codec) from Media Encoder and then convert that using MeGUI.

                                                     

                                                    Below is an Avisynth script to use once you're up to speed on how the software works.You put the full path and name of the video to be converted in place of __vid__.

                                                     

                                                    aviSource("__vid__")

                                                    ConvertToYV12(matrix="Rec709")

                                                     

                                                    The second line is what prevents the color shift.

                                                    • 23. Re: Color Shifts when rendering to H.264 Blu-ray
                                                      A.I.1 Community Member

                                                      I did a test converting to H.264/Blu-ray (default settings) in AE CS5.5.

                                                      colour-test-solids.png

                                                      The coloured solids at the top are original, and the ones on the bottom are H264 Blu-ray compressed (from within AE CS5.5), imported back in to the AE5.5 composition.  Colour management is off.

                                                       

                                                      White/Greyscale turned out the same (ie. blocks that were RGB 255,255,255 stayed like that.  Same for blocks 128,128,128 and 200,200,200).

                                                       

                                                      The red was originally 200,0,0.  After conversion to H264 Blu-ray, the red block is 218, 19, 0 (according to AE CS5.5's Info Panel)

                                                      The green was originally 0,200,0.  After conversion to H264 Blu-ray, green was 0,170,0.

                                                      The blue was originally 0,0,200.  After conversion to H264 Blu-ray, blue was 0,12,210.

                                                       

                                                      No motion for the blocks shown.

                                                       

                                                      Render settings

                                                      quality best

                                                      format h.264 blu-ray

                                                      channels RGB

                                                      depth: millions of colors

                                                      colour: premultiplied (matted)

                                                      mainconcept h.264 20.00 Mbps

                                                      default options (high, 4.1, vbr1, 20 target bitrate, max 24 bitrate)

                                                       

                                                      AE CS5.5.  Windows 7.  Project settings: 8 bits per colour channel.

                                                      • 24. Re: Color Shifts when rendering to H.264 Blu-ray
                                                        Andrew Yoole ACP/MVPs

                                                        I just did a test myself.

                                                         

                                                        Mac Book Pro, OS X Lion, After Effects CS 5.5 (10.5.0.253)

                                                         

                                                        Project Settings:

                                                         

                                                        Screen Shot 2012-04-15 at 4.57.42 PM.png

                                                         

                                                         

                                                        Rendered using the H.264 for BluRay Output Module, then reimported file, laid one on top of other, masked the upper half out, so upper area of pic is native content, lower half is H.264 file.  You can see where the mask occurs by looking at the blue lines to left and right of the comp.

                                                         

                                                        There is no difference in any of the colours - they all match up perfectly.

                                                         

                                                        Screen Shot 2012-04-15 at 4.53.09 PM.png

                                                         

                                                        Overlaying one image over the other in Difference mode demonstrates how little the files differ: a little edging due to compression artifacts, but basically no difference in the file colours whatsover.  There are occasional variances of just one or two RGB points in any of the colour channels, but these can probably be explained by compression/banding issues.

                                                         

                                                        Screen Shot 2012-04-15 at 5.04.28 PM.png

                                                         

                                                         

                                                        Are you certain you have all colour management turned off in After Effects?

                                                        • 25. Re: Color Shifts when rendering to H.264 Blu-ray
                                                          A.I.1 Community Member

                                                          Andrew Yoole wrote:

                                                           

                                                          Are you certain you have all colour management turned off in After Effects?

                                                          It says it's off in Project Settings.  In Preferences->Previews there's 3 options for it (none of which say off - ie. they say Faster / more Accurate except ram preview / More Accurate).  Anyway it seems to give the same RGB values with each option of preview (ie. the red, green & blue coloured solids still show a different value after H264 Blu-ray compression.  I also tried turning OpenGL off for previews and it gave the results shown above too.  In the Output Module it also says colour management is off.  Exporting as uncompressed AVI instead of H264 Blu-ray gives identical RGB values as the source.

                                                          project-settings.jpg

                                                          output-settings.jpg

                                                          • 26. Re: Color Shifts when rendering to H.264 Blu-ray
                                                            A.I.1 Community Member

                                                            Andrew Yoole wrote:

                                                             

                                                            I just did a test myself.

                                                             

                                                            Mac Book Pro, OS X Lion, After Effects CS 5.5 (10.5.0.253)

                                                            Could it be anything to do with Mac vs PC?

                                                            Outputting as .MOV with the H264 option gives a much closer colour match (only around 1 out on the RGB values in the middle of the blocks) than the "H264 Blu-ray" option (which creates a .M4V file) on this PC anyway.

                                                             

                                                            So (on this PC, rendering from with AE CS5.5)

                                                            1) .MOV with H264 option gives almost the same colours as the source (only around 1 out on RGB values - on the middle of the coloured blocks anyway - not at the edges)

                                                            2) AVI uncompressed gives identical colours to the source

                                                            3) H264 option (.MP4) gives inaccurate results (a lot worse than 1)

                                                            4) H264 Blu-ray (.M4V) option gives inaccurate results (a lot worse than 1)

                                                            • 27. Re: Color Shifts when rendering to H.264 Blu-ray
                                                              nicycc

                                                              Because HDTV standard is 709 and ths SDTV  is 601. so the color in the monitor will have different feeling.

                                                              But if u use TV to watch the Effect will be the same.

                                                              TV have an Y-cb-cr to RGB  Translate table. when HD mode . tv will switch convert table to 709.

                                                              when signal change to SD mode . TV will auto switch to  601 table. so it will looks same.

                                                              But monitor did't have this function . so u will find the color shift.

                                                              if u  try to make it without shift in monitor. when u use TV to watch ur produce . u will find a lot of different

                                                              • 28. Re: Color Shifts when rendering to H.264 Blu-ray
                                                                FrankinMD Community Member

                                                                nicycc, I didn't totally follow that, but if you are saying there is no problem then I disagree. Firstly, there is a shift when viewed on a HDTV exactly the same as I see on my computer monitor. Secondly, even if it only looked wrong on a computer monitor, that would still be unacceptable as so much hi def content is delivered to people's computers nowadays. Thirdly, this didn't happen with CS4 but only started with CS5. Fourthly, A.I.1's test conclusively shows an objective difference in color when rendering using Media Encoder to H264. As I said previously, this is no longer a concern for me as I have an alternative process for transcoding to H264, but anyone who uses Media Encoder to do this needs to know that the color can change (although maybe not on a Mac).

                                                                • 29. Re: Color Shifts when rendering to H.264 Blu-ray
                                                                  mytbit

                                                                  I know I am resurecting an old thread but I have also had a lot of mind-blowing problems with output module's h264 color shift in AE 5.5...I believe I have pinpointed the reason and would like if someone could confirm or tell me I'm a fool...contrary to Adobe's claims, the h264 module does not seem to apply rec709 matrix to HD -size input video but rather rec601...since it also does not embed flags, players rely on the file's video size, which is 1920x1080, to determine which matrix to apply, and of course, they mistakingly apply the rec709, when it's actually rec601...those who encode to h264 SD, logically, don't see the problem because rec601 is the correct matrix for SD anyway...

                                                                   

                                                                  media encoder also doesn't embed flags, but applies the rec709 matrix correctly...

                                                                   

                                                                  hope the discussion picks back up...:-)

                                                                   

                                                                  cheers...

                                                                  • 30. Re: Color Shifts when rendering to H.264 Blu-ray
                                                                    stats1979 Community Member

                                                                    mytbit is correct.  I've been mystified by this same problem for the past year on my pc.  But I'm able to render the same files to h264 in Premiere without the color shift.  Because 90 percent of my work takes place in After Effects I would really love for adobe to correct this bug. 

                                                                    • 31. Re: Color Shifts when rendering to H.264 Blu-ray
                                                                      stats1979 Community Member

                                                                      Answer I've found is to either render to h264 from Premiere.  Or to render h264 in the Quicktime module. 

                                                                      • 32. Re: Color Shifts when rendering to H.264 Blu-ray
                                                                        FrankinMD Community Member

                                                                        I have tested stats1979's method and it works (thanks, stats!); if you render to H264 Blu-ray out of Premiere, the color is unchanged. If you have an After Effects project to be rendered, you can import it into Premiere and render from there. This raises in my mind the question of why Adobe hasn't fixed this bug yet, or even acknowledged that it exists. As I said earlier, for me this isn't a concern because my workflow now renders everything to avi and uses third party to encode, but obviously this bug is inconvenient for anyone who would prefer the speed and simplicity of rendering straight from After Effects.

                                                                        • 33. Re: Color Shifts when rendering to H.264 Blu-ray
                                                                          Rick Gerard MVP

                                                                          When you are rendering out of Premiere Pro you are using the Adobe Media Encoder. Until Adobe changes the render cue you cannot do multi pass rendering in AE's Render Cue. You can render After Effects compositions directly in the Adobe Media Encoder (same as Premiere Pro) and therefore the results will be identical. You should never render MPEG formats like H.264 without using multi pass encoding so trying to call this a bug when it's a function of AE's current rendering engine to render a frame at a time is incorrect semantics. It is a feature that needs to be implemented, not a bug...

                                                                          • 34. Re: Color Shifts when rendering to H.264 Blu-ray
                                                                            Dave LaRonde Community Member

                                                                            ... obviously this bug is inconvenient for anyone who would prefer the speed and simplicity of rendering straight from After Effects.

                                                                             

                                                                            Because of the nature of waht After Effects does best --  i.e. render frame by frame -- it can't do multipass rendering, which can significantly lower H.264 file sizes, and it may even improve image quality.

                                                                             

                                                                            If you want, you can use Adobe Media encoder to make an h.264 of a specific comp.

                                                                            • 35. Re: Color Shifts when rendering to H.264 Blu-ray
                                                                              stats1979 Community Member

                                                                              You are wrong, sir.  This is in fact a bug.  Read mytbit's comment above.  The h264 module is rendering in the wrong color matrix.  This has been verified by a private comment sent to me by one of Adobe's programmers. 

                                                                               

                                                                              One of the most frustrating aspects of this forum is the non-stop excuse making of the fan-boys (nee, fan-men) even when Adobe has admitted there is an issue. 

                                                                              • 36. Re: Color Shifts when rendering to H.264 Blu-ray
                                                                                Rick Gerard MVP

                                                                                Maybe it is a bug technically but if you really get to the core problem it is that MPEG formats should not even be available in the Render Cue until the render cue is capable of multi pass rendering. No professional would ever deliver any MPEG format that was not rendered using multi pass encoding. The quality just isn't there and that's the Codec's fault. It is Adobe's fault for allowing their AE to give you the option to use something that cannot produce acceptable results because of the nature of the codec's architechure.

                                                                                 

                                                                                And I'm not a fanboy. Nobody is as hard on AE's development team as I am. I just have realistic expectations and I know how to use the tools of my trade without exceeting their limitations. This goes from Cameras to tripods to cranes to HMI's to generators to software. I've been making movies for 40 years and have never had an accident on the set or failed to deliver my part of the project.

                                                                                • 37. Re: Color Shifts when rendering to H.264 Blu-ray
                                                                                  stats1979 Community Member

                                                                                  Uh, huh.  Good for you.  But you were wrong.  Just admit you were wrong.  No need to give me your world view, or career resume.  Shish.

                                                                                   

                                                                                  And actually one pass h264 looks pretty good coming out of the quicktime module.