| @@ -348,12 +348,13 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s) · 347 unmodified lines |
| 348 | 348 | height != s->height || |
| 349 | 349 | s->avctx->color_primaries != AVCOL_PRI_UNSPECIFIED || |
| 350 | 350 | s->avctx->color_trc != AVCOL_TRC_UNSPECIFIED || |
| 351 | | − s->avctx->colorspace != AVCOL_SPC_UNSPECIFIED); |
| 351 | + s->avctx->colorspace != AVCOL_SPC_UNSPECIFIED || |
| 352 | + s->video_format != VIDEO_FORMAT_UNSPECIFIED); |
| 352 | 353 | |
| 353 | 354 | if (s->seq_disp_ext == 1 || (s->seq_disp_ext == -1 && use_seq_disp_ext)) { |
| 354 | 355 | put_header(s, EXT_START_CODE); |
| 355 | 356 | put_bits(&s->pb, 4, 2); // sequence display extension |
| 356 | | − put_bits(&s->pb, 3, 5); // video_format: 5 is unspecified |
| 357 | + put_bits(&s->pb, 3, s->video_format); // video_format |
| 357 | 358 | put_bits(&s->pb, 1, 1); // colour_description |
| 358 | 359 | put_bits(&s->pb, 8, s->avctx->color_primaries); // colour_primaries |
| 359 | 360 | put_bits(&s->pb, 8, s->avctx->color_trc); // transfer_characteristics |
| @@ -1125,6 +1126,13 @@ static const AVOption mpeg2_options[] = { · 765 unmodified lines |
| 1125 | 1126 | { "auto", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = -1}, 0, 0, VE, "seq_disp_ext" }, |
| 1126 | 1127 | { "never", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, 0, 0, VE, "seq_disp_ext" }, |
| 1127 | 1128 | { "always", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 1 }, 0, 0, VE, "seq_disp_ext" }, |
| 1129 | + { "video_format", "Video_format in the sequence_display_extension indicating the source of the video.", OFFSET(video_format), AV_OPT_TYPE_INT, { .i64 = VIDEO_FORMAT_UNSPECIFIED }, 0, 7, VE, "video_format" }, |
| 1130 | + { "component", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = VIDEO_FORMAT_COMPONENT }, 0, 0, VE, "video_format" }, |
| 1131 | + { "pal", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = VIDEO_FORMAT_PAL }, 0, 0, VE, "video_format" }, |
| 1132 | + { "ntsc", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = VIDEO_FORMAT_NTSC }, 0, 0, VE, "video_format" }, |
| 1133 | + { "secam", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = VIDEO_FORMAT_SECAM }, 0, 0, VE, "video_format" }, |
| 1134 | + { "mac", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = VIDEO_FORMAT_MAC }, 0, 0, VE, "video_format" }, |
| 1135 | + { "unspecified", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = VIDEO_FORMAT_UNSPECIFIED}, 0, 0, VE, "video_format" }, |
| 1128 | 1136 | FF_MPV_COMMON_OPTS |
| 1129 | 1137 | { NULL }, |
| 1130 | 1138 | }; |