[Libav-user] fps wrong in doc/examples and in my own code

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Libav-user] fps wrong in doc/examples and in my own code

Gonzalo Garramuño
I have a problem with the new codecpar api in that I cannot get it to
encode the right fps.  By fps I mean what ffprobe reports as fps in the
Stream section and what my viewer uses as fps (stream->avg_frame_rate).

The problem also shows up in the demo doc/examples/muxing, which when
encoded at 1/25, ffprobe reports:

     Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p,
352x288, 252 kb/s, 25.10 fps, 25 tbr, 12800 tbn, 50 tbc (default)

That is, 25.10 fps instead of 25.  If I encode breaking the new api, like:

     stream->codec->time_base = avctx->time_base;

then the fps result is correct, but I get a warning of deprecation of codec.

So I am missing something rather obvious and maybe someone can clarify
for me if I am using something wrong.

--
Gonzalo Garramuño

_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: fps wrong in doc/examples and in my own code

Gonzalo Garramuño

El 6/8/19 a las 20:20, Gonzalo Garramuño escribió:

> I have a problem with the new codecpar api in that I cannot get it to
> encode the right fps.  By fps I mean what ffprobe reports as fps in
> the Stream section and what my viewer uses as fps
> (stream->avg_frame_rate).
>
> The problem also shows up in the demo doc/examples/muxing, which when
> encoded at 1/25, ffprobe reports:
>
>     Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p,
> 352x288, 252 kb/s, 25.10 fps, 25 tbr, 12800 tbn, 50 tbc (default)
>
I found out that there's a routine called av_guess_frame_rate() which
reports the proper frame rate as a Rational number.  Hope this helps
someone dealing with the same issue I was seeing.

--
Gonzalo Garramuño

_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".