dev-resources.site
for different kinds of informations.
FFMPEG Libraries - RTSP Client Keep Alive
I am using the FFMPEG Libraries (Windows Build) to connect and stream RTSP Streams from IP Cameras, this works with no issues on Dahua, Hikvision, etc.
Pseudo code :
avformat_open_input (...)
....
....
av_read_play (...)
...
...
while (TRUE)
{
int nRet = av_read_frame(...)
if (nRet == AVERROR_EOF)
{
OutputDebugString("AVERROR_EOF\n");
break;
}
else if (nRet < 0)
break;
// process packet
av_free_packet(...);
av_init_packet(...);
}
However when connecting to a Grandstream IP camera using RTSP URL :
rtsp://admin:[email protected]/0
av_read_frame fails with an AVERROR_EOF error after 28 video frames (it's always 28 video frames no matter what resolution, frame rate, etc that the camera is set to)
However when I use the same RTSP URL in VLC it connects and maintains the video stream ok, is VLC sending "Keep Alive" packets or "Receiver Reports" back to the camera to keep the connection active.
If this is needed then how do I do this from the FFMPEG Libraries.
Thanks in advance
Iain
Featured ones: