bingo
Posts: 7
Joined: Sat Dec 15, 2012 5:00 pm

Streaming from camera rpi with necat and mplayer

Sat Aug 10, 2013 3:22 pm

Hi

After trying the instructions from the camera board documentation http://www.raspberrypi.org/archives/tag/camera-board I can't view the stream of my camera RPi.
Bellow is the description of all my tests
- I installed netcat on my Raspberry Pi

Code: Select all

sudo apt-get install mplayer netcat
- I installed netcat mplayer mplayer-svn-36251.7z and netcat nc111nt.zip on my computer Windows 7 - 64 bits
- On my PC I opened the command line interpreter cmd.exe and start to reading the stream with

Code: Select all

c:\netcat\nc.exe -L -p 5001 | c:\mplayer\mplayer.exe -fps 31 -cache 1024 - 
Abnormal output return to the command prompt
- I tried Netcat alone with the command

Code: Select all

c:\netcat\nc.exe -L -p 5001

The safety windows appear to ask autorisation for nc.exe. I validated. Next I open a second command line interpreter cmd.exe and type telnet 192.168.0.5 5001. Bi-directional connection work fine
- Start again to read the stream and the response is:
MPlayer sherpya-r35968+39eaacf-4.6 (C) 2000-2013 MPlayer Team

Playing
Reading from stdin
Cachefill: 0.00% (0 bytes)
Seem to be work fine
- I tried MPlayer alone with the command

Code: Select all

c:\mplayer.exe -fps 31 video.h264 (previously recorder with the command: raspivid -o video.h264 -t 10000) 
The display is fine
- I started the camera board with

Code: Select all

 raspivid -t 10000 -o – | nc 192.168.0.5 5001
The red LED is ON during 10 s but MPlayed never launches the window, the stream is not displayed

I suspected that my softwares Netcat and/or MPlayer is not suitable with my Windows 7 - 64 bits
I found this topic http://www.recantha.co.uk/blog/?p=4128 but my CPU is inter Core(TM) i7
I dowloaded MPlayer MPUI 1.2.38 (march 18th 2013) http://www.x64bitdownload.com/downloads ... edxpn.html and netcat 1.12 http://eternallybored.org/misc/netcat/
I started again to read the stream with the command

Code: Select all

c:\netcat\nc64.exe -L -p 5001 | c:\mplayer\mplayer.exe -vo direct3d -fps 31 -cache 1024 - 
But the stream is still not displayed, MPlayer never launched
I am stuck
Can you have a idea why these basics command don't work ?
Thanks for your help
Last edited by bingo on Wed Aug 14, 2013 12:29 am, edited 1 time in total.

bingo
Posts: 7
Joined: Sat Dec 15, 2012 5:00 pm

Re: Streaming from camera rpi with necat and mplayer

Tue Aug 13, 2013 12:56 am

The option -L or -l doesn't change nothing juste to close the connection at the end of the time out

It works with ffmeg and crtmpserver but I don't understand why the basic command doesn't work ?

Thanks

bingo
Posts: 7
Joined: Sat Dec 15, 2012 5:00 pm

Re: Streaming from camera rpi with necat and mplayer

Wed Aug 14, 2013 1:33 am

I tried with -L or with -l
Now I did without -l

Code: Select all

 c:\netcat\nc,exe -p 5001
But same result: MPlayer never launched

Without the option -l netcat exit quickly
option -l specify that nc should listen for an incoming connection, option -L est available under Windows this option will restart Netcat with the same command line when the connection is terminated.
I read also the incompatibility under Linux of the options -l and -p but in this case the syntax proposed is

Code: Select all

is nc -l 5001
I also tried but no success
I use netcat 1.12 for NT and I tested successfully many commands of the manual using the syntax nc -l -p XX

Thanks

User avatar
hukuzatuna
Posts: 13
Joined: Mon Aug 19, 2013 7:06 pm
Location: Delaware

Re: Streaming from camera rpi with necat and mplayer

Sat Aug 24, 2013 6:57 pm

I think there are option mismatches on various versions of netcat. The command that worked for me was

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

Which is very similar to the camera documentation. The command on the RPi was

raspivid -hf -vf -t 99999 -o - | nc 192.168.0.6 5001

Now, I did have to fuss with it for a while because I cut and pasted the command initially, and finally noticed some of the hyphens were "extra long," perhaps a unicode translation problem. When I typed the commands over by hand, all was well.

Cheers,
Phil

bingo
Posts: 7
Joined: Sat Dec 15, 2012 5:00 pm

Re: Streaming from camera rpi with necat and mplayer

Sun Aug 25, 2013 12:29 am

Thank for your help

Unfortunately it doesn't work (I didn't use copy and paste)
I had already tried this command with out the -p option. My netcat exiting very quickly if I don't use l'option -p
When a start the commande raspivid the red light is ON but in the Windows side the cache fill remains to 0.00% (0 bytes)

It works with the rmtp http://www.raspberrypi.org/phpBB3/viewt ... 43&t=45368 but I would like what is wrong.
Netcat, mplayer, Windows 7 64 bit, .... ?
I tried with my laptop but same issue (also Windows 7 64 bits

User avatar
spudnix
Posts: 1
Joined: Mon Aug 26, 2013 5:57 am

Re: Streaming from camera rpi with necat and mplayer

Mon Aug 26, 2013 6:32 am

Received my new RPi Camera module and struggled with this over the weekend.

The CORRECT commands for Mac OS X are

Mac (10.8.4): $ nc -l PORT | mplayer -fps 31 -cache 1024 -
RPi (3.6.11+ #474): $ raspivid -t 999999 -o - | nc CLIENT_IP_ADDR PORT

NOTE: There is no -p switch used on the Mac Client as noted in the documentation.

Example:
Step 1 on Mac OS X (IP_ADDR=192.168.1.9):
Listen with netcat on port 5001 and stream captured content to mplayer.

Code: Select all

$ nc -l 5001 | mplayer -fps 31 -cache 1024 -
Step 2 on RaspberryPi:
Create stream with raspivid and send with netcat to 192.168.1.9 on port 5001

Code: Select all

$ raspivid -t 999999 -o - | nc 192.168.1.9 5001
"There is no dark side in the moon, really. Matter of fact, it's all dark."

bingo
Posts: 7
Joined: Sat Dec 15, 2012 5:00 pm

Re: Streaming from camera rpi with necat and mplayer

Mon Aug 26, 2013 6:25 pm

Thanks for your information

But this topic is for Windows 7 - 64 bits
The -p options is needed for Windows, if not netcat exit promptly
but the stream is not caught

Rusty14
Posts: 5
Joined: Fri Sep 13, 2013 10:51 pm

Re: Streaming from camera rpi with necat and mplayer

Sat Sep 28, 2013 1:07 am

hey, so i am trying to stream video to my Mac from my pi. the problem is every time I run netcat it just exits immediately.
Im putting in the code :

Code: Select all

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

and I have tried a few variations, but every time it exits right away like such:

Code: Select all

Taylors-MacBook-Pro:~ taylorlee$ nc -l -p 5001 | mplayer -fps 31 -cache 1024 -
usage: nc [-46AcCDdFhklnrtUuvz] [-K tc] [-b boundif] [-i interval] [-p source_port]
	  [-s source_ip_address] [-w timeout] [-X proxy_version]
	  [-x proxy_address[:port]] [hostname] [port[s]]
MPlayer 1.1-4.2.1 (C) 2000-2012 MPlayer Team

Playing -.
Reading from stdin...
Cache fill:  0.00% (0 bytes)   

libavformat version 54.6.101 (internal)


Exiting... (End of file)
Taylors-MacBook-Pro:~ taylorlee$ 
Does any one have any idea whats going on? Ive tried updating NC and mplayer via brew and im up to date.

mengs
Posts: 1
Joined: Thu Oct 03, 2013 10:14 pm

Re: Streaming from camera rpi with necat and mplayer

Fri Oct 04, 2013 12:49 am

I am very new to RPi and linux system. I have the problem as I run the following on my mac.

Code: Select all

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

Code: Select all

...
libavformat version 54.6.101 (internal)

Exiting... (End of file)
Many thanks!

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

Re: Streaming from camera rpi with necat and mplayer

Mon Dec 02, 2013 2:08 pm

I have the same issue as the original post, and I have followed the same path to solve it as described.
RPi with camera, trying to stream to Win 7 64 bit i5. Cache is filling up, so the stream is received but the Mplayer is not started. But if a stop the stream from RPi with ctrl-c, a window appears on the laptop playing the video... but I want to see it as it is streaming of course.
Any ideas?

Return to “Camera board”