simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Getting Streaming working to a PC

Wed May 15, 2013 8:56 pm

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
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

User avatar
recantha2
Posts: 277
Joined: Wed Nov 14, 2012 9:34 am
Location: Potton, Bedfordshire
Contact: Website

Re: Getting Streaming working to a PC

Thu May 16, 2013 5:56 am

I haven't managed to get it working either, Simon. On my PC (Windows 7), the cache fills up by mplayer never launches.
--
Michael Horne - @recantha
Raspberry Pi blog - http://www.recantha.co.uk/blog

Cambridge Raspberry Jam
Website: http://camjam.me
Facebook: https://www.facebook.com/cambridgeraspberryjam
Follow the Cambridge Raspberry Jam on Twitter - @cambridgejam

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Getting Streaming working to a PC

Thu May 16, 2013 6:38 am

I feel a lot better - I just thought I couldn't type some simple instructions out! :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

texy
Forum Moderator
Forum Moderator
Posts: 5155
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Getting Streaming working to a PC

Thu May 16, 2013 9:45 am

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
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: Getting Streaming working to a PC

Thu May 16, 2013 1:22 pm

Works like a charm.

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Getting Streaming working to a PC

Thu May 16, 2013 1:58 pm

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
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

User avatar
recantha2
Posts: 277
Joined: Wed Nov 14, 2012 9:34 am
Location: Potton, Bedfordshire
Contact: Website

Re: Getting Streaming working to a PC

Thu May 16, 2013 2:45 pm

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?
--
Michael Horne - @recantha
Raspberry Pi blog - http://www.recantha.co.uk/blog

Cambridge Raspberry Jam
Website: http://camjam.me
Facebook: https://www.facebook.com/cambridgeraspberryjam
Follow the Cambridge Raspberry Jam on Twitter - @cambridgejam

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Getting Streaming working to a PC

Thu May 16, 2013 5:17 pm

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
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

mikerr
Posts: 2770
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Getting Streaming working to a PC

Thu May 16, 2013 5:44 pm

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
Last edited by mikerr on Fri May 17, 2013 8:17 am, edited 1 time in total.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: Getting Streaming working to a PC

Thu May 16, 2013 6:01 pm

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.

mikerr
Posts: 2770
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Getting Streaming working to a PC

Thu May 16, 2013 6:22 pm

Here's a quick video of my streaming "mirror":
http://www.youtube.com/watch?v=uIWGOLXYnHA
Android app - Raspi Card Imager - download and image SD cards - No PC required !

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Getting Streaming working to a PC

Thu May 16, 2013 8:44 pm

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
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

RexRoper
Posts: 67
Joined: Wed Oct 31, 2012 4:45 pm
Location: South Florida
Contact: Website

Re: Getting Streaming working to a PC

Thu May 16, 2013 10:12 pm

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-)

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Getting Streaming working to a PC

Thu May 16, 2013 10:19 pm

Windows 8
Not a good MS vintage - lets hope for better with 8.1 when it comes :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

mikerr
Posts: 2770
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Getting Streaming working to a PC

Thu May 16, 2013 10:51 pm

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
Last edited by mikerr on Fri May 17, 2013 9:53 am, edited 2 times in total.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

RexRoper
Posts: 67
Joined: Wed Oct 31, 2012 4:45 pm
Location: South Florida
Contact: Website

Re: Getting Streaming working to a PC

Thu May 16, 2013 10:57 pm

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:

DirkPrefect
Posts: 24
Joined: Tue May 07, 2013 3:07 am

Re: Getting Streaming working to a PC

Thu May 16, 2013 11:09 pm

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.

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

Re: Getting Streaming working to a PC

Fri May 17, 2013 12:08 am

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.

RexRoper
Posts: 67
Joined: Wed Oct 31, 2012 4:45 pm
Location: South Florida
Contact: Website

Re: Getting Streaming working to a PC

Fri May 17, 2013 12:21 am

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/

User avatar
recantha2
Posts: 277
Joined: Wed Nov 14, 2012 9:34 am
Location: Potton, Bedfordshire
Contact: Website

Re: Getting Streaming working to a PC

Fri May 17, 2013 3:57 am

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?
--
Michael Horne - @recantha
Raspberry Pi blog - http://www.recantha.co.uk/blog

Cambridge Raspberry Jam
Website: http://camjam.me
Facebook: https://www.facebook.com/cambridgeraspberryjam
Follow the Cambridge Raspberry Jam on Twitter - @cambridgejam

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

Re: Getting Streaming working to a PC

Fri May 17, 2013 4:10 am

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.

User avatar
recantha2
Posts: 277
Joined: Wed Nov 14, 2012 9:34 am
Location: Potton, Bedfordshire
Contact: Website

Re: Getting Streaming working to a PC

Fri May 17, 2013 5:17 am

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!
--
Michael Horne - @recantha
Raspberry Pi blog - http://www.recantha.co.uk/blog

Cambridge Raspberry Jam
Website: http://camjam.me
Facebook: https://www.facebook.com/cambridgeraspberryjam
Follow the Cambridge Raspberry Jam on Twitter - @cambridgejam

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: Getting Streaming working to a PC

Fri May 17, 2013 7:57 am

Not sure you had a W7 64 bit problem as streaming following the frontpage tutorial works great here on W7 64.

User avatar
recantha2
Posts: 277
Joined: Wed Nov 14, 2012 9:34 am
Location: Potton, Bedfordshire
Contact: Website

Re: Getting Streaming working to a PC

Fri May 17, 2013 8:09 am

Maybe it was a codec problem, then... I dunno! Works now!
--
Michael Horne - @recantha
Raspberry Pi blog - http://www.recantha.co.uk/blog

Cambridge Raspberry Jam
Website: http://camjam.me
Facebook: https://www.facebook.com/cambridgeraspberryjam
Follow the Cambridge Raspberry Jam on Twitter - @cambridgejam

User avatar
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: Getting Streaming working to a PC

Fri May 17, 2013 8:15 am

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

Return to “Camera board”