[Live-devel] openRTSP PTS jumps

Janosch Dobler info at jandob.com
Mon Jan 22 00:27:09 PST 2018


I'm trying to record a rtsp stream with the following command:

openRTSP -B 10000000 -b 10000000 -4 -F $date -P $interval -f 10 rtsp://XXX


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. 

E.g. if i define 1200 = 20min as interval, the resulting files have a length of 32min (reported by ffprobe and vlc).

I used ffprobe to analyse the stream as well as the produced mp4 file.

FFprobe on the stream:

$ ffprobe -show_entries frame=pkt_pts_time -of flat XXX.mp4):
frames.frame.0.pkt_pts_time="N/A"
frames.frame.1.pkt_pts_time="-0.218000"
frames.frame.2.pkt_pts_time="-0.118000"
frames.frame.3.pkt_pts_time="-0.018000"
frames.frame.4.pkt_pts_time="0.082000"
frames.frame.5.pkt_pts_time="0.182000"
frames.frame.6.pkt_pts_time="0.282000"
frames.frame.7.pkt_pts_time="0.382000"


FFprobe on the produced file, and it looks like something with the pts is wrong:
$ ffprobe -show_entries frame=pkt_pts_time:frame=key_frame -of flat XXX.mp4):
frames.frame.0.key_frame=12 times
frames.frame.0.pkt_pts_time="0.300000"
frames.frame.1.key_frame=0
frames.frame.1.pkt_pts_time="0.400000"
frames.frame.2.key_frame=0
frames.frame.2.pkt_pts_time="0.500000"
frames.frame.3.key_frame=0
frames.frame.3.pkt_pts_time="0.600000"
frames.frame.4.key_frame=0
frames.frame.4.pkt_pts_time="0.700000" <------ pts jumps from here
frames.frame.5.key_frame=15 times
frames.frame.5.pkt_pts_time="1.100000" <------ to here 
frames.frame.6.key_frame=0
frames.frame.6.pkt_pts_time="1.200000"
frames.frame.7.key_frame=0
frames.frame.7.pkt_pts_time="1.300000"


Note, this is only the case for the frames, not if i use `ffprobe -show_entries packet=pts_time`.


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). 

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. 

Anyone has an idea why this happens and how to fix this?

Regards, 
Janosch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20180122/0e5dbbb2/attachment.html>


More information about the live-devel mailing list