How would I be getting correct colors under one set of test conditions and wrong colors under another?Or checking method ?
I'll try it without zscale.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 61 to 67 of 67
Thread
-
Last edited by chris319; 22nd Jan 2019 at 21:36.
-
Here are the test results:
Original bmp (entire raster): R-G-B 16-180-16
Test #1 yuv422p:
bin\ffmpeg -y -loop 1 -t 10 -r 59.94 -s 1280x720 -i raster.bmp -vf zscale=matrix=709:range=limited,format=yuv422p -c:v libx264 -color_primaries bt709 -color_trc bt709 -colorspace bt709 -crf 1 -an raster.mp4
R-G-B 16-179-14
Test #2 yuv420p:
bin\ffmpeg -y -loop 1 -t 10 -r 59.94 -s 1280x720 -i raster.bmp -vf zscale=matrix=709:range=limited,format=yuv420p -c:v libx264 -color_primaries bt709 -color_trc bt709 -colorspace bt709 -crf 1 -an raster.mp4
R-G-B 16-179-14
Test #3 yuyv422:
bin\ffmpeg -y -loop 1 -t 10 -r 59.94 -s 1280x720 -i raster.bmp pixformat=yuyv422 -c:v libx264 -an raster.mp4
R-G-B 2-155-10
Test #4: ffmpeg will not run: zscale changed to scale
bin\ffmpeg -y -loop 1 -t 10 -r 59.94 -s 1280x720 -i raster.bmp -vf scale=matrix=709:range=limited,format=yuv422p -c:v libx264 -color_primaries bt709 -color_trc bt709 -colorspace bt709 -crf 1 -an raster.mp4 -
Code:
ffmpeg -i input.tif -vf scale=out_color_matrix=bt709:flags=full_chroma_int+accurate_rnd,format=yuyv422 -c:v libx264 -crf 1 -x264opts colorprim=bt709:transfer=bt709:colormatrix=bt709:force-cfr -frames:v 1 -an yuyv422_x264.mp4 -y
16-179-14
When feeding yuyv422 , and getting "correct" colors (+/-3, ignoring subsampling lines), the output pin will be planar yuv422p with either utvideo or x264, when ffmpeg/libav decoders are used .
You don't get the auto-select format message for x264 (as you do for ut) , but it seems like most (?all) ffmpeg decoders output planar formats preferentially anyways. You can check ffmpeg -i yuyv422_x264.mp4 and it will say yuv422p, even though you fed it yuyv422. So internally it's probably re-arranged it, even though there is no message in the log (like you get for ut).
So if you "need" yuyv422 as output from a video, to be used as input into another filter or your program, you would change the pixel format beforehand , or modify your program to handle other uncompressed fourcc's / pixel arrangements . It's probably better to use planar for everything if you are using ffmpeg code - fewer conversions, faster. -
Code:
bin\ffmpeg -loop 1 -t 10 -r 59.94 -s 1280x720 -i raster.bmp -vf scale=out_color_matrix=bt709:flags=full_chroma_int+accurate_rnd,format=yuyv422 -c:v libx264 -crf 1 -x264opts colorprim=bt709:transfer=bt709:colormatrix=bt709:force-cfr -frames:v 1 -an raster.mp4 -y
Utvideo gives me:
R-G-B 29-207-20
Code:bin\ffmpeg -loop 1 -t 10 -r 59.94 -s 1280x720 -i raster.bmp -vf scale=out_color_matrix=bt709:flags=full_chroma_int+accurate_rnd,format=yuyv422 -c:v utvideo -an raster.mkv -y
However I get
R-G-B 16-179-14
simply by changing utvideo to ffv1. I'm fine with using ffv1 instead of utvideo.Last edited by chris319; 23rd Jan 2019 at 14:00.
-
No, because utvideo will do the "auto-selecting format" to yuv422p . It needs to be flagged , and in mkv container . The native AVI container for ut doesn't support that 709 flag
Code:ffmpeg -i input.tif -vf scale=out_color_matrix=bt709:flags=full_chroma_int+accurate_rnd,format=yuyv422 -c:v utvideo -frames:v 1 -colorspace 1 -an yuyv422_ut.mkv
But all these formats will output yuv422p if you use ffmpeg/libav as the decoder anyways. So the big question is why are you doing this ? It's a lot simpler if you were going to use ffmpeg/libav or any derivative code to use planar formats . Why are you bothering with yuyv422 ? I gather because in post 3,4 the code you are using is for packed / interleaved, that's probably why, but it won't work because the output from the decoder is planar. You 'd have to convert before your program, or modify the code as mentioned earlier
eg. if you take ffmpeg -i "raster.mp4" , it will say yuv422p .Last edited by poisondeathray; 23rd Jan 2019 at 14:21.
-
So the big question is why are you doing this ?
Thank you again for your invaluable help. -
It is my casual observation that 4:2:2 looks just slightly better after being transcoded by YouTube even though it is upsampled 4:2:0.
Similar Threads
-
Confused about the pixels
By patrick in forum Newbie / General discussionsReplies: 36Last Post: 13th Feb 2017, 17:32 -
Game lag pixels.
By Jappyanime in forum ComputerReplies: 13Last Post: 20th Nov 2015, 13:04 -
Block of pixels!
By alkoon in forum CapturingReplies: 3Last Post: 12th Aug 2015, 21:22 -
Twinkling pixels - 59iHz vs 59pHz
By VFRBoy in forum ComputerReplies: 2Last Post: 11th Jul 2015, 03:38