VideoHelp Forum




+ Reply to Thread
Page 2 of 2
FirstFirst 1 2
Results 31 to 43 of 43

  1. Window_full.mp4 is Y=0,16,235,255, border is Y=111. CbCr is 128 everywhere, file is flagged full range.

    Window_limited.mp4 is flagged limited range
    YCbCr
    16,128,128
    29,127,127
    217,127,127
    234,127,127
    border 111,127,127
    Quote Quote  
  2. What are you using to measure these levels?
    Quote Quote  
  3. Originally Posted by chris319 View Post
    What are you using to measure these levels?
    avspmod, vsedit, ffmpeg

    You can also verify by decoding to raw .YUV and look at hex values
    Quote Quote  
  4. Now I see where the problem lay.

    Does this work any better for you? It is full range.

    Code:
    ffmpeg -y  -i One_shot.mp4  -pix_fmt yuvj420p  -c:v libx265 -vf eq=brightness=.11:contrast=0.75:gamma=0.5,scale=out_color_matrix=bt709:out_range=full  -color_primaries bt709  -color_trc bt709  -colorspace bt709  -c:a copy  One_shot_limited.mp4
    Quote Quote  
  5. Code:
    ffmpeg -y  -i One_shot.mp4  -pix_fmt yuvj420p  -c:v libx265 -vf eq=brightness=.11:contrast=0.75:gamma=0.5,scale=out_color_matrix=bt709:out_range=full  -color_primaries bt709  -color_trc bt709  -colorspace bt709  -c:a copy  One_shot_limited.mp4
    0,16,111,235,255 - Y values for your Window_full.mp4 as input
    5,12,75,210,236 -Y values coming out from ffmpeg

    your original cmd line in your first post, it is coming out from ffmpeg as:
    16,23,82,198,220
    Quote Quote  
  6. Originally Posted by chris319 View Post
    Now I see where the problem lay.

    Does this work any better for you? It is full range.

    Code:
    ffmpeg -y  -i One_shot.mp4  -pix_fmt yuvj420p  -c:v libx265 -vf eq=brightness=.11:contrast=0.75:gamma=0.5,scale=out_color_matrix=bt709:out_range=full  -color_primaries bt709  -color_trc bt709  -colorspace bt709  -c:a copy  One_shot_limited.mp4

    It's not for "me" ; but general public with full range video applying this filter might encounter issues.

    The 4 patches become Y=5,12,210,236

    Full range flag is less ideal, because of inconsistency in handling - In most video editors, this will cause it to be treated as full range by default, this will compress the range farther eg in resolve, instead of a range of 0-1023 RGB, you'd get 20-947 . But some programs ignore the flag, and take the actual range. Yes, you can override range handling in the clip attributes, or make adjustments, but ideally, it should come in around 0-1023 RGB if using resolve , otherwise why do this in ffmpeg ? it's easier in a program with a GUI
    Quote Quote  
  7. I can make it limited range but that will involve adjusting the eq parameters and that can take a lot of time.
    Quote Quote  
  8. Originally Posted by chris319 View Post
    I can make it limited range but that will involve adjusting the eq parameters and that can take a lot of time.
    ffmpeg is a useful tool, but it's the wrong tool for these types of task

    Some NLE GUI is better where you can make adjustments, keyframes, per shot . You're not going to use the same eq or filter parameters per shot anyways and it's a lot of back and forth
    Quote Quote  
  9. Doing it in Shotcut would be a nightmare.
    Quote Quote  
  10. Originally Posted by chris319 View Post
    Doing it in Shotcut would be a nightmare.
    If they add curves, it would help. It's been requested many times

    Your chart is supported in resolve, so makes sense to do it there. Even if it's a bit off, the auto color match is a great starting point if it was properly shot

    But for a typical consumer, consumer camera, typical usage scenario - they don't (or can't) adjust exposure ideally during the shoot - so the errors in color match tend to be larger .
    Quote Quote  
  11. Even if it's a bit off, the auto color match is a great starting point if it was properly shot
    It's more than "a bit off".

    I'd still have to get Resolve to re-flag it as limited.
    Quote Quote  
  12. Code:
    ffmpeg -y  -i One_shot.mp4  -pix_fmt yuv420p  -c:v libx265 -vf eq=brightness=0.04:contrast=0.98:gamma=0.63,scale=out_color_matrix=bt709:out_range=limited  -color_primaries bt709  -color_trc bt709  -colorspace bt709  -c:a copy  One_shot_limited.mp4
    Any better?

    Note: the black level and gamma are likely to read differently if tested on a test signal.
    Quote Quote  
  13. Originally Posted by chris319 View Post
    Code:
    ffmpeg -y  -i One_shot.mp4  -pix_fmt yuv420p  -c:v libx265 -vf eq=brightness=0.04:contrast=0.98:gamma=0.63,scale=out_color_matrix=bt709:out_range=limited  -color_primaries bt709  -color_trc bt709  -colorspace bt709  -c:a copy  One_shot_limited.mp4
    Any better?

    Note: the black level and gamma are likely to read differently if tested on a test signal.
    On input Y=0,16,235,255 , it becomes Y=7,14,211,237

    Yes, of course different video, different camera, or same camera different shot will have different values

    A ramp will show where range compression occurs and potential problematic areas will occur in any camera . A "normal" full to limited conversion becomes Y=16,30,218,235, but that suggests already from 2nd value on that 4 value test pattern that shadow detail will be compressed

    If the purpose was to adjust some midtone value up or down to reach some target, but keep the ends anchored at say Y=16,235, in ffmpeg for some reason , another way might be to use -vf lutyuv expression, or create a 3d LUT apply with -vf lut3d, or use the -vf curves filter. ffmpeg curves is like standard curves, like photoshop curves - it takes x,y coordinate points along the curve. It works in RGB like PS (you can probably get around that by casting YUV channels to RGB channel, then casting it back), but it pales in comparison to Resolve's curves. Resolve curves has Y,R,G,B, hue vs.hue , hue vs.sat, hue vs. lum, lum vs. sat, etc.. super powerful , so you can match colors/hue/sat/lum of a color chart using vectorscope and waveform - all realtime, all adjustable/keyframable working in 32bit float. It's the most powerful filter in resolve by a longshot
    Last edited by poisondeathray; 12th Aug 2020 at 10:05.
    Quote Quote  



Similar Threads

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