User avatar
SN
Posts: 1014
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK

Videostream etc over the internet

Fri May 17, 2013 3:38 pm

Not seen this (to be fair not looked too hard :oops: )

Assuming I have apache2 install on my raspi and all the ports open on my router to the internet, is there a straightforward way to make this work - I'm thinking mjpeg or similar with a 1 or 2 second framerate?
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?

nicknml
Posts: 200
Joined: Thu Mar 15, 2012 8:44 pm

Re: Videostream etc over the internet

Fri May 17, 2013 4:37 pm

I'm also interested in doing the same thing. I did something similar with a USB cam in the past but it didn't work very well. I used something other than Apache.

On a side note, I almost killed my Pi and camera module in a clutz moment when the camera module made contact with the GPIO for a split second. The Pi rebooted itself and everything appears to be working ok.

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2876
Joined: Sat Mar 03, 2012 11:57 am
Location: UK

Re: Videostream etc over the internet

Fri May 17, 2013 6:11 pm

nicknml wrote:I'm also interested in doing the same thing. I did something similar with a USB cam in the past but it didn't work very well. I used something other than Apache.

On a side note, I almost killed my Pi and camera module in a clutz moment when the camera module made contact with the GPIO for a split second. The Pi rebooted itself and everything appears to be working ok.
AH. You found the 'spare reset switch' :o :D
Alex Eames RasPi.TV, RasP.iO

pippo
Posts: 8
Joined: Tue Dec 25, 2012 12:58 pm

Re: Videostream etc over the internet

Fri May 17, 2013 8:21 pm

Heyho, i use raspistill for this with some javascript. You will need php, sudo and an Apache webserver.

raspistill.php

Code: Select all

<?php
passthru("sudo raspistill -t 0 -o - -w 800 -h 500 -e jpg -q 70 -ex auto");
?>
visudo:

Code: Select all

www-data ALL=(ALL) NOPASSWD: /usr/bin/raspistill
Then you take the source of mjpegstreamer and edit the file javascript_simple.html and copy it to /var/www:

Code: Select all

img.src = "raspistill.php?n=" + (++imageNr);
Then check the picture with a nice framerate at:
http://pi/javascript_simple.html

fin
Posts: 8
Joined: Sat May 18, 2013 2:24 pm

Re: Videostream etc over the internet

Sat May 18, 2013 2:38 pm

That solution (javascript) worked for me temporarily, but it kills the camera (requires a reboot to work again) after a few minutes - any idea what's up?

fin
Posts: 8
Joined: Sat May 18, 2013 2:24 pm

Re: Videostream etc over the internet

Sat May 18, 2013 4:49 pm

Nevermind, I'm actually getting an error from the command line

mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn't be enabled
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates

Which might be related to GPU memory?

ludespeedny
Posts: 103
Joined: Mon Oct 01, 2012 6:55 pm

Re: Videostream etc over the internet

Sat May 18, 2013 5:23 pm

try switching the cable around and/or reseating it. That is what I did. I have another thread with the way the cable goes in

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

Re: Videostream etc over the internet

Sat May 18, 2013 6:40 pm

See the thread here: http://www.raspberrypi.org/phpBB3/viewt ... 4&p=351398

This is your best bet for streaming video over the internet. It chops the video stream into short segments and drops them into the www directory. A spearate .m3u8 playlist announces the currently valid segments and the player hops from one segment to the next without interruption.

This is knows as HTTP Live streaming and is an Apple Computer standard. So far support is built into i{Phone,Pad} and newer Android devices. I found VLC and FFMpeg and Gstreamer can play as well.

Drawback is, it is delayed by the length of one or two segments (e.g. 10-60 seconds).

audioscience
Posts: 9
Joined: Sat Jan 19, 2013 9:45 pm

Re: Videostream etc over the internet

Sat May 18, 2013 7:06 pm

Why not just use MJPG-Streamer?

http://sourceforge.net/projects/mjpg-streamer/

Works well for me.

http://www.theturtlepi.com

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

Re: Videostream etc over the internet

Sat May 18, 2013 7:40 pm

audioscience wrote:Why not just use MJPG-Streamer?
Why low fps MJPG when you can have fast fps H264?

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2876
Joined: Sat Mar 03, 2012 11:57 am
Location: UK

Re: Videostream etc over the internet

Sat May 18, 2013 7:42 pm

audioscience wrote:Why not just use MJPG-Streamer?

http://sourceforge.net/projects/mjpg-streamer/

Works well for me.

http://www.theturtlepi.com
Nice
Is that using a RasPiCam?
Did you compile it on the Pi yourself or is it in the repo?
Alex Eames RasPi.TV, RasP.iO

audioscience
Posts: 9
Joined: Sat Jan 19, 2013 9:45 pm

Re: Videostream etc over the internet

Sat May 18, 2013 9:26 pm

No Raspi cam, it's a Logitech HD C310 webcam. Costs $30. No additional power needed (I use a 2 amp power supply, no USB hub with USB Wifi dongle plugged in).

Compiled on the RasPi. Follow these instructions:

http://www.raspberrypi.org/phpBB3/viewt ... 39#p164539

Return to “Camera board”