VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Page 3 of 3
FirstFirst 1 2 3
Results 61 to 67 of 67
Thread
  1. Or checking method ?
    How would I be getting correct colors under one set of test conditions and wrong colors under another?

    I'll try it without zscale.
    Last edited by chris319; 22nd Jan 2019 at 22:36.
    Quote Quote  
  2. 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
    Quote Quote  
  3. 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
    "green"
    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.
    Quote Quote  
  4. 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
    Now I get R-G-B 16-179-14 with x.264, congratulations!

    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
    Should this be reported as a bug in utvideo?


    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 15:00.
    Quote Quote  
  5. Originally Posted by chris319 View Post

    Should this be reported as a bug in utvideo?
    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 15:21.
    Quote Quote  
  6. So the big question is why are you doing this ?
    Now that I have my 4:2:2 "scope" program working in color, I wanted to make sure the colors were true, when I discovered the color error in utvideo. I simply wanted to identify the origin of the error to eliminate the possibility that my "scope" program was munging up the colors. Well, the colors are true in my scope program when using ffv1 and this makes me happy.

    Thank you again for your invaluable help.
    Quote Quote  
  7. 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.
    Quote Quote  



Similar Threads