]> git.sesse.net Git - ffmpeg/blobdiff - ffmpeg.c
Merge commit '61e7c7f27b0a2652bf5cd282b97762ee99d025ef'
[ffmpeg] / ffmpeg.c
index caed594638b68b78fa852d1fb733d0d928c4efbb..1369fdaf646f7560d2184b72fadacef16509e3bc 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1396,6 +1396,7 @@ static void flush_encoders(void)
 
             if (encode) {
                 AVPacket pkt;
+                int pkt_size;
                 int got_packet;
                 av_init_packet(&pkt);
                 pkt.data = NULL;
@@ -1426,9 +1427,10 @@ static void flush_encoders(void)
                     pkt.dts = av_rescale_q(pkt.dts, enc->time_base, ost->st->time_base);
                 if (pkt.duration > 0)
                     pkt.duration = av_rescale_q(pkt.duration, enc->time_base, ost->st->time_base);
+                pkt_size = pkt.size;
                 write_frame(os, &pkt, ost);
                 if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && vstats_filename) {
-                    do_video_stats(ost, pkt.size);
+                    do_video_stats(ost, pkt_size);
                 }
             }
 
@@ -2506,6 +2508,10 @@ static int transcode_init(void)
                     int idx = av_find_nearest_q_idx(ost->frame_rate, ost->enc->supported_framerates);
                     ost->frame_rate = ost->enc->supported_framerates[idx];
                 }
+                if (codec->codec_id == AV_CODEC_ID_MPEG4) {
+                    av_reduce(&ost->frame_rate.num, &ost->frame_rate.den,
+                              ost->frame_rate.num, ost->frame_rate.den, 65535);
+                }
             }
 
             switch (codec->codec_type) {