OSDN Git Service

avconv: prefer user-forced input framerate when choosing output framerate
authorAnton Khirnov <anton@khirnov.net>
Fri, 24 Aug 2012 15:42:46 +0000 (17:42 +0200)
committerAnton Khirnov <anton@khirnov.net>
Sun, 26 Aug 2012 05:50:06 +0000 (07:50 +0200)
avconv.c

index 735fc3e..592e9a8 100644 (file)
--- a/avconv.c
+++ b/avconv.c
@@ -1682,7 +1682,11 @@ static int transcode_init(void)
                 (video_sync_method ==  VSYNC_CFR ||
                  (video_sync_method ==  VSYNC_AUTO &&
                   !(oc->oformat->flags & (AVFMT_NOTIMESTAMPS | AVFMT_VARIABLE_FPS))))) {
-                ost->frame_rate = ist->st->avg_frame_rate.num ? ist->st->avg_frame_rate : (AVRational){25, 1};
+                ost->frame_rate = ist->framerate.num ? ist->framerate :
+                                  ist->st->avg_frame_rate.num ?
+                                  ist->st->avg_frame_rate :
+                                  (AVRational){25, 1};
+
                 if (ost->enc && ost->enc->supported_framerates && !ost->force_fps) {
                     int idx = av_find_nearest_q_idx(ost->frame_rate, ost->enc->supported_framerates);
                     ost->frame_rate = ost->enc->supported_framerates[idx];