diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-04-02 18:08:12 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-11-29 11:27:12 +0100 |
commit | 14f31df2ccf37466ee23d88e7525136be3f42222 (patch) | |
tree | 1e7099f2216a54b5bd9563ddb339f12c3f8056fa | |
parent | d04e78805aa41b43d371ce9cd9b4fd2bf3af2989 (diff) | |
download | ffmpeg-14f31df2ccf37466ee23d88e7525136be3f42222.tar.gz |
ffmpeg: Fix forcing of the framerate for stream copy on input
Fixes Ticket2211
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 356363c89830585b0a1476ccc16d79158260617c)
-rw-r--r-- | ffmpeg.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1910,7 +1910,10 @@ static int output_packet(InputStream *ist, const AVPacket *pkt) ist->st->codec->sample_rate; break; case AVMEDIA_TYPE_VIDEO: - if (pkt->duration) { + if (ist->framerate.num) { + int64_t next_dts = av_rescale_q(ist->next_dts, AV_TIME_BASE_Q, av_inv_q(ist->framerate)); + ist->next_dts = av_rescale_q(next_dts + 1, av_inv_q(ist->framerate), AV_TIME_BASE_Q); + } else if (pkt->duration) { ist->next_dts += av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q); } else if(ist->st->codec->time_base.num != 0) { int ticks= ist->st->parser ? ist->st->parser->repeat_pict + 1 : ist->st->codec->ticks_per_frame; @@ -2213,6 +2216,8 @@ static int transcode_init(void) codec->time_base = icodec->time_base; } + if (ist && !ost->frame_rate.num) + ost->frame_rate = ist->framerate; if(ost->frame_rate.num) codec->time_base = av_inv_q(ost->frame_rate); |