<!DOCTYPE html>
<html><head>
    <meta charset="UTF-8">
</head><body><p>I'm trying to record a rtsp stream with the following command:<br></p><p>openRTSP -B 10000000 -b 10000000 -4 -F $date -P $interval -f 10 rtsp://XXX</p><p><br></p><p>The stream has a constant fps of 10. No matter what i chose for $interval, the resulting mp4 files will have a runtime length of 1.6 times the value of $interval. </p><p>E.g. if i define 1200 = 20min as interval, the resulting files have a length of 32min (reported by ffprobe and vlc).</p><p>I used ffprobe to analyse the stream as well as the produced mp4 file.</p><p>FFprobe on the stream:</p><p>$ ffprobe -show_entries frame=pkt_pts_time -of flat XXX.mp4):<br>frames.frame.0.pkt_pts_time="N/A"<br>frames.frame.1.pkt_pts_time="-0.218000"<br>frames.frame.2.pkt_pts_time="-0.118000"<br>frames.frame.3.pkt_pts_time="-0.018000"<br>frames.frame.4.pkt_pts_time="0.082000"<br>frames.frame.5.pkt_pts_time="0.182000"<br>frames.frame.6.pkt_pts_time="0.282000"<br>frames.frame.7.pkt_pts_time="0.382000"<br><br></p><p>FFprobe on the produced file, and it looks like something with the pts is wrong:<br>$ ffprobe -show_entries frame=pkt_pts_time:frame=key_frame -of flat XXX.mp4):<br>frames.frame.0.key_frame=12 times<br>frames.frame.0.pkt_pts_time="0.300000"<br>frames.frame.1.key_frame=0<br>frames.frame.1.pkt_pts_time="0.400000"<br>frames.frame.2.key_frame=0<br>frames.frame.2.pkt_pts_time="0.500000"<br>frames.frame.3.key_frame=0<br>frames.frame.3.pkt_pts_time="0.600000"<br>frames.frame.4.key_frame=0<br>frames.frame.4.pkt_pts_time="0.700000" <------ pts jumps from here<br>frames.frame.5.key_frame=15 times<br>frames.frame.5.pkt_pts_time="1.100000" <------ to here <br>frames.frame.6.key_frame=0<br>frames.frame.6.pkt_pts_time="1.200000"<br>frames.frame.7.key_frame=0<br>frames.frame.7.pkt_pts_time="1.300000"<br><br></p><p>Note, this is only the case for the frames, not if i use `ffprobe -show_entries packet=pts_time`.<br><br></p><p>The jumps seem to appear at every I-frame, and since the stream has a I-frame every 5 frames this explains the factor of 1.6. (0.3s jump every 5 frames -> 0.6s per 10frames -> 0.6s per 1s @ 10fps). <br></p><p>What may also be relevant: the dts and pts values in the stream are equal for each packet/frame and the stream does not use B frames. </p><p>Anyone has an idea why this happens and how to fix this?</p><p>Regards, <br>Janosch</p></body></html>