VideoHelp Forum




+ Reply to Thread
Results 1 to 15 of 15
  1. Member
    Join Date
    Jul 2015
    Location
    Polska
    Search PM
    Hello,

    I am trying to convert uncompressed Lagarith film to x264, but I am experiencing weird color issues.

    http://screenshotcomparison.com/comparison/151700

    Here's my command line:

    x264 --pass 1 --bitrate 25000 --bluray-compat --level 4.1 --preset slow --tune grain --keyint 24 --sar 1:1 --slices 4 --vbv-bufsize 30000 --vbv-maxrate 40000 --b-pyramid none --weightp 0 --colorprim bt709 --transfer bt709 --colormatrix bt709 --merange 24 --stats ".stats" --opencl --output NUL "morfina.avs"

    x264 --pass 2 --bitrate 25000 --bluray-compat --level 4.1 --preset slow --tune grain --keyint 24 --sar 1:1 --slices 4 --vbv-bufsize 30000 --vbv-maxrate 40000 --b-pyramid none --weightp 0 --colorprim bt709 --transfer bt709 --colormatrix bt709 --merange 24 --stats ".stats" --opencl --output "morfinaa.264" "morfina.avs"

    Any suggestions? Ideas?
    Quote Quote  
  2. Post MediaInfo of source file and your AviSynth script. x264 does not touch colors if input and storage are YUV. Problem can come from decoder, script or player.
    Quote Quote  
  3. Member
    Join Date
    Jul 2015
    Location
    Polska
    Search PM
    .avs

    AviSource("avs_1.avi")
    AddBorders(0, 20, 0, 22)

    MediaInfo (It's actually MagicYUV)

    General
    Complete name : J:\avs_1.avi
    Format : AVI
    Format/Info : Audio Video Interleave
    Format profile : OpenDML
    File size : 331 GiB
    Duration : 1h 51mn
    Overall bit rate : 424 Mbps
    Recorded date : 2015-11-22T08:49:04+01:00
    Writing application : Adobe Premiere Pro CC 2015 (Windows)

    Video
    ID : 0
    Format : MAGY
    Codec ID : MAGY
    Duration : 1h 51mn
    Bit rate : 424 Mbps
    Width : 1 920 pixels
    Height : 1 038 pixels
    Display aspect ratio : 1.85:1
    Frame rate : 24.000 fps
    Bits/(Pixel*Frame) : 8.856
    Time code of first frame : 00:00:00:00 / 00:00:00:00
    Time code source : Adobe tc_A / Adobe tc_O
    Stream size : 331 GiB (100%)
    Quote Quote  
  4. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    Looks like one decoder expanded to PC scale, the other kept it at TV scale.
    Quote Quote  
  5. Problems like this are never caused by x264. There's more going on here than just PC/TV levels and rec.601 vs. rec.709 matrix issues. The graphics card's video proc amp settings are probably "enhancing" one of the images and not the other. How was each image produced? What was your AviSynth script?
    Quote Quote  
  6. Member
    Join Date
    Jul 2015
    Location
    Polska
    Search PM
    Originally Posted by jagabo View Post
    Problems like this are never caused by x264. There's more going on here than just PC/TV levels and rec.601 vs. rec.709 matrix issues. The graphics card's video proc amp settings are probably "enhancing" one of the images and not the other. How was each image produced? What was your AviSynth script?
    Avisynth Script:

    AviSource("avs_1.avi")
    AddBorders(0, 20, 0, 22)

    VirtualDub image was made by loading the upper AviSynth script and exporting that exact frame through VirtualDub as well.
    The second one was made using PotPlayer (when the original avs_1.avi has normal colors).

    Input is in RGB, and I want to convert it for Bluray playback. Got any ideas?
    Quote Quote  
  7. Change your AviSynth script to

    Code:
    AviSource("avs_1.avi")
    AddBorders(0, 20, 0, 22)
    ConvertToYV12(matrix="rec709")
    Encode that as before. Then use an AviSynth script to view the resulting h.264 video:

    Code:
    ffVideoSource("morfinaa.264")
    ConvertToRGB(matrix="rec709")
    Compare the colors and levels to the original. They should be the same. Note that VirtualDub almost always uses a rec.601 matrix to display video in its preview panes. So you will see the wrong colors if you open the encoded video directly in VirtualDub (or leave out the ConvertToRGB(matrix="rec709")). Actually, try doing this with the file you've already encoded. It might be OK as it is.

    Keep in mind that Potplayer may not be displaying the correct levels and colors depending on the output device selected and your graphics card's video proc amp settings.
    Last edited by jagabo; 24th Nov 2015 at 11:27.
    Quote Quote  
  8. Member
    Join Date
    Jul 2015
    Location
    Polska
    Search PM
    Video encoded with ConvertToYV12 has still the same colors as before (not proper) in PotPlayer, but looks exactly like it should in VirtualDub.

    Any ideas what could I do to make sure this issue won't exist on Bluray player?
    Quote Quote  
  9. Are you sure that VirtualDub preview is correct, meaning it suppose to look like that? It looks a bit dark to me, those levels that you get at the end seem correct, what you suppose to get playing DVD or Blu-Ray ... Cannot say what is the cause in your case, or if everything is ok basically, just giving an opinion about those levels.
    Quote Quote  
  10. Originally Posted by _Al_ View Post
    Are you sure that VirtualDub preview is correct, meaning it suppose to look like that?
    If he's using my script for viewing the encoded video what he sees in VirtualDub should be the same as the RGB source he started with (except for the expected errors from the RGB to YUV to RGB conversion).

    Of course, we don't know if the RGB source has the correct colors since most sources would have been YUV and we don't know if was converted to RGB correctly.
    Last edited by jagabo; 25th Nov 2015 at 20:42.
    Quote Quote  
  11. Member
    Join Date
    Jul 2015
    Location
    Polska
    Search PM
    Originally Posted by jagabo View Post
    Originally Posted by _Al_ View Post
    Are you sure that VirtualDub preview is correct, meaning it suppose to look like that?
    If he's using my script for viewing the encoded video what he sees in VirtualDub should be the same as the RGB source he started with (except for the expected errors from the RGB to YUV to RGB conversion).

    Of course, we don't know if the RGB source has the correct colors since most sources would have been YUV and we don't know if was converted to RGB correctly.
    After tweaking color settings in PotPlayer - it is displaying the correct colors now as well. I had it set to BT.601, changed to BT.709. Also it wasn't set to full color range, so I changed it to full.

    So any ideas how could I make sure this won't exist on Bluray player?
    Quote Quote  
  12. Member
    Join Date
    Jul 2015
    Location
    Polska
    Search PM
    Originally Posted by _Al_ View Post
    Are you sure that VirtualDub preview is correct, meaning it suppose to look like that? It looks a bit dark to me, those levels that you get at the end seem correct, what you suppose to get playing DVD or Blu-Ray ... Cannot say what is the cause in your case, or if everything is ok basically, just giving an opinion about those levels.
    Video was color corrected to match DVD source and tweaked a bit by me later (as it was too-blueish to my taste).
    Quote Quote  
  13. Originally Posted by Colek View Post
    So any ideas how could I make sure this won't exist on Bluray player?
    Go through your TV and Blu-ray player setup menus and make similar adjustments. Use known good calibration test patterns.
    Quote Quote  
  14. Originally Posted by Colek View Post
    After tweaking color settings in PotPlayer - it is displaying the correct colors now as well. I had it set to BT.601, changed to BT.709. Also it wasn't set to full color range, so I changed it to full.

    So any ideas how could I make sure this won't exist on Bluray player?
    Players typically assume limited range BT.709 for HD content. Using full range is a good way to get wrong colors. Like jagabo said you cannot trust VirtualDub's preview to show correct colors for BT.709 YUV sources. You can insert "ConvertToRGB(matrix="rec709")" at the end of the script, then do your color tweaking. After you are done with tweaking you have to remove the line again for the actual encoding so that no unneeded YUV->RGB->YUV conversion is done.
    Quote Quote  
  15. Be careful about what the limited/full range labels mean. On some devices they are referring to the output (the screen), on others the input (the video file). Some devices have settings like high/low -- what the hell does that mean? The international standard for encoded video has the luma ranging from 16 to 235 (limited range). On conversion to RGB (what you see on the screen) it becomes 0 to 255 (full range). SD (eg. DVD) usually uses the rec.601 matrix, HD (eg. Blu-ray) the rec.709 matrix. The colors are slightly different, most visible in greens and reds:

    https://forum.videohelp.com/threads/329866-incorrect-collor-display-in-video-playback?p...=1#post2045830

    Which of those two matrices you use doesn't effect the brightness of greyscale elements.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!