diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2019-08-26 13:15:32 -0700 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2019-11-13 08:53:27 -0800 |
commit | 11a38be99cd0c6685a65940cf0c9114d338235a3 (patch) | |
tree | bd662ee8469e888dc6878648217dae3eb4eb8df9 | |
parent | 45f03cdd20c3f9a83d4955fa32ffdc287229ccfd (diff) | |
download | ffmpeg-11a38be99cd0c6685a65940cf0c9114d338235a3.tar.gz |
avformat/mxfenc: correctly set width values for dvcprohd
-rw-r--r-- | libavformat/mxfenc.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index aa23ee3947..a76be64c5c 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -1190,7 +1190,7 @@ static int64_t mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID { MXFStreamContext *sc = st->priv_data; AVIOContext *pb = s->pb; - int stored_width = (st->codecpar->width +15)/16*16; + int stored_width = 0; int stored_height = (st->codecpar->height+15)/16*16; int display_height; int f1, f2; @@ -1199,6 +1199,15 @@ static int64_t mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID get_trc(transfer_ul, st->codecpar->color_trc); + if (st->codecpar->codec_id == AV_CODEC_ID_DVVIDEO) { + if (st->codecpar->height == 1080) + stored_width = 1920; + else if (st->codecpar->height == 720) + stored_width = 1280; + } + if (!stored_width) + stored_width = (st->codecpar->width+15)/16*16; + mxf_write_local_tag(pb, 4, 0x3203); avio_wb32(pb, stored_width); @@ -1221,7 +1230,7 @@ static int64_t mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID //Sampled width mxf_write_local_tag(pb, 4, 0x3205); - avio_wb32(pb, st->codecpar->width); + avio_wb32(pb, stored_width); //Samples height mxf_write_local_tag(pb, 4, 0x3204); @@ -1236,7 +1245,7 @@ static int64_t mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID avio_wb32(pb, 0); mxf_write_local_tag(pb, 4, 0x3209); - avio_wb32(pb, st->codecpar->width); + avio_wb32(pb, stored_width); if (st->codecpar->height == 608) // PAL + VBI display_height = 576; |