dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5331
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Streaming video fom one pi to another over network

Sat Dec 06, 2014 1:31 pm

I was playing with getting a reasonably low latency video stream from one pi to another over a network.
It uses a simplified version of hello_video with no clock or scheduler to just display video from network with minimal latency (I measured 200ms end to end).

I've pushed the code and instructions to github in case it's useful for anyone else:
https://github.com/popcornmix/userland/ ... deo_simple

DavidMS
Posts: 139
Joined: Fri May 25, 2012 8:48 pm
Contact: Website

Re: Streaming video fom one pi to another over network

Sat Dec 06, 2014 2:55 pm

I am no doubt being thick but when I follow your instructions I get

pi@raspberrypi ~/hello_video_simple $ ./raspi-vid start
-bash: ./raspi-vid: Permission denied

and similarly on the display pi

pi@raspberrypi ~/hello_video_simple $ nc 192.168.1.132 5001 | ./hello_video_simple
-bash: ./hello_video_simple: No such file or directory


I assume I am missing something obvious here ?
http://meanderingpi.wordpress.com/
11 Raspberry Pi's and counting....

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23709
Joined: Sat Jul 30, 2011 7:41 pm

Re: Streaming video fom one pi to another over network

Sat Dec 06, 2014 4:19 pm

for both files

chmod +x <filename>

to make them executable.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

DirkS
Posts: 9945
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Streaming video fom one pi to another over network

Sat Dec 06, 2014 4:57 pm

pi@raspberrypi ~/hello_video_simple $ nc 192.168.1.132 5001 | ./hello_video_simple
-bash: ./hello_video_simple: No such file or directory
That should be

Code: Select all

nc 192.168.1.132 5001 | ./hello_video_simple.bin
Gr.
Dirk.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5331
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Streaming video fom one pi to another over network

Sat Dec 06, 2014 6:06 pm

DirkS wrote:That should be

Code: Select all

nc 192.168.1.132 5001 | ./hello_video_simple.bin
Updated.

DavidMS
Posts: 139
Joined: Fri May 25, 2012 8:48 pm
Contact: Website

Re: Streaming video fom one pi to another over network

Sun Dec 07, 2014 4:43 pm

Sorry but I must still be missing something, I seemingly have the raspi-vid working but I am still getting the same error on the second pi

pi@raspberrypi ~/hello_video_simple $ nc 192.168.1.132 5001 | ./hello_video_simple.bin
-bash: ./hello_video_simple.bin: No such file or directory

I think I get what 'nc' is doing but am confused about the './hello_video_simple.bin' - what is this ? I cannot find it on the pi and do not see how it takes me from a stream of data to displaying video ?

Should I be doing something with the makefile or video.c ?
http://meanderingpi.wordpress.com/
11 Raspberry Pi's and counting....

DirkS
Posts: 9945
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Streaming video fom one pi to another over network

Sun Dec 07, 2014 5:14 pm

Should I be doing something with the makefile or video.c ?
Yes, it needs to be compiled first...

Easiest way to get it compiled is to copy the whole directory to

Code: Select all

/opt/vc/src/hello_pi
You'll probably have to compile the other examples before you can compile the new one:

Code: Select all

cd /opt/vc/src/hello_pi
./rebuild.sh
cd hello_video_simple
make
HTH
Dirk.

DavidMS
Posts: 139
Joined: Fri May 25, 2012 8:48 pm
Contact: Website

Re: Streaming video fom one pi to another over network

Sun Dec 07, 2014 6:06 pm

Thanks Dirk, I suspected it was a little more involved than implied, anyway something to have a go at over Christmas
http://meanderingpi.wordpress.com/
11 Raspberry Pi's and counting....

tvoverbeek
Posts: 98
Joined: Mon Feb 04, 2013 9:50 am
Location: Fieberbrunn, Austria

Re: Streaming video fom one pi to another over network

Mon Dec 08, 2014 7:29 pm

Note that you can download a binary version of Dom's special hello_video program from this page:
http://www.gertbot.com/toaste.html.
See the 'Video Streaming' section at the bottom of the page.

DavidMS
Posts: 139
Joined: Fri May 25, 2012 8:48 pm
Contact: Website

Re: Streaming video fom one pi to another over network

Fri Feb 06, 2015 11:33 pm

Ok so I have come back to try this again, following the instructions on the previous post I seem to have the camera pi setup ok [well I did not get any errors but there is not clue that anything is actually a happening] But on the receiving pi I get the following 'bash: ./hello_video.bin: Permission denied'.

edit -

So after a bit of reading around it would seem the problem is down to my lack of knowledge with linux - the bit that I was missing was that having copied the file across I needed to 'chmod u+x hello_video.bin' so linux would accept is as an executable
http://meanderingpi.wordpress.com/
11 Raspberry Pi's and counting....

User avatar
ekla
Posts: 47
Joined: Wed Apr 09, 2014 9:39 am
Location: Lyon, France

Re: Streaming video fom one pi to another over network

Mon Apr 20, 2015 1:44 pm

Hi all,

Thanks Dom. I just tested the solution. Works great
really great

T*H*A*N*K*S
Last edited by ekla on Thu Apr 30, 2015 11:53 am, edited 1 time in total.
our fears are like dragons guarding our most precious treasures

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: Streaming video fom one pi to another over network

Tue Apr 21, 2015 12:52 pm

You need to use hello_video_simple. Not just hello_video. That one plays frames as fast as possible with no regard to timing in the stream.

The code dom mentioned in OP is still buried in his private GitHub repo. You can download those 5 files and move them to new folder /opt/vc/src/hello_pi/hello_video_simple/. Then go to parent folder /opt/vc/src/hello_pi/ and run rebuild.sh

Return to “Camera board”