0

for a noprofit project I do shoot with (up to 5x) Canon HF100 camera(s) but, as stated in this interesting artile, it genetates a "custom RGB range" (16-255) files.

Thanks to this cool repository I've generated this GIF of 10s of source video:

http://www.forart.it/_priv/cultura/HF100_measurement.gif (33 Mb, so can't post. Click to watch)

It graphically shows how recorded video exceed the broadcast range.

The question is: how to "shift down" everything (and constrain inside broadcast range, of course) in order to preserve the maximum possible color quality ?

(note: someone already suggested me to use " Levels(0, 16, 255, 16, 235, coring=false) " in AviSynth but, if possible, I want to do it only with FFMPEG)

Thanks in advance to anyone that can/will help.

Marco

7

1 Answer 1

1

You can use the geq filter to remap the pixel value ranges.

ffmpeg
 -i input
 -vf "geq=lum='(p(X,Y)-16)/(255-16)*(235-16)+16':cb='(p(X,Y)-16)/(255-16)*(240-16)+16'"
 -c:v libx264 -c:a copy out.mp4

The geq filter rescales the input luma from 16-255 to 16-235, and both the input chroma from 16-255 to 16-240, which is the legal range for broadcast 8-bit signals.

1
  • Thank you very mutch for your help ! Another question: is there a way to "legalize" any source level to broadcast level ? In other words: can FFMPEG probe source file(s) level before remap to broadcast ?
    – FORART npo
    Commented Apr 28, 2021 at 10:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.