diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2011-03-01 23:54:29 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-03-03 14:15:09 +0100 |
commit | cd37308b7774db3fd52ae079844ab0ac8e31fb7d (patch) | |
tree | f76b9e644e1dd1336fb804c94d6b8d0d4f8e1a4b /libavformat/movenc.c | |
parent | 176e176288ef597852072c2c01c5b4b5520aaba1 (diff) | |
download | ffmpeg-cd37308b7774db3fd52ae079844ab0ac8e31fb7d.tar.gz |
movenc: use correct tag for dvcpro hd
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 06ed4873e6e6aed8ec7cc24285d610ef4060880e)
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index f3a4a9686d..900d23209f 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -624,12 +624,23 @@ static int mov_get_dv_codec_tag(AVFormatContext *s, MOVTrack *track) { int tag; - if (track->enc->height == 480) /* NTSC */ - if (track->enc->pix_fmt == PIX_FMT_YUV422P) tag = MKTAG('d','v','5','n'); - else tag = MKTAG('d','v','c',' '); - else if (track->enc->pix_fmt == PIX_FMT_YUV422P) tag = MKTAG('d','v','5','p'); - else if (track->enc->pix_fmt == PIX_FMT_YUV420P) tag = MKTAG('d','v','c','p'); - else tag = MKTAG('d','v','p','p'); + if (track->enc->width == 720) /* SD */ + if (track->enc->height == 480) /* NTSC */ + if (track->enc->pix_fmt == PIX_FMT_YUV422P) tag = MKTAG('d','v','5','n'); + else tag = MKTAG('d','v','c',' '); + else if (track->enc->pix_fmt == PIX_FMT_YUV422P) tag = MKTAG('d','v','5','p'); + else if (track->enc->pix_fmt == PIX_FMT_YUV420P) tag = MKTAG('d','v','c','p'); + else tag = MKTAG('d','v','p','p'); + else if (track->enc->height == 720) /* HD 720 line */ + if (track->enc->time_base.den == 50) tag = MKTAG('d','v','h','q'); + else tag = MKTAG('d','v','h','p'); + else if (track->enc->height == 1080) /* HD 1080 line */ + if (track->enc->time_base.den == 25) tag = MKTAG('d','v','h','5'); + else tag = MKTAG('d','v','h','6'); + else { + av_log(s, AV_LOG_ERROR, "unsupported height for dv codec\n"); + return 0; + } return tag; } |