Does anyone know how I can achieve the following color space (bt.709) via FFmpeg?
Here is what I have now in my files...
As you can see there is Format settings, Matrix
as default, how can I set it like this :
- Format settings (Matrix) : Custom or Standard
- Component Color primaries : BT.709
- Transfer characteristics : BT.709
- Matrix coefficients : BT.709
Thank you
After much searching, the secret option that has to be passed to ffmpeg for proper BT.709 encoding is found to be inside the video filter feature. Note that the -vf video filter option actually transforms while the other 709 flags just indicate what flags will be included in the container.
This example starts with a 32x32 png that is set to (0, 0, 255) or max blue.
The output of the last command dumps byte values as ints, you should see (Y Cb Cr) values as Y = 32, Cb = 240, Cr = 118 which means the BT.709 conversion matrix is being used in the .m4v file. When decoded back to RGB the transformed color is (2 0 255).
With re-encoding, use
In Mediainfo, at the end of the video stream attributes, you should see the three color-related entries. Note that Format settings (Matrix) is related to MPEG quantization and not color.