سؤال

I am using libav/ffmpeg for connecting to IP cameras. I do need to extract the absolute timestamp from the frames, not pts/dts. How can I have this value?

Using Wireshark I can see the following response from the camera (Axis P1355):

RTP-Info: url=rtsp://xxx.dyndns.org:4378/axis-media/media.amp/trackID=1?fps=4&resolution=1280x720&compression=60;seq=32446;rtptime=3287715479\r\n

هل كانت مفيدة؟

المحلول 2

Finally I solved the problem.

I had to catch the RTSPState from the context, in order to get the RTSPStream array and get the video one, and after that get the RTPDemuxContext which contains the timestamp.

نصائح أخرى

The RTP packets only contain relative timestamps. The absolute timestamps are included in the sender report (SR) being part of RTCP.

Some incomplete implemented IP cameras don't send SR packets - then you are out of luck. I would give live555's testRTSPClient (http://www.live555.com/liveMedia/#testProgs) a try that gives you access to the absolute timestamp - if transmitted.

The "afterGettingFrame" function hands you an absolute timestamp and with RTPSource::hasBeenSynchronizedUsingRTCP you can verify it.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top