[FFmpeg-devel] rtp streaming x264+audio issues (and some ideas to fix them)
Ronald S. Bultje
Sat Feb 6 14:05:49 CET 2010
On Feb 6, 2010, at 5:17 AM, Timo Ter?s <timo.teras at iki.fi> wrote:
> As a quick test, I did the following to ensure that the RTCP
> packets were using same base time.
> --- libavformat/rtpenc.c (revision 21651)
> +++ libavformat/rtpenc.c (working copy)
> @@ -91,7 +91,8 @@
> s->cur_timestamp = 0;
> s->ssrc = 0; /* FIXME: was random(), what should this be? */
> s->first_packet = 1;
> - s->first_rtcp_ntp_time = AV_NOPTS_VALUE;
> + //s->first_rtcp_ntp_time = AV_NOPTS_VALUE;
> + s->first_rtcp_ntp_time = ntp_time();
> max_packet_size = url_fget_max_packet_size(s1->pb);
> if (max_packet_size <= 12)
> And indeed, after this vlc (with large enough file-cache) seemed
> to play the live stream pretty well. However, it'd be better
> if the RTP streams were synchronized so there isn't any manual
> need to twiddle with the player cache sizes (and QT did not
> like the stream in this case either).
> What would be the proper way to fix the synchronization issue?
I've been looking at this exact problem, but on the demuxer side. We
basically set pts=0 at the first rtcp, same as above. This is wrong,
the starts should be synced to all streams within one uri. I suppose
this same applies here also for the rtp muxer. I don't have a
definitive patch / fix yet.
More information about the ffmpeg-devel