2 * This file is part of FFmpeg.
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #include "libavutil/avstring.h"
20 #include "libavutil/display.h"
21 #include "libavutil/common.h"
22 #include "libavutil/opt.h"
28 #include "h264_levels.h"
48 typedef struct H264MetadataContext {
51 CodedBitstreamContext *cbc;
52 CodedBitstreamFragment access_unit;
58 AVRational sample_aspect_ratio;
61 int video_full_range_flag;
63 int transfer_characteristics;
64 int matrix_coefficients;
66 int chroma_sample_loc_type;
69 int fixed_frame_rate_flag;
76 const char *sei_user_data;
80 int display_orientation;
85 } H264MetadataContext;
88 static int h264_metadata_update_sps(AVBSFContext *bsf,
91 H264MetadataContext *ctx = bsf->priv_data;
93 int crop_unit_x, crop_unit_y;
95 if (ctx->sample_aspect_ratio.num && ctx->sample_aspect_ratio.den) {
97 static const AVRational sar_idc[] = {
98 { 0, 0 }, // Unspecified (never written here).
99 { 1, 1 }, { 12, 11 }, { 10, 11 }, { 16, 11 },
100 { 40, 33 }, { 24, 11 }, { 20, 11 }, { 32, 11 },
101 { 80, 33 }, { 18, 11 }, { 15, 11 }, { 64, 33 },
102 { 160, 99 }, { 4, 3 }, { 3, 2 }, { 2, 1 },
106 av_reduce(&num, &den, ctx->sample_aspect_ratio.num,
107 ctx->sample_aspect_ratio.den, 65535);
109 for (i = 1; i < FF_ARRAY_ELEMS(sar_idc); i++) {
110 if (num == sar_idc[i].num &&
111 den == sar_idc[i].den)
114 if (i == FF_ARRAY_ELEMS(sar_idc)) {
115 sps->vui.aspect_ratio_idc = 255;
116 sps->vui.sar_width = num;
117 sps->vui.sar_height = den;
119 sps->vui.aspect_ratio_idc = i;
121 sps->vui.aspect_ratio_info_present_flag = 1;
125 #define SET_VUI_FIELD(field) do { \
126 if (ctx->field >= 0) { \
127 sps->vui.field = ctx->field; \
132 if (ctx->video_format >= 0 ||
133 ctx->video_full_range_flag >= 0 ||
134 ctx->colour_primaries >= 0 ||
135 ctx->transfer_characteristics >= 0 ||
136 ctx->matrix_coefficients >= 0) {
138 SET_VUI_FIELD(video_format);
140 SET_VUI_FIELD(video_full_range_flag);
142 if (ctx->colour_primaries >= 0 ||
143 ctx->transfer_characteristics >= 0 ||
144 ctx->matrix_coefficients >= 0) {
146 SET_VUI_FIELD(colour_primaries);
147 SET_VUI_FIELD(transfer_characteristics);
148 SET_VUI_FIELD(matrix_coefficients);
150 sps->vui.colour_description_present_flag = 1;
152 sps->vui.video_signal_type_present_flag = 1;
155 if (ctx->chroma_sample_loc_type >= 0) {
156 sps->vui.chroma_sample_loc_type_top_field =
157 ctx->chroma_sample_loc_type;
158 sps->vui.chroma_sample_loc_type_bottom_field =
159 ctx->chroma_sample_loc_type;
160 sps->vui.chroma_loc_info_present_flag = 1;
164 if (ctx->tick_rate.num && ctx->tick_rate.den) {
167 av_reduce(&num, &den, ctx->tick_rate.num, ctx->tick_rate.den,
168 UINT32_MAX > INT_MAX ? UINT32_MAX : INT_MAX);
170 sps->vui.time_scale = num;
171 sps->vui.num_units_in_tick = den;
173 sps->vui.timing_info_present_flag = 1;
176 SET_VUI_FIELD(fixed_frame_rate_flag);
178 if (sps->separate_colour_plane_flag || sps->chroma_format_idc == 0) {
180 crop_unit_y = 2 - sps->frame_mbs_only_flag;
182 crop_unit_x = 1 + (sps->chroma_format_idc < 3);
183 crop_unit_y = (1 + (sps->chroma_format_idc < 2)) *
184 (2 - sps->frame_mbs_only_flag);
186 #define CROP(border, unit) do { \
187 if (ctx->crop_ ## border >= 0) { \
188 if (ctx->crop_ ## border % unit != 0) { \
189 av_log(bsf, AV_LOG_ERROR, "Invalid value for crop_%s: " \
190 "must be a multiple of %d.\n", #border, unit); \
191 return AVERROR(EINVAL); \
193 sps->frame_crop_ ## border ## _offset = \
194 ctx->crop_ ## border / unit; \
195 sps->frame_cropping_flag = 1; \
198 CROP(left, crop_unit_x);
199 CROP(right, crop_unit_x);
200 CROP(top, crop_unit_y);
201 CROP(bottom, crop_unit_y);
204 if (ctx->level != LEVEL_UNSET) {
207 if (ctx->level == LEVEL_AUTO) {
208 const H264LevelDescriptor *desc;
210 int width, height, dpb_frames;
213 if (sps->vui.nal_hrd_parameters_present_flag) {
214 bit_rate = (sps->vui.nal_hrd_parameters.bit_rate_value_minus1[0] + 1) *
215 (INT64_C(1) << (sps->vui.nal_hrd_parameters.bit_rate_scale + 6));
216 } else if (sps->vui.vcl_hrd_parameters_present_flag) {
217 bit_rate = (sps->vui.vcl_hrd_parameters.bit_rate_value_minus1[0] + 1) *
218 (INT64_C(1) << (sps->vui.vcl_hrd_parameters.bit_rate_scale + 6));
219 // Adjust for VCL vs. NAL limits.
220 bit_rate = bit_rate * 6 / 5;
225 // Don't use max_dec_frame_buffering if it is only inferred.
226 dpb_frames = sps->vui.bitstream_restriction_flag ?
227 sps->vui.max_dec_frame_buffering : H264_MAX_DPB_FRAMES;
229 width = 16 * (sps->pic_width_in_mbs_minus1 + 1);
230 height = 16 * (sps->pic_height_in_map_units_minus1 + 1) *
231 (2 - sps->frame_mbs_only_flag);
233 if (sps->vui.timing_info_present_flag)
234 framerate = sps->vui.time_scale / sps->vui.num_units_in_tick / 2;
238 desc = ff_h264_guess_level(sps->profile_idc, bit_rate, framerate,
239 width, height, dpb_frames);
241 level_idc = desc->level_idc;
243 av_log(bsf, AV_LOG_WARNING, "Stream does not appear to "
244 "conform to any level: using level 6.2.\n");
248 level_idc = ctx->level;
251 if (level_idc == 9) {
252 if (sps->profile_idc == 66 ||
253 sps->profile_idc == 77 ||
254 sps->profile_idc == 88) {
256 sps->constraint_set3_flag = 1;
261 sps->level_idc = level_idc;
266 sps->vui_parameters_present_flag = 1;
271 static int h264_metadata_filter(AVBSFContext *bsf, AVPacket *pkt)
273 H264MetadataContext *ctx = bsf->priv_data;
274 CodedBitstreamFragment *au = &ctx->access_unit;
275 int err, i, j, has_sps;
278 err = ff_bsf_get_packet_ref(bsf, pkt);
282 err = ff_cbs_read_packet(ctx->cbc, au, pkt);
284 av_log(bsf, AV_LOG_ERROR, "Failed to read packet.\n");
288 if (au->nb_units == 0) {
289 av_log(bsf, AV_LOG_ERROR, "No NAL units in packet.\n");
290 err = AVERROR_INVALIDDATA;
294 // If an AUD is present, it must be the first NAL unit.
295 if (au->units[0].type == H264_NAL_AUD) {
296 if (ctx->aud == REMOVE)
297 ff_cbs_delete_unit(ctx->cbc, au, 0);
299 if (ctx->aud == INSERT) {
300 static const int primary_pic_type_table[] = {
303 0x0e7, // 0, 1, 2, 5, 6, 7
307 0x3bd, // 0, 2, 3, 4, 5, 7, 8, 9
308 0x3ff, // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
310 int primary_pic_type_mask = 0xff;
312 for (i = 0; i < au->nb_units; i++) {
313 if (au->units[i].type == H264_NAL_SLICE ||
314 au->units[i].type == H264_NAL_IDR_SLICE) {
315 H264RawSlice *slice = au->units[i].content;
316 for (j = 0; j < FF_ARRAY_ELEMS(primary_pic_type_table); j++) {
317 if (!(primary_pic_type_table[j] &
318 (1 << slice->header.slice_type)))
319 primary_pic_type_mask &= ~(1 << j);
323 for (j = 0; j < FF_ARRAY_ELEMS(primary_pic_type_table); j++)
324 if (primary_pic_type_mask & (1 << j))
326 if (j >= FF_ARRAY_ELEMS(primary_pic_type_table)) {
327 av_log(bsf, AV_LOG_ERROR, "No usable primary_pic_type: "
328 "invalid slice types?\n");
329 err = AVERROR_INVALIDDATA;
334 .nal_unit_header.nal_unit_type = H264_NAL_AUD,
335 .primary_pic_type = j,
338 err = ff_cbs_insert_unit_content(ctx->cbc, au,
339 0, H264_NAL_AUD, &aud, NULL);
341 av_log(bsf, AV_LOG_ERROR, "Failed to insert AUD.\n");
348 for (i = 0; i < au->nb_units; i++) {
349 if (au->units[i].type == H264_NAL_SPS) {
350 err = h264_metadata_update_sps(bsf, au->units[i].content);
357 // Only insert the SEI in access units containing SPSs, and also
358 // unconditionally in the first access unit we ever see.
359 if (ctx->sei_user_data && (has_sps || !ctx->done_first_au)) {
360 H264RawSEIPayload payload = {
361 .payload_type = H264_SEI_TYPE_USER_DATA_UNREGISTERED,
363 H264RawSEIUserDataUnregistered *udu =
364 &payload.payload.user_data_unregistered;
366 for (i = j = 0; j < 32 && ctx->sei_user_data[i]; i++) {
368 c = ctx->sei_user_data[i];
371 } else if (av_isxdigit(c)) {
373 v = (c <= '9' ? c - '0' : c - 'a' + 10);
375 goto invalid_user_data;
378 udu->uuid_iso_iec_11578[j / 2] |= v;
380 udu->uuid_iso_iec_11578[j / 2] = v << 4;
383 if (j == 32 && ctx->sei_user_data[i] == '+') {
384 size_t len = strlen(ctx->sei_user_data + i + 1);
386 udu->data_ref = av_buffer_alloc(len + 1);
387 if (!udu->data_ref) {
388 err = AVERROR(ENOMEM);
392 udu->data = udu->data_ref->data;
393 udu->data_length = len + 1;
394 memcpy(udu->data, ctx->sei_user_data + i + 1, len + 1);
396 err = ff_cbs_h264_add_sei_message(ctx->cbc, au, &payload);
398 av_log(bsf, AV_LOG_ERROR, "Failed to add user data SEI "
399 "message to access unit.\n");
405 av_log(bsf, AV_LOG_ERROR, "Invalid user data: "
406 "must be \"UUID+string\".\n");
407 err = AVERROR(EINVAL);
412 if (ctx->delete_filler) {
413 for (i = au->nb_units - 1; i >= 0; i--) {
414 if (au->units[i].type == H264_NAL_FILLER_DATA) {
415 ff_cbs_delete_unit(ctx->cbc, au, i);
419 if (au->units[i].type == H264_NAL_SEI) {
420 // Filler SEI messages.
421 H264RawSEI *sei = au->units[i].content;
423 for (j = sei->payload_count - 1; j >= 0; j--) {
424 if (sei->payload[j].payload_type ==
425 H264_SEI_TYPE_FILLER_PAYLOAD)
426 ff_cbs_h264_delete_sei_message(ctx->cbc, au,
433 if (ctx->display_orientation != PASS) {
434 for (i = au->nb_units - 1; i >= 0; i--) {
436 if (au->units[i].type != H264_NAL_SEI)
438 sei = au->units[i].content;
440 for (j = sei->payload_count - 1; j >= 0; j--) {
441 H264RawSEIDisplayOrientation *disp;
444 if (sei->payload[j].payload_type !=
445 H264_SEI_TYPE_DISPLAY_ORIENTATION)
447 disp = &sei->payload[j].payload.display_orientation;
449 if (ctx->display_orientation == REMOVE ||
450 ctx->display_orientation == INSERT) {
451 ff_cbs_h264_delete_sei_message(ctx->cbc, au,
456 matrix = av_malloc(9 * sizeof(int32_t));
458 err = AVERROR(ENOMEM);
462 av_display_rotation_set(matrix,
463 disp->anticlockwise_rotation *
465 av_display_matrix_flip(matrix, disp->hor_flip, disp->ver_flip);
467 // If there are multiple display orientation messages in an
468 // access unit, then the last one added to the packet (i.e.
469 // the first one in the access unit) will prevail.
470 err = av_packet_add_side_data(pkt, AV_PKT_DATA_DISPLAYMATRIX,
472 9 * sizeof(int32_t));
474 av_log(bsf, AV_LOG_ERROR, "Failed to attach extracted "
475 "displaymatrix side data to packet.\n");
482 if (ctx->display_orientation == INSERT) {
483 H264RawSEIPayload payload = {
484 .payload_type = H264_SEI_TYPE_DISPLAY_ORIENTATION,
486 H264RawSEIDisplayOrientation *disp =
487 &payload.payload.display_orientation;
492 data = av_packet_get_side_data(pkt, AV_PKT_DATA_DISPLAYMATRIX, &size);
493 if (data && size >= 9 * sizeof(int32_t)) {
498 memcpy(matrix, data, sizeof(matrix));
501 if (matrix[0] < 0 && matrix[4] > 0)
503 else if (matrix[0] > 0 && matrix[4] < 0)
505 av_display_matrix_flip(matrix, hflip, vflip);
507 angle = av_display_rotation_get(matrix);
509 if (!(angle >= -180.0 && angle <= 180.0 /* also excludes NaN */) ||
510 matrix[2] != 0 || matrix[5] != 0 ||
511 matrix[6] != 0 || matrix[7] != 0) {
512 av_log(bsf, AV_LOG_WARNING, "Input display matrix is not "
513 "representable in H.264 parameters.\n");
515 disp->hor_flip = hflip;
516 disp->ver_flip = vflip;
517 disp->anticlockwise_rotation =
518 (uint16_t)rint((angle >= 0.0 ? angle
525 if (has_sps || !ctx->done_first_au) {
526 if (!isnan(ctx->rotate)) {
527 disp->anticlockwise_rotation =
528 (uint16_t)rint((ctx->rotate >= 0.0 ? ctx->rotate
529 : ctx->rotate + 360.0) *
534 disp->hor_flip = !!(ctx->flip & FLIP_HORIZONTAL);
535 disp->ver_flip = !!(ctx->flip & FLIP_VERTICAL);
541 disp->display_orientation_repetition_period = 1;
543 err = ff_cbs_h264_add_sei_message(ctx->cbc, au, &payload);
545 av_log(bsf, AV_LOG_ERROR, "Failed to add display orientation "
546 "SEI message to access unit.\n");
552 err = ff_cbs_write_packet(ctx->cbc, pkt, au);
554 av_log(bsf, AV_LOG_ERROR, "Failed to write packet.\n");
558 ctx->done_first_au = 1;
562 ff_cbs_fragment_reset(ctx->cbc, au);
565 av_packet_unref(pkt);
570 static int h264_metadata_init(AVBSFContext *bsf)
572 H264MetadataContext *ctx = bsf->priv_data;
573 CodedBitstreamFragment *au = &ctx->access_unit;
576 err = ff_cbs_init(&ctx->cbc, AV_CODEC_ID_H264, bsf);
580 if (bsf->par_in->extradata) {
581 err = ff_cbs_read_extradata(ctx->cbc, au, bsf->par_in);
583 av_log(bsf, AV_LOG_ERROR, "Failed to read extradata.\n");
587 for (i = 0; i < au->nb_units; i++) {
588 if (au->units[i].type == H264_NAL_SPS) {
589 err = h264_metadata_update_sps(bsf, au->units[i].content);
595 err = ff_cbs_write_extradata(ctx->cbc, bsf->par_out, au);
597 av_log(bsf, AV_LOG_ERROR, "Failed to write extradata.\n");
604 ff_cbs_fragment_reset(ctx->cbc, au);
608 static void h264_metadata_close(AVBSFContext *bsf)
610 H264MetadataContext *ctx = bsf->priv_data;
612 ff_cbs_fragment_free(ctx->cbc, &ctx->access_unit);
613 ff_cbs_close(&ctx->cbc);
616 #define OFFSET(x) offsetof(H264MetadataContext, x)
617 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM)
618 static const AVOption h264_metadata_options[] = {
619 { "aud", "Access Unit Delimiter NAL units",
620 OFFSET(aud), AV_OPT_TYPE_INT,
621 { .i64 = PASS }, PASS, REMOVE, FLAGS, "aud" },
622 { "pass", NULL, 0, AV_OPT_TYPE_CONST,
623 { .i64 = PASS }, .flags = FLAGS, .unit = "aud" },
624 { "insert", NULL, 0, AV_OPT_TYPE_CONST,
625 { .i64 = INSERT }, .flags = FLAGS, .unit = "aud" },
626 { "remove", NULL, 0, AV_OPT_TYPE_CONST,
627 { .i64 = REMOVE }, .flags = FLAGS, .unit = "aud" },
629 { "sample_aspect_ratio", "Set sample aspect ratio (table E-1)",
630 OFFSET(sample_aspect_ratio), AV_OPT_TYPE_RATIONAL,
631 { .dbl = 0.0 }, 0, 65535, FLAGS },
633 { "video_format", "Set video format (table E-2)",
634 OFFSET(video_format), AV_OPT_TYPE_INT,
635 { .i64 = -1 }, -1, 7, FLAGS},
636 { "video_full_range_flag", "Set video full range flag",
637 OFFSET(video_full_range_flag), AV_OPT_TYPE_INT,
638 { .i64 = -1 }, -1, 1, FLAGS },
639 { "colour_primaries", "Set colour primaries (table E-3)",
640 OFFSET(colour_primaries), AV_OPT_TYPE_INT,
641 { .i64 = -1 }, -1, 255, FLAGS },
642 { "transfer_characteristics", "Set transfer characteristics (table E-4)",
643 OFFSET(transfer_characteristics), AV_OPT_TYPE_INT,
644 { .i64 = -1 }, -1, 255, FLAGS },
645 { "matrix_coefficients", "Set matrix coefficients (table E-5)",
646 OFFSET(matrix_coefficients), AV_OPT_TYPE_INT,
647 { .i64 = -1 }, -1, 255, FLAGS },
649 { "chroma_sample_loc_type", "Set chroma sample location type (figure E-1)",
650 OFFSET(chroma_sample_loc_type), AV_OPT_TYPE_INT,
651 { .i64 = -1 }, -1, 6, FLAGS },
653 { "tick_rate", "Set VUI tick rate (num_units_in_tick / time_scale)",
654 OFFSET(tick_rate), AV_OPT_TYPE_RATIONAL,
655 { .dbl = 0.0 }, 0, UINT_MAX, FLAGS },
656 { "fixed_frame_rate_flag", "Set VUI fixed frame rate flag",
657 OFFSET(fixed_frame_rate_flag), AV_OPT_TYPE_INT,
658 { .i64 = -1 }, -1, 1, FLAGS },
660 { "crop_left", "Set left border crop offset",
661 OFFSET(crop_left), AV_OPT_TYPE_INT,
662 { .i64 = -1 }, -1, H264_MAX_WIDTH, FLAGS },
663 { "crop_right", "Set right border crop offset",
664 OFFSET(crop_right), AV_OPT_TYPE_INT,
665 { .i64 = -1 }, -1, H264_MAX_WIDTH, FLAGS },
666 { "crop_top", "Set top border crop offset",
667 OFFSET(crop_top), AV_OPT_TYPE_INT,
668 { .i64 = -1 }, -1, H264_MAX_HEIGHT, FLAGS },
669 { "crop_bottom", "Set bottom border crop offset",
670 OFFSET(crop_bottom), AV_OPT_TYPE_INT,
671 { .i64 = -1 }, -1, H264_MAX_HEIGHT, FLAGS },
673 { "sei_user_data", "Insert SEI user data (UUID+string)",
674 OFFSET(sei_user_data), AV_OPT_TYPE_STRING, { .str = NULL }, .flags = FLAGS },
676 { "delete_filler", "Delete all filler (both NAL and SEI)",
677 OFFSET(delete_filler), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS},
679 { "display_orientation", "Display orientation SEI",
680 OFFSET(display_orientation), AV_OPT_TYPE_INT,
681 { .i64 = PASS }, PASS, EXTRACT, FLAGS, "disp_or" },
682 { "pass", NULL, 0, AV_OPT_TYPE_CONST,
683 { .i64 = PASS }, .flags = FLAGS, .unit = "disp_or" },
684 { "insert", NULL, 0, AV_OPT_TYPE_CONST,
685 { .i64 = INSERT }, .flags = FLAGS, .unit = "disp_or" },
686 { "remove", NULL, 0, AV_OPT_TYPE_CONST,
687 { .i64 = REMOVE }, .flags = FLAGS, .unit = "disp_or" },
688 { "extract", NULL, 0, AV_OPT_TYPE_CONST,
689 { .i64 = EXTRACT }, .flags = FLAGS, .unit = "disp_or" },
691 { "rotate", "Set rotation in display orientation SEI (anticlockwise angle in degrees)",
692 OFFSET(rotate), AV_OPT_TYPE_DOUBLE,
693 { .dbl = NAN }, -360.0, +360.0, FLAGS },
694 { "flip", "Set flip in display orientation SEI",
695 OFFSET(flip), AV_OPT_TYPE_FLAGS,
696 { .i64 = 0 }, 0, FLIP_HORIZONTAL | FLIP_VERTICAL, FLAGS, "flip" },
697 { "horizontal", "Set hor_flip",
698 0, AV_OPT_TYPE_CONST,
699 { .i64 = FLIP_HORIZONTAL }, .flags = FLAGS, .unit = "flip" },
700 { "vertical", "Set ver_flip",
701 0, AV_OPT_TYPE_CONST,
702 { .i64 = FLIP_VERTICAL }, .flags = FLAGS, .unit = "flip" },
704 { "level", "Set level (table A-1)",
705 OFFSET(level), AV_OPT_TYPE_INT,
706 { .i64 = LEVEL_UNSET }, LEVEL_UNSET, 0xff, FLAGS, "level" },
707 { "auto", "Attempt to guess level from stream properties",
708 0, AV_OPT_TYPE_CONST,
709 { .i64 = LEVEL_AUTO }, .flags = FLAGS, .unit = "level" },
710 #define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \
711 { .i64 = value }, .flags = FLAGS, .unit = "level"
714 { LEVEL("1.1", 11) },
715 { LEVEL("1.2", 12) },
716 { LEVEL("1.3", 13) },
718 { LEVEL("2.1", 21) },
719 { LEVEL("2.2", 22) },
721 { LEVEL("3.1", 31) },
722 { LEVEL("3.2", 32) },
724 { LEVEL("4.1", 41) },
725 { LEVEL("4.2", 42) },
727 { LEVEL("5.1", 51) },
728 { LEVEL("5.2", 52) },
730 { LEVEL("6.1", 61) },
731 { LEVEL("6.2", 62) },
737 static const AVClass h264_metadata_class = {
738 .class_name = "h264_metadata_bsf",
739 .item_name = av_default_item_name,
740 .option = h264_metadata_options,
741 .version = LIBAVUTIL_VERSION_INT,
744 static const enum AVCodecID h264_metadata_codec_ids[] = {
745 AV_CODEC_ID_H264, AV_CODEC_ID_NONE,
748 const AVBitStreamFilter ff_h264_metadata_bsf = {
749 .name = "h264_metadata",
750 .priv_data_size = sizeof(H264MetadataContext),
751 .priv_class = &h264_metadata_class,
752 .init = &h264_metadata_init,
753 .close = &h264_metadata_close,
754 .filter = &h264_metadata_filter,
755 .codec_ids = h264_metadata_codec_ids,