Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

opencv rtsp stream freezing

Hi,

I have a live view system - DS-7108HWI-SL from HIKVISION. I am using opencv 2.4.13 to capture its rtsp stream from one channel. The channel options are :

<streamingchannel version="1.0"><id>301</id><channelname/><enabled>true</enabled><transport><rtspportno>554</rtspportno><controlprotocollist><controlprotocol><streamingtransport>RTSP</streamingtransport></controlprotocol></controlprotocollist></transport><video><enabled>true</enabled><videoinputchannelid>3</videoinputchannelid><videocodectype>H.264</videocodectype><videoresolutionwidth>960</videoresolutionwidth><videoresolutionheight>576</videoresolutionheight><videoqualitycontroltype>VBR</videoqualitycontroltype><fixedquality>60</fixedquality><vbruppercap>512</vbruppercap><vbrlowercap>32</vbrlowercap><maxframerate>2500</maxframerate><snapshotimagetype>JPEG</snapshotimagetype></video><audio><enabled>false</enabled><audioinputchannelid>3</audioinputchannelid><audiocompressiontype>G.711ulaw</audiocompressiontype></audio></streamingchannel>

This information is given by the system while giving an url in browser for the specific channel -in this case channel 3. So to access this stream - the rtsp protocol is used; video compression is h264.

I set the corresponding url for the stream for my opencv application. Opencv ap opens the stream in its video capture object. Everything seems fine; for a couple of seconds I have a good fps but then the capture window that I display from opencv freezes and will unblock for tens of seconds then the process repeats (it works then after a short time blocks).

I will appreciate if anyone could give me a hint of how to avoid this blocking.

Note that I used this application with an ip cam which provided a http stream and the video format was mjpg. There were small delays and blockings but it was acceptable.

As an observation I do not know how reliable is rtsp with h264 in a WAN with lots of hops. I forgot to mention that I try to open the rtsp stream over internet - I am not in a local network. I mention that I tried the stream in vlc and there it blocks too. I tried from different locations with vls and the same result. Is there another transport option. I checked in the video system but I saw only rtsp.

opencv rtsp stream freezing

Hi,

I have a live view system - DS-7108HWI-SL from HIKVISION. I am using opencv 2.4.13 to capture its rtsp stream from one channel. The channel options are :

<streamingchannel version="1.0"><id>301</id><channelname/><enabled>true</enabled><transport><rtspportno>554</rtspportno><controlprotocollist><controlprotocol><streamingtransport>RTSP</streamingtransport></controlprotocol></controlprotocollist></transport><video><enabled>true</enabled><videoinputchannelid>3</videoinputchannelid><videocodectype>H.264</videocodectype><videoresolutionwidth>960</videoresolutionwidth><videoresolutionheight>576</videoresolutionheight><videoqualitycontroltype>VBR</videoqualitycontroltype><fixedquality>60</fixedquality><vbruppercap>512</vbruppercap><vbrlowercap>32</vbrlowercap><maxframerate>2500</maxframerate><snapshotimagetype>JPEG</snapshotimagetype></video><audio><enabled>false</enabled><audioinputchannelid>3</audioinputchannelid><audiocompressiontype>G.711ulaw</audiocompressiontype></audio></streamingchannel>

This information is given by the system while giving an url in browser for the specific channel -in this case channel 3. So to access this stream - the rtsp protocol is used; video compression is h264.

I set the corresponding video stream url for the stream for my opencv application. Opencv ap opens the stream in its application and I open it with a video capture object. Everything seems fine; for a couple of seconds I have a good fps but then the capture window that I display from opencv freezes and will unblock block for tens of seconds then the process repeats (it works then after a short time it blocks).

I will appreciate if anyone could give me a hint of how to avoid this blocking.

Note that I used this application with an ip cam which provided a http stream and the video format was mjpg. There were small delays and blockings jams but it was acceptable.

As an observation I do not know how reliable is rtsp with h264 in a WAN with lots of hops. I forgot to mention that I try to open the rtsp stream over internet - I am not in a local network. I mention that I tried the stream in vlc and there it blocks too. I tried from different locations with vls vlc and the same result. Is there another transport option. option? I checked in the video system but I saw only rtsp.