I think I found a typo in preview.php
Code: Select all
line 35: onclick='if(confirm(\"Delete al?\"))
Code: Select all
onclick='if(confirm(\"Delete all?\"))
Code: Select all
line 35: onclick='if(confirm(\"Delete al?\"))
Code: Select all
onclick='if(confirm(\"Delete all?\"))
Code: Select all
setInterval("send_cmd('im');", 1000)
Thanks for that. Perhaps a silly question, but how would you then stop the system taking a picture every second? I'd ideally like to add a "start timelapse" button which sends that command, and then a "stop timelapse" button which would stop the process and revert to normal use. Alternatively, I would probably be able to work with something which would just start the timelapse process and run it for say 5 minutes before stopping automatically and requiring a manual restart to continue with timelapse.silvanmelchior wrote:@robm99: You can add the javascript-command
to the web-Interface for example to take a picture every second. RaspiMJPEG itself hasn't implemented timelapse at the moment.Code: Select all
setInterval("send_cmd('im');", 1000)
Not really tested, as I have no camera running at the moment, but this should work. Just paste the code somewhere in the page, but not inside another tag:robm99 wrote:Thanks for that. Perhaps a silly question, but how would you then stop the system taking a picture every second? I'd ideally like to add a "start timelapse" button which sends that command, and then a "stop timelapse" button which would stop the process and revert to normal use.silvanmelchior wrote:@robm99: You can add the javascript-command
to the web-Interface for example to take a picture every second. RaspiMJPEG itself hasn't implemented timelapse at the moment.Code: Select all
setInterval("send_cmd('im');", 1000)
Code: Select all
<script>
var lapsrunning=0;
function setlaps(){
if(lapsrunning==0){
document.getElementById('startstopLaps').innerHTML='Stop Timelapse';
var e=document.getElementById("lapsInterval");
lapsrunning=e.options[e.selectedIndex].value;
lapsrunning=parseInt(lapsrunning)*1000;
runlaps();
}else{
document.getElementById('startstopLaps').innerHTML='Start Timelapse';
lapsrunning=0;
}
}
function runlaps(){
if(lapsrunning>0){
send_cmd('im');
setTimeout("runlaps()",lapsrunning);
}
}
</script>
<button type='button' id='startstopLaps' onClick='setlaps()';>Start TimeLapse</button>
with
<select id='lapsInterval'>
<option value='1'>1</option>
<option value='3'>3</option>
<option value='5'>5</option>
<option value='10'>10</option>
<option value='30'>30</option>
<option value='60'>60</option>
</select>
second interval<br>
The RPi Cam Web Interface uses a program called raspimjpeg which generates a stream of relatively low resolution JPEG images. Such a stream is called motion-JPEG or MJPEG. If you turn on motion detection from the web interface, these MJPEG frames are sent to the "motion" application which does motion detection (but note, unless you change the source code to 'motion' and recompile it youself, it is rate-limited to actually do the motion detection algorithm at only 3 fps even if you send it 30 frames each second.) Once motion is detected, a signal goes back to the "raspimjpeg" program using a named-pipe mechanism and this turns on full-HD video recording at 30 fps, and recording proceeds until such time as the motion event is over. As a result you get normal rate video, even though the actual motion-detect algorithm is only running at 3 fps.Pangu wrote:Hello. Can anyone explain to me what the difference between this tool and "motion-mmal" from "dozencrow" or even the use of "uv4l" is ? What is the advantage/disadvantage? Which is the best way to get motion run on the RPi with maximum possible FPS and quality? thanks to all
Did you mean to post this in a different thread? How does the computer know from a JPEG image how close or far away an object is? It would first need to detect objects, and also would need to know their true size. The "motion" program is actually mis-named, it does NOT detect motion! It detects local changes in image brightness. That could be from something moving, or just from a change in lighting- the sun coming out from behind the clouds and casting shadows, for example.rjain15 wrote:Is it possible to create some kind of beep or warning sound if the object is moving towards you or if you are moving towards an obstacle.
The idea is to use the motion capture to warn someone if they are hitting an object or if the object is going to hit them.
The variables could be distance, speed of motion, size
Can you please explain whereoke wrote:Dear jussi24,
You can change the picture size in following places and see what happens:
1. (sudo nano) RPI_Cam_Browser_Control_Installer.sh
2. (sudo nano) /etc/rc.local
3. (sudo nano) /var/www/index.html
- limit width and height for browser like: <img id="mjpeg_dest" width="960" height="540">
If You add this link (by hand), You can use IP Cam Viewer Pro (by Robert Chou) on tablet or phone
- ln -s /run/shm/mjpeg/cam.jpg /var/www/cam.jpg
- You can see the bigger picture by browser with no refresh too
IP Cam Viewer Pro settings are as follows:
- Generic URL, URL: http://my.raspberry.pi:80/cam.jpg
- Max size here is 1920 x 1080
- Tested with Nexus 4, Nexus 7 and Jolla
I have 4 cameras in use now and 3 of them with ethernet cable connection
keep on working. One camera has Wi-Fi connction and that connection
freezes at least once a week. I suggest a timer for daily power reset.
This is normal behavior with allmost all surveillance cameras.
Mozilla browser is used by me to record the max. resolution image.
If You get vc.ril.camera error message, check and push back the yellow connector on camera.
Set of different lenses is available from Verkkokauppa.com for 30€ (Item 10207).
Regards,
Oke
Code: Select all
- ln -s /run/shm/mjpeg/cam.jpg /var/www/cam.jpg
Thanks... In my science project I was interested in using RPi Cam to detect obstacles and beep. The second part of the science project was to recognize objects. The RPi and camera are going to be mounted on a moving robot or a person.Did you mean to post this in a different thread? How does the computer know from a JPEG image how close or far away an object is? It would first need to detect objects, and also would need to know their true size. The "motion" program is actually mis-named, it does NOT detect motion! It detects local changes in image brightness. That could be from something moving, or just from a change in lighting- the sun coming out from behind the clouds and casting shadows, for example.
The OpenCV program can detect objects, and comparing frames you could tell if it is moving towards you or away from you, but not the true distance. You can program it to know actual size of some specific objects it can recognize, and calculate distance for a few special cases but that is a very difficult problem in general. (Even people can have trouble with this, especially if you use only one eye like the RPi would generally have). It can be done at least in theory if you have two cameras, with image detection on both of them, matching up images and using the stereo depth information. This is quite a project though.
Normally to get distance information for a robot, etc. you use an ultrasonic sensor, something like this:
http://www.bytecreation.com/blog/2013/1 ... or-hc-sr04
http://www.youtube.com/watch?v=xACy8l3LsXI
You can also measure distance optically if you project a light (laser pointer?) from some distance offset to the side of your camera, and measure the position of the spot, you can then calculate distance using triangulation, something like this:
https://sites.google.com/site/todddanko ... ser_ranger
Pangu wrote:Hello. Can anyone explain to me what the difference between this tool and "motion-mmal" from "dozencrow" or even the use of "uv4l" is ? What is the advantage/disadvantage? Which is the best way to get motion run on the RPi with maximum possible FPS and quality? thanks to all
Hello jbeale and thanks for your reply. Well, I understand now, that there are two different ways FPS occurs in this manner. So if I understood correct: the default raspbian package "motion" is hardcoded to support maximum 3fps for detection? In my understanding the 3fps for motion detection mechanism should be enough, please correct me if I'm wrong.jbeale wrote:The RPi Cam Web Interface uses a program called raspimjpeg which generates a stream of relatively low resolution JPEG images. Such a stream is called motion-JPEG or MJPEG. If you turn on motion detection from the web interface, these MJPEG frames are sent to the "motion" application which does motion detection (but note, unless you change the source code to 'motion' and recompile it youself, it is rate-limited to actually do the motion detection algorithm at only 3 fps even if you send it 30 frames each second.) Once motion is detected, a signal goes back to the "raspimjpeg" program using a named-pipe mechanism and this turns on full-HD video recording at 30 fps, and recording proceeds until such time as the motion event is over. As a result you get normal rate video, even though the actual motion-detect algorithm is only running at 3 fps.
So, when one is using "motion-mmal" (what exactly is different on this version from dozencrow? did he rewrote the package "motion" with some enhancement/improvements??) or the combination "default raspbian motion package + uv4l + uv4l-raspicam" it won't be possible to get a Full-HD videostream at 30fps ? At the other side: is it possible to have 1920x1080 @30fps video when I use the "RPi Cam Web Interface" from this topic here?jbeale wrote:By contrast, the dozencrows "motion-mmal" and motion/UV4L by themselves can generate still frames or video, but they reconstruct that video from the still frames they are given, and that is limited by the small bandwidth and computation power of the Pi's ARMv6 CPU to something much less than full HD / 30 fps. I've found 3 fps at 1024x576 to be about as much as I can get from them.
Hi Guys,oke wrote:Dear jussi24,
You can change the picture size in following places and see what happens:
1. (sudo nano) RPI_Cam_Browser_Control_Installer.sh
2. (sudo nano) /etc/rc.local
3. (sudo nano) /var/www/index.html
- limit width and height for browser like: <img id="mjpeg_dest" width="960" height="540">
If You add this link (by hand), You can use IP Cam Viewer Pro (by Robert Chou) on tablet or phone
- ln -s /run/shm/mjpeg/cam.jpg /var/www/cam.jpg
- You can see the bigger picture by browser with no refresh too
IP Cam Viewer Pro settings are as follows:
- Generic URL, URL: http://my.raspberry.pi:80/cam.jpg
- Max size here is 1920 x 1080
- Tested with Nexus 4, Nexus 7 and Jolla
I have 4 cameras in use now and 3 of them with ethernet cable connection
keep on working. One camera has Wi-Fi connction and that connection
freezes at least once a week. I suggest a timer for daily power reset.
This is normal behavior with allmost all surveillance cameras.
Mozilla browser is used by me to record the max. resolution image.
If You get vc.ril.camera error message, check and push back the yellow connector on camera.
Set of different lenses is available from Verkkokauppa.com for 30€ (Item 10207).
Regards,
Oke
motion-mmal from dozencrows was written to enable motion detection using the R-Pi mmal camera interface directly, before the v4l2 interface was available. Nowadays, you can also use stock "motion" with the new v4l2 interface. But as I explained, neither one allows 1920x1080 @ 30fps because the R-Pi CPU is too slow to encode HD video by itself. You would have to use the GPU to get full HD, and motion doesn't do that.Pangu wrote:So, when one is using "motion-mmal" (what exactly is different on this version from dozencrow? did he rewrote the package "motion" with some enhancement/improvements??) or the combination "default raspbian motion package + uv4l + uv4l-raspicam" it won't be possible to get a Full-HD videostream at 30fps ? At the other side: is it possible to have 1920x1080 @30fps video when I use the "RPi Cam Web Interface" from this topic here?
I have seen the program perform perfectly smoothly, it is not the RPi by itself. I think it is your wifi dongle. When I used a small cheap 8188CUS type wifi it would be very slow. When I used a Atheros AR9271 it worked better, see this post:memilanuk wrote: ...very slow, given an RPi w/ wifi dongle ...
Try a different web browser...firefox works... mobile browsers on tablets and phones don't seem to, well stock, chrome and firefox on android (for me)aunitt wrote:Apologies for the possibly stupid question, but I can't get the rotation on the web page to work, whatever rotation value I set doesn't seem to make a difference.
Any pointers as to what I could be doing wrong?
Serch for Mount --bindmr_wberrypi wrote:how to record the files onto my Mounted NAS, instead of saving them on the SD card.
So would be nice having the PI record video 24/7 and save the recorded files on my Nas?
One can also mount an already visible directory tree elsewhere:
mount --bind olddir newdir
Code: Select all
# mount --bind /mnt/xyz /var/www/media