-
Notifications
You must be signed in to change notification settings - Fork 406
Description
I'm working on an open accessibility library for measuring photosensitive epilepsy risk as per the WCAG 2.0 guidance, similar to the proprietary Harding test used in broadcasting. This test involves measuring the relative luminance of video content over time to detect patterns that may cause people with PSE to suffer seizures. Right now there are no convenient open libraries for perfoming this test, so my aim is to implement one.
The WCAG 2.0 guidance specifies that relative luminance is to be measured in the sRGB colourspace, i.e. a space with the ITU709 primaries and white point but with an alternative transfer function. At the moment, PyAV only supports ITU709 with the default transfer curve. FFmpeg supports the sRGB colour space by specifying bt709
but with the TRC set to iec61966_2_4
.
Since my application is centered around decoding the correct luminance, it is sensitive to using the correct transfer function and simply using ITU709 with the incorrect transfer curve is not appropriate. I could manually convert from ITU709 to sRGB by applying the respective OETF and EOTF in sequence, but this incurs a performance penalty and leads to quantisation error.
I would like to see support in PyAV for the sRGB colour space, either as a new option in av.video.reformatter.Colorspace
or via support for explicitly setting the transfer curve. The latter would be the most flexible option.