[FFmpeg-devel] [PATCH 0/3] Pass colour range from source to sink v2
philipl at overt.org
Thu Feb 22 00:25:35 EET 2018
This change turns out to be a subset of a much bigger change that Paul
put together back in December and which didn't get enough review
coverage for him to comfortably push. I didn't know about that, so I
redid a bunch of stuff, but the end result is what I think is a logical
subset of the complete YUVJ purge which can be reviewed and pushed on
Unlike Paul's complete set of changes, this does not include any
replacement of YUVJ code with color_range code and doesn't include
any range negotiation. It is strictly just passing the range from one
end to the other, assuming a range value is set by some means. This
is more useful than you may think as many demuxers and decoders set
the range, and many encoders and muxers respect the range.
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 correctly pass the colour
range through a pipeline so that it it influences encoder behaviour,
and is recorded in the container, where relevant.
Philip Langdale (3):
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
doc/APIchanges | 5 +++++
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 | 2 ++
libavfilter/buffersink.c | 1 +
libavfilter/buffersink.h | 1 +
libavfilter/buffersrc.c | 23 +++++++++++++++++++++--
libavfilter/buffersrc.h | 5 +++++
libavfilter/version.h | 4 ++--
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 +++++++++++++++++++--
libavfilter/video.c | 1 +
18 files changed, 87 insertions(+), 7 deletions(-)
More information about the ffmpeg-devel