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
+ Reply to Thread
Results 1 to 6 of 6
-
-
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? -
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.
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:
[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.
-
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:
[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.
Similar Threads
-
Capture from camera with Xvid has color distortion
By zhimakaimen in forum Capturing and VCRReplies: 1Last Post: 25th May 2020, 22:42 -
adobe premiere - mpeg2 color shift in reds & distortion on export
By diamenz in forum Video ConversionReplies: 4Last Post: 7th Mar 2020, 13:03 -
avisynth open failure:FFVideoSource: Video codec not found using vafe
By NightBreaker in forum Video ConversionReplies: 1Last Post: 7th May 2018, 08:26 -
AviSynth - Color exchange
By Ninelpienel in forum EditingReplies: 49Last Post: 29th Nov 2017, 14:34 -
Avisynth nnedi3_rpow2 Color Shift Problem
By SameSelf in forum Video ConversionReplies: 8Last Post: 21st Jul 2016, 14:01