Hi, On November 25, 2014 10:15:31 PM GMT+01:00, Michael Niedermayer <michae...@gmx.at> wrote: >On Tue, Nov 25, 2014 at 02:56:07PM -0300, James Almer wrote: >> Should fix framedrops on some apng files >> >> Signed-off-by: James Almer <jamr...@gmail.com> >> --- >> This is still not optimal because the value of time_base will be >updated on every frame, >> and in some cases delay_num and delay_den varies between frames. >> >> Better fix welcome. >> >> libavformat/apngdec.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c >> index d766a87..47d3753 100644 >> --- a/libavformat/apngdec.c >> +++ b/libavformat/apngdec.c >> @@ -265,8 +265,8 @@ static int decode_fctl_chunk(AVFormatContext *s, >APNGDemuxContext *ctx, AVPacket >> delay_num = 1; >> delay_den = ctx->default_fps; >> } >> - s->streams[0]->r_frame_rate.num = delay_den; >> - s->streams[0]->r_frame_rate.den = delay_num; >> + s->streams[0]->time_base.num = delay_num; >> + s->streams[0]->time_base.den = delay_den; >> pkt->duration = 1; > >this is wrong, the timebase and r_frame_rate are constant >once they have been set >
OK, good to know. >i suggest to use set_pts_info to set a reasonable precisse >timebase something like one millionth or billionth or similar in >base 2. and then set pts based on these delays and the previous >timestamp James, do you want to have a look at this approach or do you want me to do it? >That is unless apng has proper timestamps, in which case they >should be used > It doesn't. Each frame has its duration, which is represented by a fraction of a second, and it can very well change between images. -- Ben _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel