hello
i want to achieve a live streaming from my raspberry pi to windows PC via TCP/IP using raspivid and netcat.
On the windows side, I want to display the live video stream using openCV.
I have created a c++ based tcp/ip client model on the windows side (using VS2012) where it tries to read the video stream from port 5001.
What I have tried:
on the pi side i am using a simple code like
raspivid -t 0 -o - | nc 172.16.26.32 5001
but on the receiver i have c++ based tcp/ip code created on visual studio 2012
After the initial connections (connect, accept, listen), I have used the receiving as
do {
iResult = recv(ConnectSocket, recvbuf, recvbuflen, 0);
} while( iResult > 0 );
i know that for video streaming i cant use an infinite loop like ( iResult > 0 );
but then how do i receive and save a slice of the live video stream? for eg: i want to receive a part of the video stream which as a duration of 20 secs and display the same using openCV or similar
As I am new to this, i would really appreciate if someone would help me out.