[FFmpeg-devel] rtsp rtp/rtcp sync

michael stuur mich.ffmpeg at gmail.com
Fri May 5 11:45:21 EEST 2017

I’ve some problems with synchronizing rtp streams.

In rtsp.c in handle rtp_info (line 1017) base timestamp is set:

        if (!strcmp(rtsp_st->control_url, url)) {
            rtpctx->base_timestamp = rtptime;

Is there any reason to make this statement, since I think the only proper time to do this would be in rtpdec.c
At least it is breaking on rare conditions my synchronization of streams.
Under which conditions could this statement make sense? Which problem does it solve? Couldn’t it be removed?

Furthermore would it make sense to make code to signal in AVStream when a stream is synchronised?

Suppose for instance that the video stream is paused for a moment while the audio stream is still playing, the ffmpeg client connects,
and a few seconds later the video stream started. Doesn’t that start with wrong timestamps until a rtcp SR packets of the video stream is received?  When the stream is synchronized you know that the packet timing is set correctly.

I was a bit wondering about rtcp_ts_offset, but it seems set correctly to smoothly continue between the unsynchronized and synchronized regimes, and is correctly set to same amount for all the streams.


More information about the ffmpeg-devel mailing list