[FFmpeg-cvslog] avconv: estimate next_dts from framerate if it is set.
Anton Khirnov
git at videolan.org
Wed Feb 8 06:04:55 CET 2012
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu Feb 2 13:18:49 2012 +0100| [722410ade56f67b474e4d0e5684e66d4942f5973] | committer: Anton Khirnov
avconv: estimate next_dts from framerate if it is set.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=722410ade56f67b474e4d0e5684e66d4942f5973
---
avconv.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/avconv.c b/avconv.c
index 92af924..0c3d384 100644
--- a/avconv.c
+++ b/avconv.c
@@ -2121,6 +2121,10 @@ static int output_packet(InputStream *ist,
ret = transcode_video (ist, &avpkt, &got_output, &pkt_pts);
if (avpkt.duration)
ist->next_dts += av_rescale_q(avpkt.duration, ist->st->time_base, AV_TIME_BASE_Q);
+ else if (ist->st->r_frame_rate.num)
+ ist->next_dts += av_rescale_q(1, (AVRational){ist->st->r_frame_rate.den,
+ ist->st->r_frame_rate.num},
+ 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;
More information about the ffmpeg-cvslog
mailing list