Open xixihao123 opened 5 years ago
Hi,
Could you please try commenting this line:
//if (!context.initialized || inNextFrame)
{
m_videoStartClock = (m_isPaused ? m_pauseTimer : GetHiResTime()) - pts;
}
I 've already tried. comment the line. There's no delay. Using OBS to push the camera will be a little bit video and audio are out of sync. Can you shorten the display time?
Just to be sure. You mentioned another code line. Have you tried this one?
What do you mean? I only commented on this line of code, and the audio was about a second slower when I pushed it
I am sorry, it looked like you were talking about the line with boost::this_thread::sleep_for() previously
The problem is not very large, playing video stream, think RTSP playing video delay should be only about 200 MS
This seems to be tricky area: https://trac.ffmpeg.org/ticket/5018 https://lists.ffmpeg.org/pipermail/ffmpeg-user/2018-April/039590.html
Hi, when I used the ffmpet push camera and then played RTSP video with player, I found that the delay was about 1 second, mainly caused by the displayRunnable() thread, and if deleted for (;;) { const double delay = m_videoStartClock + current_frame.m_pts - GetHiResTime(); if (delay < 0.005) break; if (delay > 0.1) { boost::this_thread::sleep_for( boost::chrono::milliseconds(100 * speedDenominator / speedNumerator)); continue; }
There will be no delay, but it will cause the audio and video to be out of sync. How can we optimize it?