diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-07-28 17:43:14 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-07-28 17:43:14 +0200 |
commit | 3adc9c9996f439df033d16c16309f40cb35e8b2a (patch) | |
tree | 8ae1bba9c92d8ec1266f856ed61796fe4e579372 | |
parent | 157f95697338dd79253fb4b278399a591bf6894e (diff) | |
download | ffmpeg-3adc9c9996f439df033d16c16309f40cb35e8b2a.tar.gz |
ffmpeg: allow using the r_frame_rate as fundamental timebase for stream copy in avi
Fixes Ticket1434
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | ffmpeg.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -2988,7 +2988,15 @@ static int transcode_init(void) * overhead */ if(!strcmp(oc->oformat->name, "avi")) { - if ( copy_tb<0 && av_q2d(icodec->time_base)*icodec->ticks_per_frame > 2*av_q2d(ist->st->time_base) + if ( copy_tb<0 && av_q2d(ist->st->r_frame_rate) >= av_q2d(ist->st->avg_frame_rate) + && 0.5/av_q2d(ist->st->r_frame_rate) > av_q2d(ist->st->time_base) + && 0.5/av_q2d(ist->st->r_frame_rate) > av_q2d(icodec->time_base) + && av_q2d(ist->st->time_base) < 1.0/500 && av_q2d(icodec->time_base) < 1.0/500 + || copy_tb==2){ + codec->time_base.num = ist->st->r_frame_rate.den; + codec->time_base.den = 2*ist->st->r_frame_rate.num; + codec->ticks_per_frame = 2; + } else if ( copy_tb<0 && av_q2d(icodec->time_base)*icodec->ticks_per_frame > 2*av_q2d(ist->st->time_base) && av_q2d(ist->st->time_base) < 1.0/500 || copy_tb==0){ codec->time_base = icodec->time_base; |