[FFmpeg-user] Some mysterious about adding PTS to a variable frame rate mp4 video

Moritz Barsnick barsnick at gmx.net
Fri Jan 10 22:38:33 EET 2020


On Fri, Jan 10, 2020 at 15:06:12 -0500, Sean Feng wrote:
> I have a mp4 video which is in VFR, and also a few negative frames
> before I cut it from another video. So the PTS of this video looks like
> this
[...]
> The problem is, when I use a media player to play the output video, I
> can see some of frames felt into the same timestamp. What I mean is the
> frame itself has the correct PTS as they had been drawn, however the
> timestamp of video isn't correct. If I get the PTS of the output video,
> I see this
>
>     pts_time=0.000000
>     pts_time=0.000000
>     pts_time=0.251053
>     pts_time=0.251053
>     pts_time=0.251054
>     pts_time=0.251054

As I understand, ffmpeg is not capable of writing fully compliant VFR
MP4 files. This is probably a side effect of this.

If you write to a different container, suck as MKV, it should work.

Cheers,
Moritz


More information about the ffmpeg-user mailing list