[Libav-user] Transcoding frame rate mismatch

Vassilis bpantazhs at gmail.com
Tue Nov 5 13:07:18 EET 2019

This can not be reproduced with the ffmpeg cli, conversion works fine there.
However it can be reproduced with transcoding.c for all input files.
Additionally to what I mentioned, 29.96 fps test files result in 29.98 and
30 to 30.11.
Another 24 fps file resulted in 24.03. The changes seem to be related with
the duration of the file: the longer the file the shorter the marginal fps
The output frame rate can be determined with both fffmpeg -i as well as with
QuickTime 7 and VLC. Like I mentioned, I have spent some time with
investigating this
and it looks like an issue with the correct conversion of the last frame; I
was able
to get different framerate values when tampering with the pts of the last
but this looked like a nasty hack that I shouldn't be doing, plus it fails
again when re-encoding the file.  Here is the info from an input/output
test file
that has the frame rate changed from 24 fps to 24.03:

 Duration: 00:00:36.08, start: 0.000000, bitrate: 178309 kb/s
    Stream #0:0(eng): Video: dnxhd (DNXHD) (AVdn / 0x6E645641),
yuv422p10le(tv, bt709/unknown/unknown), 1920x1080, 176160 kb/s, SAR 1:1 DAR
16:9, 24 fps, 24 tbr, 23976 tbn, 23976 tbc (default)

  Duration: 00:00:36.10, start: 0.000000, bitrate: 116072 kb/s
    Stream #0:0: Video: dnxhd (DNXHD) (AVdn / 0x6E645641), yuv422p(tv,
bt709/unknown/unknown), 1920x1080, 116526 kb/s, SAR 1:1 DAR 16:9, 24.03
fps, 24 tbr, 12288 tbn, 12288 tbc (default)

You'll notice that there is a slight change in the duration as well, but
this happens with the ffmpeg conversion with the cli as well.

Let me know if you need more information and thanks for the help!

On Tue, Nov 5, 2019 at 3:42 AM Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:

> Am Di., 5. Nov. 2019 um 00:16 Uhr schrieb Vassilis <bpantazhs at gmail.com>:
> > I am trying simply to perform a transcoding process using the
> transcoding.c example from doc/examples. However I am seeing a very strange
> result (even when the example is not modified at all, ie not even changing
> codecs); the transcoded file has a marginally different frame rate than the
> original file. For example for a frame rate of 24 fps I get 24.14 fps. I
> also implemented this with the newer av_send/receive packet/frame functions
> to no avail. I would be most grateful for any insights, I've spent quite
> some time trying to troubleshoot this.
> Can you reproduce the issue with the ffmpeg cli or only with transcoding.c?
> Why do you think that the output frame rate is 24.14? What does ffmpeg
> -i show for your input file?
> Carl Eugen
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/libav-user
> To unsubscribe, visit link above, or email
> libav-user-request at ffmpeg.org with subject "unsubscribe".
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20191105/baf504c0/attachment.html>

More information about the Libav-user mailing list