evangel159
Posts: 7
Joined: Sat Jul 13, 2013 4:44 pm

Problem Streaming video

Tue Oct 08, 2013 5:27 pm

Hi

I am trying to stream video over the network from Rpi to Rpi.
This is the way I do it

First in the client I donwload an install the tools.

sudo apt-get install mplayer netcat

Then I type

nc -l -p 5001 | mplayer -fps 31 -cache 1024 -

And in the Rpi that it works as server I type

raspivid -t 10000 -o - | nc 192.168.10.35 5001

And the stream start but It is extremely slow, for the duration of the streaming I barely see movement.

I check the network conditions and they seem ok

Does anyone know how can I improve the quality?

Thanks in advance!

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

Re: Problem Streaming video

Tue Oct 08, 2013 5:43 pm

evangel159 wrote:Hi

I am trying to stream video over the network from Rpi to Rpi.
This is the way I do it

First in the client I donwload an install the tools.

sudo apt-get install mplayer netcat

Then I type

nc -l -p 5001 | mplayer -fps 31 -cache 1024 -

And in the Rpi that it works as server I type

raspivid -t 10000 -o - | nc 192.168.10.35 5001

And the stream start but It is extremely slow, for the duration of the streaming I barely see movement.

I check the network conditions and they seem ok

Does anyone know how can I improve the quality?

Thanks in advance!
mplayer uses software decoding and will be slow. Try using hello_video - instructions here http://www.raspberrypi.org/camera, but basically this...

Code: Select all

mkfifo buffer
nc -p 5001 -l > buffer | /opt/vc/src/hello_pi/hello_video/hello_video.bin 
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."

evangel159
Posts: 7
Joined: Sat Jul 13, 2013 4:44 pm

Re: Problem Streaming video

Wed Oct 09, 2013 2:23 pm

Hi

Thank you very much for your answer

When I search in the specified folder in the "/opt/vc/src/hello_pi/hello_video/" there is no "hello_video.bin"

When I execute the command it appears

-bash /opt/vc/src/hello_pi/hello_video/hello_video.bin: No such file in directory

I continue with the process and tip in the transmitting Rpi

"raspivid -t 10000 -o - | nc 192.168.10.35 5001"

and I just can see the video in the transmitting Rpi not in the Receiving.

Do you know why?

Thanks

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

Re: Problem Streaming video

Wed Oct 09, 2013 3:10 pm

You need to build the applications...

cd /opt/vc/src/hello_pi
./rebuild


That builds a load of stuff, all the hello_* apps. But you should end up with a hello_video.bin in /opt/vc/src/hello_pi/hello_video
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."

evangel159
Posts: 7
Joined: Sat Jul 13, 2013 4:44 pm

Re: Problem Streaming video

Wed Oct 09, 2013 3:34 pm

Thanks for the answer

I am sorry, but it keep streaming in the same Rpi that it is suppose to be the transmitter and not in the receiver.

Thanks

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

Re: Problem Streaming video

Wed Oct 09, 2013 4:13 pm

evangel159 wrote:Thanks for the answer

I am sorry, but it keep streaming in the same Rpi that it is suppose to be the transmitter and not in the receiver.

Thanks
Have you got the IP addresses mixed up?
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."

evangel159
Posts: 7
Joined: Sat Jul 13, 2013 4:44 pm

Re: Problem Streaming video

Wed Oct 09, 2013 8:46 pm

It works now.

I am trying to send the seed over the network and see it from multiple Rpi, when I try to do it, it does not work.

I start to see it in one Rpi but when I want to send the seed to other Rpi the first streaming stops and the second does not even start.

am I doing it wrong? or should I try another solution?

Thanks for your help!

vijay_nav
Posts: 6
Joined: Thu Oct 17, 2013 11:08 am

Re: Problem Streaming video

Thu Nov 28, 2013 10:45 am

Hai

I had problem while streaming a mp4 video.I have copied a video in home/pi and created a folder video and copied mp4 video.
Now my target is to play that mp4 video using vlc media in my pc.I have done my pi as hotspot i have connected wifi to my pc and i have done streaming in pi and opened a vlc in my pc and trying to play that video using RTSP but i am able to play only one frame in my pc please help me how to play video continuously in my pc with audio.

Daniel_L
Posts: 5
Joined: Fri Nov 29, 2013 9:23 am

Re: Problem Streaming video

Fri Nov 29, 2013 2:20 pm

I have another issue, but have not seen anyone else have my issue:
I have done everything as recommended, but the video feed in the receiving Pi is extremely bad. At best a lag of 10-60 s, and when it starts it freezes for 10-20 s before "fast forwarding" to catch up.
I have tried the following:
- reduce resolution (I do not want to go below 320x240)
- reduce framrate (even 5 or 2 does not help)
- reduce bitrate to 1 MB/s
- go to LAN instead of WiFi
But nothing helps.

I am worried having the buffer file on the SD card (I assume it is there, or am i wrong) is bad, why not on RAM? If so how could I do that?
Any other ideas?

Daniel_L
Posts: 5
Joined: Fri Nov 29, 2013 9:23 am

Re: Problem Streaming video

Fri Nov 29, 2013 11:08 pm

...And i forgot to say I am using the "hello_video" stuff.

Daniel_L
Posts: 5
Joined: Fri Nov 29, 2013 9:23 am

Re: Problem Streaming video

Wed Dec 04, 2013 11:23 am

I can answer my own question: I reduced resolution, frame rate and bitrate to reduce the load on the RPi, but it seems that introduces latency! My conclusion/guess is that the rescaling from native output is too taxing on the GPU so it will introduce lag, latency and choppiness. By just going back to native it works fine.

...and also the buffer file is not needed, just giving stdin as argument to hello-video works just fine:
nc -p 5001 -l | /opt/vc/src/hello_pi/hello_video/hello_video.bin /dev/stdin

Return to “Troubleshooting”