100ms offset between RTSP streams?

Ingo Lütkebohle iluetkeb at gmail.com
Wed Feb 15 14:12:45 PST 2012


Hi,

I'm capturing streams from two different network cameras and place
them into one matroska file. However, the streams seem to have an
offset of about 100ms, which may appear low but is really quite
noticeable. I noticed the offset by observing the embedded
image-timestamps (the cameras themselves are synchronized using NTP),
and verified it using a clapper. The clapper demonstrates that there
are 3-4 frames difference in the streams, which at my rate (30/1)
would match the 100ms.

The pipeline looks as follows:

gst-launch-0.10 -v \
		matroskamux name=mux ! filesink location=test.mkv \
		rtspsrc latency=500
location=rtsp://192.168.23.10/axis-media/media.amp name=rtp1 !\
			rtph264depay ! video/x-h264, width=800, height=1280, framerate=30/1
! queue ! mux.video_0 \
			rtp1. ! rtpmp4gdepay ! audio/mpeg, mpegversion=4, channels=1,
rate=32000, stream-format=raw \
				 ! queue ! mux.audio_0 \
		 rtspsrc latency=500
location=rtsp://192.168.23.11/axis-media/media.amp name=rtp2 ! \
			rtph264depay name=depay ! video/x-h264, width=800, height=1280,
framerate=30/1 ! queue ! mux.video_1

I looked at the rtspsrc source code, and couldn't fully verify it, but
it appears as if the two rtspsrcs are not using the same gstbin
internally, which would explain that they are not perfectly
synchronized, and the 100ms would then probably be the speed
differences at start-up. However, I could not find a means to have the
same share one rtpbin.

Is there anything I could do here? I've been looking at this problem
for a while now, making some progress, but never fully getting to the
ideal solution. I'm already considering implementing my own RTSP
client and feed the stuff to one rtpbin ;-)

cheers,

-- 
Ingo Lütkebohle
Bielefeld University
http://www.techfak.uni-bielefeld.de/~iluetkeb/

PGP Fingerprint 3187 4DEC 47E6 1B1E 6F4F  57D4 CD90 C164 34AD CE5B


More information about the gstreamer-devel mailing list