[FFmpeg-devel] [PATCH 6/7] ffmpeg: use the frame rate computed by lavfi.

Nicolas George nicolas.george at normalesup.org
Tue Jun 5 13:23:06 CEST 2012


This frame rate is more reliable than the one copied
from the input stream, so it is used in priority.

Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 ffmpeg.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/ffmpeg.c b/ffmpeg.c
index c761f71..d92fe2e 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3062,6 +3062,8 @@ static int transcode_init(void)
             ost->encoding_needed = 1;
 
             if (codec->codec_type == AVMEDIA_TYPE_VIDEO) {
+                if (ost->filter && !ost->frame_rate.num)
+                    ost->frame_rate = av_buffersink_get_frame_rate(ost->filter->filter);
                 if (ist && !ost->frame_rate.num)
                     ost->frame_rate = ist->st->r_frame_rate.num ? ist->st->r_frame_rate : (AVRational){25, 1};
                 if (ost->enc && ost->enc->supported_framerates && !ost->force_fps) {
-- 
1.7.10



More information about the ffmpeg-devel mailing list