[FFmpeg-cvslog] avienc: force a valid timebase for video

Michael Niedermayer git at videolan.org
Thu Nov 1 20:28:05 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Nov  1 19:54:47 2012 +0100| [bacebe1f952d9192338a0682a0e48fbb4c88e450] | committer: Michael Niedermayer

avienc: force a valid timebase for video

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

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

 libavformat/avienc.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavformat/avienc.c b/libavformat/avienc.c
index ce5f85d..bd7bcef 100644
--- a/libavformat/avienc.c
+++ b/libavformat/avienc.c
@@ -247,6 +247,12 @@ static int avi_write_header(AVFormatContext *s)
 
         ff_parse_specific_params(stream, &au_byterate, &au_ssize, &au_scale);
 
+        if (   stream->codec_type == AVMEDIA_TYPE_VIDEO
+            && stream->codec_id != AV_CODEC_ID_XSUB
+            && au_byterate > 1000LL*au_scale) {
+            au_byterate = 600;
+            au_scale    = 1;
+        }
         avpriv_set_pts_info(s->streams[i], 64, au_scale, au_byterate);
         if(stream->codec_id == AV_CODEC_ID_XSUB)
             au_scale = au_byterate = 0;



More information about the ffmpeg-cvslog mailing list