Commit 320e537b authored by Matthieu Bouron's avatar Matthieu Bouron Committed by Michael Niedermayer

mxfenc: support 50 and 60 frame rates

Reviewed-by: 's avatarTomas Härdin <tomas.hardin@codemill.se>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent cc4d80c9
...@@ -44,8 +44,10 @@ ...@@ -44,8 +44,10 @@
#include "internal.h" #include "internal.h"
#include "mxf.h" #include "mxf.h"
static const int NTSC_samples_per_frame[] = { 1602, 1601, 1602, 1601, 1602, 0 }; 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_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; extern AVOutputFormat ff_mxf_d10_muxer;
...@@ -1423,10 +1425,18 @@ static int mxf_write_header(AVFormatContext *s) ...@@ -1423,10 +1425,18 @@ static int mxf_write_header(AVFormatContext *s)
samples_per_frame = PAL_samples_per_frame; samples_per_frame = PAL_samples_per_frame;
mxf->time_base = (AVRational){ 1, 25 }; mxf->time_base = (AVRational){ 1, 25 };
mxf->timecode_base = 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) { } else if (fabs(av_q2d(st->codec->time_base) - 1001/30000.0) < 0.0001) {
samples_per_frame = NTSC_samples_per_frame; samples_per_frame = NTSC_samples_per_frame;
mxf->time_base = (AVRational){ 1001, 30000 }; mxf->time_base = (AVRational){ 1001, 30000 };
mxf->timecode_base = 30; 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 { } else {
av_log(s, AV_LOG_ERROR, "unsupported video frame rate\n"); av_log(s, AV_LOG_ERROR, "unsupported video frame rate\n");
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment