Closed allenling closed 1 year ago
ok, just reset frame.pts and frame.time_base before you encode the frame
for frame in packet.decode():
frame.pts = None
frame.time_base = None
wpackets = out_stream.encode(frame)
output_container.mux(wpackets)
Overview
my program reads frames from a camera, then encodes frames and writes data into a mp4 file.
but when i encoded a frame, i got a error:
last error log: [mp4] Application provided invalid, non monotonically increasing dts to muxer in stream 0
the duplicate packets:
[<av.Packet of #0, dts=33991907, pts=33991907; 31193 bytes at 0x179fd53de08>]
[<av.Packet of #0, dts=33991907, pts=33991907; 34806 bytes at 0x179fd53df48>]
how can i handle this error correctly?
Versions