[SUGGESTION] FFMPEG color space "legalization"
This feature will help all videomakers to "legalize" color space produced by their cameras for broadcast standard.
All started from this discussion started by me for solving the problem with "Canon HF100 colorspace".
After evaluating a clip, Gyan (an FFMPEG maintainer) suggested me:
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.mp4The 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.
Hope that inspires !
That could be a nice thing to add under the advanced section. Would also need to figure out the equivalent for 10-bit videos.
BT.2100 eq signal:
Luma Narrow range D = Round [(219 x E′ + 16) x 2^(n−8) ] Chroma Narrow range D = Round [(224 x E′ + 128) x 2^(n−8)]
so just multiply by 2^(n-8) for 10 or 12 bit since for 8 bit the last term is 1;