<div dir="ltr">Dear all:<div> I want to sync four rtsp streams from ip camera says:</div><div> rtsp://<a href="http://192.168.0.128/11">192.168.0.128/11</a></div><div> rtsp://<a href="http://192.168.0.129/11">192.168.0.129/11</a></div>
<div> rtsp://<a href="http://192.168.0.130/11">192.168.0.130/11</a></div><div> rtsp://<a href="http://192.168.0.131/11">192.168.0.131/11</a></div><div> And I'm trying to sync these streams to the system clock by adding the stream start time, then I calculate the elapsed time with the current pts like following:</div>
<div> 1. avformat_open_input();</div><div> 2. startTime = system_clock::now()</div><div> 3. while (run) :</div><div> 4. av_read_frame()</div><div> 5. avcodec_decode_video2(&frame, &packet);</div>
<div> 6. playTime = startTime + packet.pts * av_q2d(stream.time_base);</div><div> 7. add { frame : playTime } into queue</div><div> But seems that the playTIme of every rtsp stream is not match, so there's 300ms delay of every rtsp source sometime. Can anybody help about this? Thanks very much.</div>
<div><br></div><div>Sincerely</div><div><br></div><div><br></div></div>