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

Sean sean at seanfeng.dev
Sat Jan 11 05:57:43 EET 2020


Thanks Moritz.

Still the same issue though with mkv.

However I used to see a lot of warnings like

[mp4 @ 0x556dc3300700] Non-monotonous DTS in output stream 0:0; 
previous: 7456280, current: 7456278; changing to 7456281. This may 
result in incorrect timestamps in the output file.
[mp4 @ 0x556dc3300700] Non-monotonous DTS in output stream 0:0; 
previous: 7456281, current: 7456278; changing to 7456282. This may 
result in incorrect timestamps in the output file.
[mp4 @ 0x556dc3300700] Non-monotonous DTS in output stream 0:0; 
previous: 7456282, current: 7456278; changing to 7456283. This may 
result in incorrect timestamps in the output file.

by using mp4 container, and they were gone with mkv.

On 2020-01-10 3:38 p.m., Moritz Barsnick wrote:
> 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
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-user mailing list