[Libav-user] Transcoding example produces incorrect FPS
bpantazhs at gmail.com
Sat Jul 11 19:25:42 EEST 2020
This seems like an issue I faced with my own attempt at transcoding video
and a fix was suggested by a member of this mailing list (thanks James).
You need to set the AVPacket duration field, otherwise this issue is
present. This would mean adding something in the lines of the
following line of code before your av_interleaved_write_frame is called:
// for example, if 25 FPS, and time_base is 12800, then packet.duration =
12800 / 25 = 512
/* mux encoded frame */
ret = av_interleaved_write_frame(format_context, output_packet);
Hope this helps!
On Fri, Jul 10, 2020 at 9:19 PM Tuukka Pasanen <pasanen.tuukka at gmail.com>
> I noticed that example code 'doc/examples/transcoding.c' produces in
> correct FPS if it's used with MP4 container. Encoded video type doesn't
> seem to be the case as I tested H264 and MPEG4 and both were nearly
> With sort videos it's not much just something like 21,85 fps with 24 fps
> video but longer ones can be something like 0.05 fps.
> That it what ffprobe dump and when you play them they are really lagging
> as they go so slow. Packets seems to be correct and it neither wise not
> I don't know if this just feature or is this as bug. With ffmpeg same
> source file produces correct file with correct fps.
> Libav-user mailing list
> Libav-user at ffmpeg.org
> To unsubscribe, visit link above, or email
> libav-user-request at ffmpeg.org with subject "unsubscribe".
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libav-user