diff mbox series

[FFmpeg-devel] avformat/img2dec: set r_frame_rate in addition to avg_frame_rate

Message ID 20210407182503.34666-1-jeebjp@gmail.com
State Accepted
Commit 5945288818b98682884888e3800893b2f2ac7507
Headers show
Series [FFmpeg-devel] avformat/img2dec: set r_frame_rate in addition to avg_frame_rate
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Jan Ekström April 7, 2021, 6:25 p.m. UTC
Apparently for various image sequences libavformat/utils.c can
calculate rather fancy r_frame_rate values, such as `186/1921`,
and since ffmpeg.c utilizes r_frame_rate for the filter chain
time base, this can quite deteriorate the output frame timing - even
though the user has requested the image sequence to be interpreted
at a specific, constant frame rate.
---
 libavformat/img2dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Anton Khirnov April 11, 2021, 10:15 a.m. UTC | #1
Quoting Jan Ekström (2021-04-07 20:25:03)
> Apparently for various image sequences libavformat/utils.c can
> calculate rather fancy r_frame_rate values, such as `186/1921`,
> and since ffmpeg.c utilizes r_frame_rate for the filter chain
> time base, this can quite deteriorate the output frame timing - even
> though the user has requested the image sequence to be interpreted
> at a specific, constant frame rate.
> ---
>  libavformat/img2dec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
> index be7149bb2f..7b03cb2af1 100644
> --- a/libavformat/img2dec.c
> +++ b/libavformat/img2dec.c
> @@ -222,7 +222,7 @@ int ff_img_read_header(AVFormatContext *s1)
>          avpriv_set_pts_info(st, 64, 1, 1);
>      else {
>          avpriv_set_pts_info(st, 64, s->framerate.den, s->framerate.num);
> -        st->avg_frame_rate = s->framerate;
> +        st->avg_frame_rate = st->r_frame_rate = s->framerate;
>      }
>  
>      if (s->width && s->height) {
> -- 
> 2.30.2

acceptable
Jan Ekström April 11, 2021, 11 a.m. UTC | #2
On Sun, Apr 11, 2021 at 1:16 PM Anton Khirnov <anton@khirnov.net> wrote:
>
> Quoting Jan Ekström (2021-04-07 20:25:03)
> > Apparently for various image sequences libavformat/utils.c can
> > calculate rather fancy r_frame_rate values, such as `186/1921`,
> > and since ffmpeg.c utilizes r_frame_rate for the filter chain
> > time base, this can quite deteriorate the output frame timing - even
> > though the user has requested the image sequence to be interpreted
> > at a specific, constant frame rate.
> > ---
> >  libavformat/img2dec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
> > index be7149bb2f..7b03cb2af1 100644
> > --- a/libavformat/img2dec.c
> > +++ b/libavformat/img2dec.c
> > @@ -222,7 +222,7 @@ int ff_img_read_header(AVFormatContext *s1)
> >          avpriv_set_pts_info(st, 64, 1, 1);
> >      else {
> >          avpriv_set_pts_info(st, 64, s->framerate.den, s->framerate.num);
> > -        st->avg_frame_rate = s->framerate;
> > +        st->avg_frame_rate = st->r_frame_rate = s->framerate;
> >      }
> >
> >      if (s->width && s->height) {
> > --
> > 2.30.2
>
> acceptable
>

Thanks.

Applied as 5945288818b98682884888e3800893b2f2ac7507 .

Jan
diff mbox series

Patch

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index be7149bb2f..7b03cb2af1 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -222,7 +222,7 @@  int ff_img_read_header(AVFormatContext *s1)
         avpriv_set_pts_info(st, 64, 1, 1);
     else {
         avpriv_set_pts_info(st, 64, s->framerate.den, s->framerate.num);
-        st->avg_frame_rate = s->framerate;
+        st->avg_frame_rate = st->r_frame_rate = s->framerate;
     }
 
     if (s->width && s->height) {