Page 1 of 1

Videostream etc over the internet

Posted: Fri May 17, 2013 3:38 pm
by SN
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?

Re: Videostream etc over the internet

Posted: Fri May 17, 2013 4:37 pm
by nicknml
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.

Re: Videostream etc over the internet

Posted: Fri May 17, 2013 6:11 pm
by alexeames
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

Re: Videostream etc over the internet

Posted: Fri May 17, 2013 8:21 pm
by pippo
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

Re: Videostream etc over the internet

Posted: Sat May 18, 2013 2:38 pm
by fin
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?

Re: Videostream etc over the internet

Posted: Sat May 18, 2013 4:49 pm
by fin
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?

Re: Videostream etc over the internet

Posted: Sat May 18, 2013 5:23 pm
by ludespeedny
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

Re: Videostream etc over the internet

Posted: Sat May 18, 2013 6:40 pm
by towolf
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).

Re: Videostream etc over the internet

Posted: Sat May 18, 2013 7:06 pm
by audioscience
Why not just use MJPG-Streamer?

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

Works well for me.

http://www.theturtlepi.com

Re: Videostream etc over the internet

Posted: Sat May 18, 2013 7:40 pm
by towolf
audioscience wrote:Why not just use MJPG-Streamer?
Why low fps MJPG when you can have fast fps H264?

Re: Videostream etc over the internet

Posted: Sat May 18, 2013 7:42 pm
by alexeames
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?

Re: Videostream etc over the internet

Posted: Sat May 18, 2013 9:26 pm
by audioscience
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