Commit 03f982bb authored by Mark Thompson's avatar Mark Thompson

lavc: Add hevc_metadata bitstream filter

This is able to modify some header metadata found in the VPS/SPS/VUI,
and can also add/remove AUDs.

(cherry picked from commit b31a9eae)
parent 8b263062
......@@ -2915,6 +2915,7 @@ vc1_parser_select="vc1dsp"
# bitstream_filters
h264_metadata_bsf_select="cbs_h264"
h264_redundant_pps_bsf_select="cbs_h264"
hevc_metadata_bsf_select="cbs_h265"
mjpeg2jpeg_bsf_select="jpegtables"
trace_headers_bsf_select="cbs_h264 cbs_h265 cbs_mpeg2"
......
......@@ -183,6 +183,60 @@ confuse other transformations which require correct extradata.
A new single global PPS is created, and all of the redundant PPSs
within the stream are removed.
@section hevc_metadata
Modify metadata embedded in an HEVC stream.
@table @option
@item aud
Insert or remove AUD NAL units in all access units of the stream.
@table @samp
@item insert
@item remove
@end table
@item sample_aspect_ratio
Set the sample aspect ratio in the stream in the VUI parameters.
@item video_format
@item video_full_range_flag
Set the video format in the stream (see H.265 section E.3.1 and
table E.2).
@item colour_primaries
@item transfer_characteristics
@item matrix_coefficients
Set the colour description in the stream (see H.265 section E.3.1
and tables E.3, E.4 and E.5).
@item chroma_sample_loc_type
Set the chroma sample location in the stream (see H.265 section
E.3.1 and figure E.1).
@item tick_rate
Set the tick rate in the VPS and VUI parameters (num_units_in_tick /
time_scale). Combined with @option{num_ticks_poc_diff_one}, this can
set a constant framerate in the stream. Note that it is likely to be
overridden by container parameters when the stream is in a container.
@item num_ticks_poc_diff_one
Set poc_proportional_to_timing_flag in VPS and VUI and use this value
to set num_ticks_poc_diff_one_minus1 (see H.265 sections 7.4.3.1 and
E.3.1). Ignored if @option{tick_rate} is not also set.
@item crop_left
@item crop_right
@item crop_top
@item crop_bottom
Set the conformance window cropping offsets in the SPS. These values
will replace the current ones if the stream is already cropped.
These fields are set in pixels. Note that some sizes may not be
representable if the chroma is subsampled (H.265 section 7.4.3.2.1).
@end table
@section hevc_mp4toannexb
Convert an HEVC/H.265 bitstream from length prefixed mode to start code
......
......@@ -1018,6 +1018,7 @@ OBJS-$(CONFIG_EXTRACT_EXTRADATA_BSF) += extract_extradata_bsf.o \
OBJS-$(CONFIG_H264_METADATA_BSF) += h264_metadata_bsf.o
OBJS-$(CONFIG_H264_MP4TOANNEXB_BSF) += h264_mp4toannexb_bsf.o
OBJS-$(CONFIG_H264_REDUNDANT_PPS_BSF) += h264_redundant_pps_bsf.o
OBJS-$(CONFIG_HEVC_METADATA_BSF) += h265_metadata_bsf.o
OBJS-$(CONFIG_HEVC_MP4TOANNEXB_BSF) += hevc_mp4toannexb_bsf.o
OBJS-$(CONFIG_IMX_DUMP_HEADER_BSF) += imx_dump_header_bsf.o
OBJS-$(CONFIG_MJPEG2JPEG_BSF) += mjpeg2jpeg_bsf.o
......
......@@ -32,6 +32,7 @@ extern const AVBitStreamFilter ff_extract_extradata_bsf;
extern const AVBitStreamFilter ff_h264_metadata_bsf;
extern const AVBitStreamFilter ff_h264_mp4toannexb_bsf;
extern const AVBitStreamFilter ff_h264_redundant_pps_bsf;
extern const AVBitStreamFilter ff_hevc_metadata_bsf;
extern const AVBitStreamFilter ff_hevc_mp4toannexb_bsf;
extern const AVBitStreamFilter ff_imx_dump_header_bsf;
extern const AVBitStreamFilter ff_mjpeg2jpeg_bsf;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment