[FFmpeg-cvslog] ffmpeg: use framerate not fieldrate as filter input.

Michael Niedermayer git at videolan.org
Mon Oct 15 00:45:04 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Oct 15 00:14:43 2012 +0200| [1b8f4d773c4d3bfcff9cdbc26200afbbaa445bc3] | committer: Michael Niedermayer

ffmpeg: use framerate not fieldrate as filter input.

Fixes a problem described in Ticket1065

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1b8f4d773c4d3bfcff9cdbc26200afbbaa445bc3
---

 ffmpeg_filter.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c
index 436cdf2..d0f25d8 100644
--- a/ffmpeg_filter.c
+++ b/ffmpeg_filter.c
@@ -558,6 +558,13 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
     int pad_idx = in->pad_idx;
     int ret;
 
+    if (!ist->framerate.num) {
+        AVRational codec_fr = av_inv_q(ist->st->codec->time_base);
+        codec_fr.den *= ist->st->codec->ticks_per_frame;
+        if(av_q2d(codec_fr) < av_q2d(fr)*0.7)
+            fr = codec_fr;
+    }
+
     if (ist->st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
         ret = sub2video_prepare(ist);
         if (ret < 0)



More information about the ffmpeg-cvslog mailing list