Page 1 of 2

Getting Streaming working to a PC

Posted: Wed May 15, 2013 8:56 pm
by simplesi
I'm doing something wrong :(

Camera seems to work as I got a still image from it but I'm having trouble getting to see a streaming video

I think its a problem on the PC side (as I run XP BTW) as when I run

Code: Select all

c:\apps\nc\nc.exe -L -p 5001 | c:\apps\mplayer\mplayer.exe -fps 31 -cache 1024 -
in a cmd window I'm getting this

Code: Select all

C:\Apps\mplayer>c:\apps\nc\nc.exe -L -p 5001 | c:\apps\mplayer\mplayer.exe -fps 31 -cache 1024 -
MPlayer Redxii-SVN-r36251-4.6.3 (C) 2000-2013 MPlayer Team
Custom build by Redxii, http://smplayer.sourceforge.net
Compiled against FFmpeg version N-52919-ge4723a8
Build date: Thu May  9 02:07:55 EDT 2013


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


MPlayer interrupted by signal 2 in module: enable_cache
Cache fill:  0.00% (0 bytes)

Exiting... (Quit)
^C
The exiting is due to me pressing ctrl-c BTW

I''m running

Code: Select all

raspivid -t 999999 -o  | nc 192.168.1.78 5001
on my RPi
Syntax error somewhere or something else?

Simon

Re: Getting Streaming working to a PC

Posted: Thu May 16, 2013 5:56 am
by recantha2
I haven't managed to get it working either, Simon. On my PC (Windows 7), the cache fills up by mplayer never launches.

Re: Getting Streaming working to a PC

Posted: Thu May 16, 2013 6:38 am
by simplesi
I feel a lot better - I just thought I couldn't type some simple instructions out! :)

Simon

Re: Getting Streaming working to a PC

Posted: Thu May 16, 2013 9:45 am
by texy
I had a lot of trouble last night to on my vista laptop, but I did get it to work. I think needed to re start either the pi sending or the laptop receiving once or twice.
One thing I noticed in the thread above, there is a missing '-', it should be be

Code: Select all

raspivid -t 999999 -o - | nc 192.168.1.78 5001
I noticed that when I used the up arrow to repeat the command, the 'missing' '-' turned into a '.' for some reason. So watch out for that.

Hope this helps,
Texy

Re: Getting Streaming working to a PC

Posted: Thu May 16, 2013 1:22 pm
by poing
Works like a charm.

Re: Getting Streaming working to a PC

Posted: Thu May 16, 2013 1:58 pm
by simplesi
One thing I noticed in the thread above, there is a missing '-', it should be be

raspivid -t 999999 -o - | nc 192.168.1.78 5001


I noticed that when I used the up arrow to repeat the command, the 'missing' '-' turned into a '.' for some reason. So watch out for that.
Ta :)
Hopefully that'll be it :)

Simon

Re: Getting Streaming working to a PC

Posted: Thu May 16, 2013 2:45 pm
by recantha2
Still not working for me. The cache fills on the Windows machine, the libavformat (55.4.101) comes up but mplayer never launches... Anyone else experienced that?

Re: Getting Streaming working to a PC

Posted: Thu May 16, 2013 5:17 pm
by simplesi
OK got it (sort of working) :)

I run the PC stuff from within a cmd window (If I run it from run dialog it just flashes up a window and returns - I'm on XP)

Code: Select all

c:\apps\nc\nc.exe -L -p 5001 | c:\apps\mplayer\mplayer.exe -fps 31 -cache 1024 -
then I launch

Code: Select all

raspivid -t 999999 -o - | nc 192.168.1.78 5001
on the RPi

And I can see video :)

Quality isn't too good though - is it the wifi streaming or a loose connection or dodgy camera does anyone think?

http://www.youtube.com/watch?v=f2OFWTHlnp0

Simon

Re: Getting Streaming working to a PC

Posted: Thu May 16, 2013 5:44 pm
by mikerr
Wifi isn't a problem, and it's so clear it's like a (delayed) mirror here...!

You have taken off the blue plastic film off the lens, haven't you ? ;)
..or you may be too close - focus only starts at 60cm+ (2 foot)

Actually 8 yr old nephew is having fun with the 3 second delay

"its like a magic mirror in a timewarp"

http://www.youtube.com/watch?v=uIWGOLXYnHA

Re: Getting Streaming working to a PC

Posted: Thu May 16, 2013 6:01 pm
by poing
Are you guys using the latest software? If I follow the link to the 'may 8' mplayer for Windows (https://code.google.com/p/mplayer-for-w ... z&can=2&q= ) from the blog article (http://www.raspberrypi.org/archives/3890 ) I get a warning the file is deprecated. Instead I downloaded the 'may 11' version from: https://code.google.com/p/mplayer-for-w ... OpSys+Type

Works like a charm.

Re: Getting Streaming working to a PC

Posted: Thu May 16, 2013 6:22 pm
by mikerr
Here's a quick video of my streaming "mirror":
http://www.youtube.com/watch?v=uIWGOLXYnHA

Re: Getting Streaming working to a PC

Posted: Thu May 16, 2013 8:44 pm
by simplesi
I'm having other issues than getting streaming to work properly :(
e.g can't use recantha2's methods to produce a playable mp4 :(

I think I'll retire from the fray and come back later on when the bumps have been sorted out a bit more as got too much on at moment but thanks for the help people :)

Simon

Re: Getting Streaming working to a PC

Posted: Thu May 16, 2013 10:12 pm
by RexRoper
I have not achieved success on the Windows 8 Pro platform after several attempts with adjusting user permissions. I receive a banner that indicates: This app can't run on your PC. To find a version for your PC, check with the software publisher. :roll:

I will move down the Windows O/S platforms until I reach successful results. 8-)

Re: Getting Streaming working to a PC

Posted: Thu May 16, 2013 10:19 pm
by simplesi
Windows 8
Not a good MS vintage - lets hope for better with 8.1 when it comes :)

Simon

Re: Getting Streaming working to a PC

Posted: Thu May 16, 2013 10:51 pm
by mikerr
RexRoper wrote:I have not achieved success on the Windows 8 Pro platform after several attempts with adjusting user permissions. I receive a banner that indicates: This app can't run on your PC. To find a version for your PC, check with the software publisher. :roll:
A 64bit problem ? Works under windows 8 (32bit) here.

To add a bit more info, I'm running this from a command window,
and the PC side has to running first before the pi starts streaming.

versions:
nc111nt
mplayer-svn-36251

Re: Getting Streaming working to a PC

Posted: Thu May 16, 2013 10:57 pm
by RexRoper
mikerr wrote:
RexRoper wrote:I have not achieved success on the Windows 8 Pro platform after several attempts with adjusting user permissions. I receive a banner that indicates: This app can't run on your PC. To find a version for your PC, check with the software publisher. :roll:
A 64bit problem ? Works under windows 8 (32bit) here.
Yes, 64bit Win8Pro. I will try 32bit Win8Pro later this evening.

Thanks for the insight. :idea:

Re: Getting Streaming working to a PC

Posted: Thu May 16, 2013 11:09 pm
by DirkPrefect
Still waiting for my camera to arrive. On windows 8 64 bit you might try VLC and just open the network stream. It appears to be a unicast rtp stream and should open fine using the network option for opening media on VLC putting in the ip and port. If it does it would make it very easy to save the stream, rebroadcast the stream in another protocol or even transcode the stream to a different code, format, etc.

Re: Getting Streaming working to a PC

Posted: Fri May 17, 2013 12:08 am
by towolf
I’ve set up RTP streaming from Arch Linux to Ubuntu Linux using Gstreamer.

raspirecv

Code: Select all

#!/bin/sh
gst-launch-1.0 -e -v udpsrc port=5001 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264 ! fpsdisplaysink sync=false text-overlay=false  
raspisend

Code: Select all

#!/bin/sh
gst-launch-1.0 -e -v fdsrc ! h264parse ! rtph264pay pt=96 config-interval=5 ! udpsink host=ovo.lan port=5001

running it on the PC

Code: Select all

./raspirecv
running it on the raspi

Code: Select all

raspivid  -b 5000000 -t 999999 --verbose -w 1280 -h 720 -o - | ./raspisend
It’s pretty robust and works over wireless. Now and then a packet gets lost and the image is semi-garbled, but it clears quickly. You don’t get the buffered, sped up backlogs like with netcat, however.

Re: Getting Streaming working to a PC

Posted: Fri May 17, 2013 12:21 am
by RexRoper
RexRoper wrote:
mikerr wrote:
RexRoper wrote:I have not achieved success on the Windows 8 Pro platform after several attempts with adjusting user permissions. I receive a banner that indicates: This app can't run on your PC. To find a version for your PC, check with the software publisher. :roll:
A 64bit problem ? Works under windows 8 (32bit) here.
Yes, 64bit Win8Pro. I will try 32bit Win8Pro later this evening.

Thanks for the insight. :idea:
It appears I am experiencing the same problem on my Win8 Pro 32bit desktop. I am opening the command prompt window as Administrator and execute the following:
c:\Storage\RPicamera\nc111nt\nc.exe -L -p 5001 | c:\Storage\RPiCamera\mplayer\mplayer-svn-36251\mplayer.exe -fps 31 -cache 1024 -

I receive a blue banner across my Windows display with the same 'This app can't run on your PC...' message.

I will probably jump down to a Win XP next and skip Win 7 for now.

Update: after moving to my Win XP box and running command prompt as administrator I now receive error: c:\%path to exe%\nc.exe is not a valid Win32 application.

Update 2: After a bit of web searching I found a Win 32/64Bit download for netcat that solved my issues on my WinXP box. No change on the Win8 boxes. Both 32Bit and 64Bit Win8 fail with the same error as above. I will test Win 7 tomorrow. netcat for Win 32/64Bit can be found at:
http://eternallybored.org/misc/netcat/

Re: Getting Streaming working to a PC

Posted: Fri May 17, 2013 3:57 am
by recantha2
towolf wrote:I’ve set up RTP streaming from Arch Linux to Ubuntu Linux using Gstreamer.
.
I don't suppose you'd feel up to sharing how to install gstreamer, would you? Is it as complicated as I've been reading?

Re: Getting Streaming working to a PC

Posted: Fri May 17, 2013 4:10 am
by towolf
Use apt-get?

I’m not sure how much the one-liners have to be adapted if you want to use gstreamer 0.10 on Raspbian. Probably not a lot. Arch has 1.0.

The used elements are in gstreamer0.10-plugins-good and gstreamer0.10-plugins-bad and the gst-launch utility is in gstreamer0.10-tools.

This installs a whole bunch of dependencies unfortunately:

Code: Select all

sudo apt-get install  gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-tools
The same on the receiving end. If you have Windows on the receiving end (mein Beileid) it’s probably easier to make VLC play the stream than installing Gstreamer for Windows.

Re: Getting Streaming working to a PC

Posted: Fri May 17, 2013 5:17 am
by recantha2
I finally cracked the problems I was having with Windows and mplayer.
Two problems: I'm on 64-bit Windows 7 and I needed to specify the output device in the mplayer command.
Here's a tutorial on what I did to get it working which might help others:
http://www.recantha.co.uk/blog/?p=4128

Yay! Windows streaming!

Re: Getting Streaming working to a PC

Posted: Fri May 17, 2013 7:57 am
by poing
Not sure you had a W7 64 bit problem as streaming following the frontpage tutorial works great here on W7 64.

Re: Getting Streaming working to a PC

Posted: Fri May 17, 2013 8:09 am
by recantha2
Maybe it was a codec problem, then... I dunno! Works now!

Re: Getting Streaming working to a PC

Posted: Fri May 17, 2013 8:15 am
by fbutler
recantha2 wrote:
towolf wrote:I’ve set up RTP streaming from Arch Linux to Ubuntu Linux using Gstreamer.
.
I don't suppose you'd feel up to sharing how to install gstreamer, would you? Is it as complicated as I've been reading?
Defiant has created some packages for installing GStreamer 1.0. See here: http://www.raspberrypi.org/phpBB3/viewt ... 63#p293663