Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

C++
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.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900