Reputation: 1
I am using Netcat and Mplayer to stream video from one device to another like this:
cat [video file] | nc [client ip address] [port] (server)
nc -L -p [port] | mplayer [options] (client)
I would like to ask if there is a way to pick up the stream with OpenCV to perform some image processing.
I have tried something like
VideoCapture stream("udp://@<ip>:<port>/");
but the process gets stuck at this point.
Thank you for your help !
Upvotes: 0
Views: 3065
Reputation: 115
I'm doing a similar thing myself, was able to get it working by simply piping through stdin:
nc -L -p [port] | ./opencvprogram
and then in the opencv program:
VideoCapture stream("/dev/stdin");
Upvotes: 1
Reputation: 2184
Did you try
VideoCapture stream("udp://@:6000"); //6000 is just an example
?
Are you sure that your video is streaming as UDP?
You can check this code too.
Upvotes: 0