Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Ok, one of the simplest solution was:

1) You should install netcat on the raspberry:

cmd >> sudo apt get install netcat;

2) After that, you should open tcp video stream from the raspberry (first select desired PORT_NUMBER, f.t.i. 8080):

cmd >> while true; do raspivid -t 0 -n -w 1280 -h 720 -fps 48 -ex fixedfps -b 3000000 -vf -sa -100 -o - | nc -l PORT_NUMBER; done

3) Now, from your opencv application you can open this stream (first check your Rasberry ip address YOUR-RPI-IP-ADDRESS):

...
cv::VideoCapture _cv;
if(_cv.open("tcp://YOUR-RPI-IP-ADDRESS:PORT_NUMBER")) {
   // Yhoo!
} else {
   std::cerr << "Can not open video source!";
}
...

Ok, one of the simplest solution was:

1) You should install netcat on the raspberry:

cmd >> sudo apt get install netcat;

2) After that, you should open tcp video stream from the raspberry (first select desired PORT_NUMBER, f.t.i. 8080):

cmd >> while true; do raspivid -t 0 -n -w 1280 -h 720 -fps 48 -ex fixedfps -b 3000000 -vf -sa -100 -o - | nc -l PORT_NUMBER; done

3) Now, from your opencv application you can open this stream (first check your Rasberry ip address YOUR-RPI-IP-ADDRESS):

...
cv::VideoCapture _cv;
if(_cv.open("tcp://YOUR-RPI-IP-ADDRESS:PORT_NUMBER")) {
{ // change MACRO to the actual values!
   // Yhoo!
} else {
   std::cerr << "Can not open video source!";
}
...