Ask Your Question

rududoo's profile - activity

2017-03-24 19:39:55 -0500 commented answer opencv rtsp stream freezing

The solution I found was to use ffmpeg library instead of VideoCapture class implemented by OpenCv. It works without any problems or glitches unlike the situation I used VideoCapture object.

2017-03-21 20:10:28 -0500 answered a question opencv rtsp stream freezing

I come back with an interesting fact. I took the latest version of ffmpeg library and built it. I rebuilt opencv - fixed the symlinks to point to the new ffmpeg and then rerun my application with the rtsp stream. It took longer until the stream froze again.

I tried to play the stream using the ffplay tool generated in ffmpeg. With the ffplay there is no blocking of the rtsp stream. So this looks like an implementation issue inside opencv. Does anyone have some sources examples using ffmpeg library in opencv such that I bypass the opencv videocapture object that behind it uses its implementation for grabbing ffmpeg flow? So I want to grab frames like in ffplay and save them as Mat type and use them further.

2017-03-18 14:55:46 -0500 received badge  Enthusiast
2017-03-11 17:51:55 -0500 received badge  Editor (source)
2017-03-11 17:47:53 -0500 asked a question opencv rtsp stream freezing


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 video stream url for my opencv 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 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 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 vlc and the same result. Is there another transport option? I checked in the video system but I saw only rtsp.

2016-10-26 04:11:50 -0500 commented answer How to classify an object that does not belong to the trained classess using MLP

So as a summary the ANN network seems to overfit. It can only reproduce existing data but it can not make reliable prediction on general untrained data.

2016-10-26 02:41:16 -0500 commented answer How to classify an object that does not belong to the trained classess using MLP

Thank you for the answer. The situation I exposed it's in a real context. Suppose there is a database of persons at moment t0, and the database is trained using the ANN - so there is a model. Then an individual is captured on a live video stream at moment t1. Now the individual is searched for a prediction - to see if he/she has ever been tracked. If the individual is not found, he/she will be saved in the database and the model will be retrained containing also the new face. How should I handle this situation? In the papers there is the notion of "single pattern per person" when there is only one image in the a database per person. Now in the presented case there is no pattern of the individual.(but we do not know that - because as I said there is the moment t0 ... (more)

2016-10-26 00:21:59 -0500 asked a question How to classify an object that does not belong to the trained classess using MLP


I have a simple question related to CvANN_MLP classifier. I' ve trained a dataset composed of 40 subjects (orl_faces) using FPLBP as feature extraction. (that means there are 40 classes). I want to "recognize " a new subject that is not present in any class. After calling the predict method I can see in the output float matrix some distance values. The maximum value will point to the index of the predicted class (label). But this will point to one of the 40 existing classes. Could you give some hints what thresholds or anything similar , should I use , to decide in this particular case that the subject is unknown. (not present among the 40 subjects)? Note that if the subject has some training images it will be detected - so in this situation there is no issue.

Thanks, Radu