summaryrefslogtreecommitdiff
path: root/libavformat/mxfenc.c
diff options
context:
space:
mode:
authorMatthieu Bouron <matthieu.bouron@gmail.com>2012-05-26 18:09:07 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-31 16:55:37 +0200
commit320e537baf241ccfa5187f2c7cdd758e74d88d4d (patch)
tree3671d0c839e29e34e2831331b8d3482d7c0c4b73 /libavformat/mxfenc.c
parentcc4d80c99ff3169b71c62691d5c7602ef673c3dc (diff)
mxfenc: support 50 and 60 frame rates
Reviewed-by: Tomas Härdin <tomas.hardin@codemill.se> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mxfenc.c')
-rw-r--r--libavformat/mxfenc.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index b2ef1f3dbd..f87a50a80b 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -44,8 +44,10 @@
#include "internal.h"
#include "mxf.h"
-static const int NTSC_samples_per_frame[] = { 1602, 1601, 1602, 1601, 1602, 0 };
-static const int PAL_samples_per_frame[] = { 1920, 0 };
+static const int NTSC_samples_per_frame[] = { 1602, 1601, 1602, 1601, 1602, 0 };
+static const int NTSC_60_samples_per_frame[] = { 801, 801, 801, 801, 800, 0 };
+static const int PAL_samples_per_frame[] = { 1920, 0 };
+static const int PAL_50_samples_per_frame[] = { 960, 0 };
extern AVOutputFormat ff_mxf_d10_muxer;
@@ -1423,10 +1425,18 @@ static int mxf_write_header(AVFormatContext *s)
samples_per_frame = PAL_samples_per_frame;
mxf->time_base = (AVRational){ 1, 25 };
mxf->timecode_base = 25;
+ } else if (fabs(av_q2d(st->codec->time_base) - 1/50.0) < 0.0001) {
+ samples_per_frame = PAL_50_samples_per_frame;
+ mxf->time_base = (AVRational){ 1, 50 };
+ mxf->timecode_base = 50;
} else if (fabs(av_q2d(st->codec->time_base) - 1001/30000.0) < 0.0001) {
samples_per_frame = NTSC_samples_per_frame;
mxf->time_base = (AVRational){ 1001, 30000 };
mxf->timecode_base = 30;
+ } else if (fabs(av_q2d(st->codec->time_base) - 1001/60000.0) < 0.0001) {
+ samples_per_frame = NTSC_60_samples_per_frame;
+ mxf->time_base = (AVRational){ 1001, 60000 };
+ mxf->timecode_base = 60;
} else {
av_log(s, AV_LOG_ERROR, "unsupported video frame rate\n");
return -1;