Commit 9e93001b authored by Mark Thompson's avatar Mark Thompson

lavc: Add h264_metadata bitstream filter

This is able to modify some header metadata found in the SPS/VUI,
and can also add/remove AUDs and insert user data in SEI NAL units.
parent f11d8a5e
......@@ -2323,6 +2323,7 @@ vc1_parser_select="vc1dsp"
# bitstream_filters
aac_adtstoasc_bsf_select="adts_header"
h264_metadata_bsf_select="cbs_h264"
mjpeg2jpeg_bsf_select="jpegtables"
trace_headers_bsf_select="cbs_h264 cbs_h265"
......
......@@ -39,6 +39,69 @@ When this option is enabled, the long-term headers are removed from the
bitstream after extraction.
@end table
@section h264_metadata
Modify metadata embedded in an H.264 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 of the stream in the VUI parameters.
@item video_format
@item video_full_range_flag
Set the video format in the stream (see H.264 section E.2.1 and
table E-2).
@item colour_primaries
@item transfer_characteristics
@item matrix_coefficients
Set the colour description in the stream (see H.264 section E.2.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.264 section
E.2.1 and figure E-1).
@item tick_rate
Set the tick rate (num_units_in_tick / time_scale) in the VUI
parameters. This is the smallest time unit representable in the
stream, and in many cases represents the field rate of the stream
(double the frame rate).
@item fixed_frame_rate_flag
Set whether the stream has fixed framerate - typically this indicates
that the framerate is exactly half the tick rate, but the exact
meaning is dependent on interlacing and the picture structure (see
H.264 section E.2.1 and table E-6).
@item crop_left
@item crop_right
@item crop_top
@item crop_bottom
Set the frame 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 or the stream is interlaced
(see H.264 section 7.4.2.1.1).
@item sei_user_data
Insert a string as SEI unregistered user data. The argument must
be of the form @emph{UUID+string}, where the UUID is as hex digits
possibly separated by hyphens, and the string can be anything.
For example, @samp{086f3693-b7b3-4f2c-9653-21492feee5b8+hello} will
insert the string ``hello'' associated with the given UUID.
@end table
@section h264_mp4toannexb
@section imx_dump_header
......
......@@ -776,6 +776,7 @@ OBJS-$(CONFIG_CHOMP_BSF) += chomp_bsf.o
OBJS-$(CONFIG_DUMP_EXTRADATA_BSF) += dump_extradata_bsf.o
OBJS-$(CONFIG_EXTRACT_EXTRADATA_BSF) += extract_extradata_bsf.o \
h2645_parse.o
OBJS-$(CONFIG_H264_METADATA_BSF) += h264_metadata_bsf.o
OBJS-$(CONFIG_H264_MP4TOANNEXB_BSF) += h264_mp4toannexb_bsf.o
OBJS-$(CONFIG_HEVC_MP4TOANNEXB_BSF) += hevc_mp4toannexb_bsf.o
OBJS-$(CONFIG_IMX_DUMP_HEADER_BSF) += imx_dump_header_bsf.o
......
......@@ -28,6 +28,7 @@ extern const AVBitStreamFilter ff_aac_adtstoasc_bsf;
extern const AVBitStreamFilter ff_chomp_bsf;
extern const AVBitStreamFilter ff_dump_extradata_bsf;
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_hevc_mp4toannexb_bsf;
extern const AVBitStreamFilter ff_imx_dump_header_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