[FFmpeg-devel] [PATCH 0/4] Pass colour range from source to sink
philipl at overt.org
Mon Feb 19 20:48:21 EET 2018
Today, we have a colour range property on decoders and encoders. The
decoder sets the property on itself to reflect what it is decoding,
and the user sets it on the encoder to reflect what is being encoded.
However, we don't support a way to pass it through filter chains and
'ffmpeg' does not make any attempt to set it on the encoder.
This set of changes introduces a way to do this, by defining a new
filter link property, and allowing it to be set on a buffersrc and
read back from a buffersink.
We then extend the various relevant filters to set the property
when they manipulate the colour range, and finally, we get 'ffmpeg'
to get and set the range appropriately.
After this change, it is now possible to, for example. transcode
full range mjpeg to h.264, correctly, either by retaining the range,
or by compressing the range using a filter.
Philip Langdale (4):
avutil/opt: Add option type for Colour Range
avfilter: Add support for colour range as a link parameter
avfilter: Set output link colour range where appropriate
fftools/ffmpeg: Support passing colour range from decoder to encoder
fftools/ffmpeg.c | 2 ++
fftools/ffmpeg_filter.c | 1 +
libavfilter/avf_showcqt.c | 1 +
libavfilter/avf_showspectrum.c | 1 +
libavfilter/avfilter.c | 2 ++
libavfilter/avfilter.h | 1 +
libavfilter/buffersink.c | 1 +
libavfilter/buffersink.h | 1 +
libavfilter/buffersrc.c | 10 ++++++++--
libavfilter/buffersrc.h | 5 +++++
libavfilter/vf_colorspace.c | 4 ++++
libavfilter/vf_scale.c | 8 +++++++-
libavfilter/vf_setparams.c | 11 +++++++++++
libavfilter/vf_waveform.c | 1 +
libavfilter/vf_zscale.c | 21 +++++++++++++++++++--
libavutil/opt.c | 41 ++++++++++++++++++++++++++++++++++++++++-
libavutil/opt.h | 3 +++
17 files changed, 108 insertions(+), 6 deletions(-)
More information about the ffmpeg-devel