VideoHelp Forum
+ Reply to Thread
Results 1 to 6 of 6
Thread
  1. Hi all,

    I hope you could help me solving this color distortion problem. Anytime I load my source via avisynth ffvideosource, it seems to be messing with the colors compared to the source (no other filters are applied).

    Here is a screen comparison:

    Source


    Loaded in Avisynth via ffvideosource


    Is this a problem with the source? Problem with avisynth, ffms2? Some installation issue? I am using AviSynth+ (64bit) and ffms 2.4.



    Here is the mediainfo of the source as well:
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L4.1
    Format settings : CABAC / 4 Ref Frames
    Format settings, CABAC : Yes
    Format settings, Reference frames : 4 frames
    Codec ID : V_MPEG4/ISO/AVC
    Duration : 2 h 0 min
    Bit rate mode : Variable
    Bit rate : 31.7 Mb/s
    Maximum bit rate : 34.0 Mb/s
    Width : 1 920 pixels
    Height : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Constant
    Frame rate : 23.976 (24000/1001) FPS
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Progressive
    Bits/(Pixel*Frame) : 0.637
    Stream size : 26.7 GiB (89%)
    Language : English
    Default : Yes
    Forced : No
    Quote Quote  
  2. How are you producing those screen shots? I think you just have a rec.601 vs rec.709 display problem.
    Quote Quote  
  3. Originally Posted by jagabo View Post
    How are you producing those screen shots? I think you just have a rec.601 vs rec.709 display problem.
    In this case the source is a screenshot from VLC player, and avisynth screen is exported as .bmp (via save image as). The method of taking screens seems to produce no impact (this issue is reproducible) anytime avisynth loads the source via ffvideosource, and it is not present otherwise. I tried comparing source mkv (png) to encoded mkv (png) and taking screens and you see identical issue.

    Converting to Rec.601 (via ConvertToYV12(matrix="Rec601") does bring it a lot closer but there is still slightly noticeable difference. Also if the source is Rec.701 why would Rec.601 conversion be necessary?
    Quote Quote  
  4. Originally Posted by jinkazama23 View Post
    Originally Posted by jagabo View Post
    How are you producing those screen shots? I think you just have a rec.601 vs rec.709 display problem.
    In this case the source is a screenshot from VLC player, and avisynth screen is exported as .bmp (via save image as). The method of taking screens seems to produce no impact
    The method of converting YUV video to RGB images is important. Different programs may use different matrices. And players may apply different "enhancements" to different videos.

    Originally Posted by jinkazama23 View Post
    Converting to Rec.601 (via ConvertToYV12(matrix="Rec601") does bring it a lot closer but there is still slightly noticeable difference. Also if the source is Rec.701 why would Rec.601 conversion be necessary?
    VLC often uses the wrong matrix to convert YUV to RGB (depending on the version of VLC and the video output device), even if the video is flagged rec.709. This has been a longstanding problem. Your HD video isn't flagged but it's most likely rec.709 (most HD video is rec.709 and most players default to rec.709 with HD video). So VLC is probably producing the wrong colors when exporting an image. Here VLC is displaying rec.709 video correctly on screen (video output set to Automatic, Direct3d 11, or OpenGL (the others display it incorrectly as rec.601). But it exports images with are rec.601 conversion.

    There's also a luma difference. It's not big enough to be a limited range vs. full range issue. It would be best if you uploaded a sample of your source and an encoded video for better analysis. And your full AviSynth script. I've never seen ffVideoSource() do anything like this.

    Here's a standard 75% colorbar test pattern encoded and flagged as rec.709 you can use to test. The color bars should have RGB values of 0 or 191 (plus or minus 1) when displayed. The small bright color patches should be RGB 0 or 255 (plus or minus 1). The black level pluge patterns near the bottom center/right should be RGB 0, 5, and 11. Correctly displayed it should look like this:

    Image
    [Attachment 57384 - Click to enlarge]
    Image Attached Files
    Quote Quote  
  5. Originally Posted by jagabo View Post
    Originally Posted by jinkazama23 View Post
    Originally Posted by jagabo View Post
    How are you producing those screen shots? I think you just have a rec.601 vs rec.709 display problem.
    In this case the source is a screenshot from VLC player, and avisynth screen is exported as .bmp (via save image as). The method of taking screens seems to produce no impact
    The method of converting YUV video to RGB images is important. Different programs may use different matrices. And players may apply different "enhancements" to different videos.

    Originally Posted by jinkazama23 View Post
    Converting to Rec.601 (via ConvertToYV12(matrix="Rec601") does bring it a lot closer but there is still slightly noticeable difference. Also if the source is Rec.701 why would Rec.601 conversion be necessary?
    VLC often uses the wrong matrix to convert YUV to RGB (depending on the version of VLC and the video output device), even if the video is flagged rec.709. This has been a longstanding problem. Your HD video isn't flagged but it's most likely rec.709 (most HD video is rec.709 and most players default to rec.709 with HD video). So VLC is probably producing the wrong colors when exporting an image. Here VLC is displaying rec.709 video correctly on screen (video output set to Automatic, Direct3d 11, or OpenGL (the others display it incorrectly as rec.601). But it exports images with are rec.601 conversion.

    There's also a luma difference. It's not big enough to be a limited range vs. full range issue. It would be best if you uploaded a sample of your source and an encoded video for better analysis. And your full AviSynth script. I've never seen ffVideoSource() do anything like this.

    Here's a standard 75% colorbar test pattern encoded and flagged as rec.709 you can use to test. The color bars should have RGB values of 0 or 191 (plus or minus 1) when displayed. The small bright color patches should be RGB 0 or 255 (plus or minus 1). The black level pluge patterns near the bottom center/right should be RGB 0, 5, and 11. Correctly displayed it should look like this:

    Image
    [Attachment 57384 - Click to enlarge]
    You are 100% right that this is a screenshot issue. I dismissed it initially because when encoding with Handbrake, the screenshots from VLC looked identical to the source. When you pull up both videos on the screen (VLC source and Avisynth preview for indexed video) the colors are identical. It is a bit puzzling to me, however, that processing with avisynth and ffms2 (with subsequent encoding) would lead to VLC producing wrong colors on screenshots while encoding with Handbrake would not.
    Quote Quote  
  6. How are you loading AviSynth script into VLC? The version I have doesn't support that.

    But I just played a similar rec.601 test chart with VLC and it produced slightly wrong colors and levels. A screen cap:

    Image
    [Attachment 57385 - Click to enlarge]


    I wish they would get their act together. It's a little better now but they've had these color problems for at least 10 years.
    Quote Quote  



Similar Threads

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