Cbaymac
Posts: 3
Joined: Wed Jan 08, 2014 7:52 am

Re: RPi Cam Web Interface

Sun Mar 23, 2014 10:21 am

Great use of motion that really works. Can you explain how to store captured videos on a FAT32 USB drive? Thanks,

silvanmelchior
Posts: 76
Joined: Mon Nov 25, 2013 5:56 pm

Re: RPi Cam Web Interface

Sun Mar 23, 2014 10:01 pm

Update: Version 4.0

After many hours of programming it's now possible that the startup-settings of the camera and interface can be configured over the config-file /etc/raspimjpeg. Additionally are may new settings available, including video and image resolution+framerate, shutter speed, image effects, ...

To update, run the following commands:

Code: Select all

git pull origin master
./RPi_Cam_Web_Interface_Installer.sh install
./RPi_Cam_Web_Interface_Installer.sh start
The default config-file /etc/raspimjpeg looks like this:

Code: Select all

################################
#  Config File for raspimjpeg  #
################################
# Syntax: "Command Param", no spaces before/after line allowed

#
# Camera Options
#
sharpness 0
contrast 0
brightness 50
saturation 0
iso 0
metering_mode average
video_stabilisation false
exposure_compensation 0
exposure_mode auto
white_balance auto
image_effect none
colour_effect_en false
colour_effect_u 128
colour_effect_v 128
rotation 0
hflip false
vflip false
sensor_region_x 0
sensor_region_y 0
sensor_region_w 65536
sensor_region_h 65536
shutter_speed 0
raw_layer false

#
# Preview Options
#
# fps_preview = video_fps (below) / divider
#
width 512
quality 25
divider 1

#
# Video Options
#
video_width 1920
video_height 1080
video_fps 25
video_bitrate 17000000
MP4Box true
MP4Box_fps 25

#
# Image Options
#
image_width 2592
image_height 1944
image_quality 85

#
# File Locations
#
# preview path: add %d for number
# image+video path: add %d for number, year, month, day, hour, minute, second
#
preview_path /dev/shm/mjpeg/cam.jpg
image_path /var/www/media/image_%04d_%04d%02d%02d_%02d%02d%02d.jpg
video_path /var/www/media/video_%04d_%04d%02d%02d_%02d%02d%02d.mp4
status_file /var/www/status_mjpeg.txt
control_file /var/www/FIFO

#
# Autostart
#
# autostart: standard/idle
# motion detection can only be true if autostart is standard
#
autostart standard
motion_detection false
Try it out and please let me know if it works for you

@Questionario: I bought the Pi-Pan (http://openelectrons.com/index.php?modu ... PAGE_id=15), because it seems pretty cool. As soon as I get it and find the time, I'm going to program a pan/tilt-control on the website incl. the ability to turn on/off the light.

User avatar
slabua
Posts: 95
Joined: Tue Sep 11, 2012 7:00 pm
Contact: Website

Re: RPi Cam Web Interface

Sun Mar 23, 2014 10:40 pm

@silvanmelchior I just updated it and I get this error when trying to start it:

Code: Select all

*** glibc detected *** raspimjpeg: double free or corruption (out): 0x011bb5b0 ***
also, everytime I try to run it and I get the above error, a .part file is created, and tree shows them as:

Code: Select all

tree *part
\26672361210\26672361210 [error opening dir]
\26672362210\26672362210\22160750\22160750\22160011\22160025\22160041\22160055\22160071ɉ\26672361210\26672361210 [error opening dir]

0 directories, 0 files
Not sure what's going on, am I missing some newly required libs maybe?

UPDATE: Sorry, my bad! Since I'm using lighttpd, I usually do the install procedure of copying files by hand, and I misplaced the /etc/raspimjpeg file to /etc/raspimjpeg/raspimjpeg, my apologies. It's working fine now : )
Salvatore La Bua - www.slblabs.com
DICGIM - University of Palermo, Italy

0lly
Posts: 77
Joined: Sun Mar 02, 2014 5:07 pm

Re: RPi Cam Web Interface

Mon Mar 24, 2014 4:46 pm

Motions detection not working (no videorecord) anymor.
How i can back to previous Version ?
Attachments
motion.JPG
motion.JPG (48.17 KiB) Viewed 10411 times

User avatar
slabua
Posts: 95
Joined: Tue Sep 11, 2012 7:00 pm
Contact: Website

Re: RPi Cam Web Interface

Mon Mar 24, 2014 5:04 pm

0lly wrote:Motions detection not working (no videorecord) anymor.
How i can back to previous Version ?
I can confirm motion is not working anymore for me either.
The problem lies in the image passed to motion that, for some reason, is now all grey (unable to open video device), but if I paste the neturl in the browser it works fine, I still don't get why then motion would read a grey image.
Screenshot from 2014-03-24 17.59.32 (copy).png
Screenshot from 2014-03-24 17.59.32 (copy).png (24.51 KiB) Viewed 10398 times
I also noticed that for at least some resolutions, like 640*480 and 1280*720 the ones I tested, doing a timelapse from the video settings (01 fps boxed to 30) yields to a black capture. Anyone else experiencing this too?
Salvatore La Bua - www.slblabs.com
DICGIM - University of Palermo, Italy

User avatar
leol
Posts: 146
Joined: Fri Jan 13, 2012 4:27 pm
Location: Haute-Vienne, France

Re: RPi Cam Web Interface

Mon Mar 24, 2014 5:26 pm

preview does not alter when you change the Preview FOV

Leo

0lly
Posts: 77
Joined: Sun Mar 02, 2014 5:07 pm

Re: RPi Cam Web Interface

Mon Mar 24, 2014 5:37 pm

if i start motion manualy i get

Code: Select all

[email protected] / $ motion /etc/motion/motion.conf
[7100232] Processing thread 0 - config file /etc/motion/motion.conf
[7100232] Motion 3.2.12 Started
[7100232] ffmpeg LIBAVCODEC_BUILD 3482368 LIBAVFORMAT_BUILD 3478785
[0] Thread 1 is from /etc/motion/motion.conf
[1] Thread 1 started
[1] netcam image height (385) is not modulo 16
[1] Could not fetch initial image from camera

User avatar
slabua
Posts: 95
Joined: Tue Sep 11, 2012 7:00 pm
Contact: Website

Re: RPi Cam Web Interface

Mon Mar 24, 2014 7:19 pm

In version 4.1 motion is working again, thanks @silvanmelchior :)
How about the timelapse issue?
Last edited by slabua on Mon Mar 24, 2014 7:26 pm, edited 1 time in total.
Salvatore La Bua - www.slblabs.com
DICGIM - University of Palermo, Italy

0lly
Posts: 77
Joined: Sun Mar 02, 2014 5:07 pm

Re: RPi Cam Web Interface

Mon Mar 24, 2014 7:22 pm

works also for me,thanks ;)

silvanmelchior
Posts: 76
Joined: Mon Nov 25, 2013 5:56 pm

Re: RPi Cam Web Interface

Mon Mar 24, 2014 7:42 pm

Update: 4.1

I found the bug, motion detection should work now for different resolutions

To update, run the following commands:

Code: Select all

./RPi_Cam_Web_Interface_Installer.sh install
./RPi_Cam_Web_Interface_Installer.sh start
If it still doesn't work, empty the cache of your browser. Still no success? Ensure you are running the latest soft- and firmware:

Code: Select all

sudo apt-get update
sudo apt-get dist-upgrade
sudo rpi-update
sudo reboot
If this still doesn't help, you might have an incompatible setup and so you might need to reinstall your RPi with a fresh Raspbian etc as explained in my first post step by step. I tested it with a second RPi and it worked.

@slabua: You're welcome. The bug with the black timelapse-capture seems to be a driver-problem, because raspivid -w 640 -w 480 -fps 1 -o test.h264 give's me a black preview, too. Anybody else the same thing?

@leol: I don't have this bug, maybe my instructions above help you to fix it. Or does anybody else have the same problem (preview doesn't change from 16:9 to 4:3 if you change the resolution from std FOV to full FOV for example?)

jarrah31
Posts: 124
Joined: Wed Oct 10, 2012 10:16 am

Re: RPi Cam Web Interface

Mon Mar 24, 2014 7:58 pm

silvanmelchior wrote:Update: Version 4.0

After many hours of programming it's now possible that the startup-settings of the camera and interface can be configured over the config-file /etc/raspimjpeg. Additionally are may new settings available, including video and image resolution+framerate, shutter speed, image effects, ...
Really great work, thank you very much for putting the time and effort into improving this fantastic application!

0lly
Posts: 77
Joined: Sun Mar 02, 2014 5:07 pm

Re: RPi Cam Web Interface

Mon Mar 24, 2014 8:08 pm

silvanmelchior wrote:The bug with the black timelapse-capture seems to be a driver-problem, because raspivid -w 640 -w 480 -fps 1 -o test.h264 give's me a black preview, too. Anybody else the same thing?
confirmed,the test.h264 is only 879 bytes.

User avatar
Trixster
Posts: 259
Joined: Sat Jul 07, 2012 3:53 pm

Re: RPi Cam Web Interface

Mon Mar 24, 2014 8:18 pm

Great update!

But what do I need to change

# Preview Options
#
# fps_preview = video_fps (below) / divider
#
width 512
quality 25
divider 1

to in order to set full fov 4:3 as the default preview size? I cant quite get it to work without an error message being thrown up.
Last edited by Trixster on Mon Mar 24, 2014 8:25 pm, edited 1 time in total.

User avatar
jbeale
Posts: 3360
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: RPi Cam Web Interface

Mon Mar 24, 2014 8:23 pm

silvanmelchior wrote:@slabua: You're welcome. The bug with the black timelapse-capture seems to be a driver-problem, because raspivid -w 640 -w 480 -fps 1 -o test.h264 give's me a black preview, too. Anybody else the same thing?
AFAIK that is a known issue. The slowest possible video is 2 fps, not 1 fps, some kind of MMAL limitation I guess.

The new RPi Cam Control page looks good. I did not get 4:3 full preview format either, it was stuck on the "STD" field of view and the "Custom Values" boxes were blank. Then I rebooted the Pi and after that I could get the full field of view and the values boxes were filled in. I did have to click on the "Load Preset: Select Option" pulldown before the boxes filled in. Note: during the install there was a complaint about not being able to remove symbolic link '/usr/bin/raspimjpeg' so I manually removed it, and then installed again.

Thanks again for your hard work silvanmelchior, I really appreciate the opportunity to save lower-res video (my old laptop has a hard time with playing full-HD).
Last edited by jbeale on Mon Mar 24, 2014 8:58 pm, edited 1 time in total.

User avatar
slabua
Posts: 95
Joined: Tue Sep 11, 2012 7:00 pm
Contact: Website

Re: RPi Cam Web Interface

Mon Mar 24, 2014 8:57 pm

Trixster wrote:Great update!

But what do I need to change
to in order to set full fov 4:3 as the default preview size? I cant quite get it to work without an error message being thrown up.
video_width and video_height
jbeale wrote: AFAIK that is a known issue. The slowest possible video is 2 fps, not 1 fps, some kind of MMAL limitation I guess.
Hm, though it works fine at native HD resolution.
Salvatore La Bua - www.slblabs.com
DICGIM - University of Palermo, Italy

User avatar
jbeale
Posts: 3360
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: RPi Cam Web Interface

Mon Mar 24, 2014 9:00 pm

According to JamesH, at least back in November there was a 2 fps limit on raspivid, if you try slower it gets forced to 2 fps (he thought):
http://www.raspberrypi.org/phpBB3/viewt ... 08#p453600

User avatar
slabua
Posts: 95
Joined: Tue Sep 11, 2012 7:00 pm
Contact: Website

Re: RPi Cam Web Interface

Mon Mar 24, 2014 9:07 pm

jbeale wrote:According to JamesH, at least back in November there was a 2 fps limit on raspivid, if you try slower it gets forced to 2 fps (he thought):
http://www.raspberrypi.org/phpBB3/viewt ... 08#p453600
Ah thanks, I wasn't aware of this. Although to my eye it seems that at least from the stream preview, 1 and 2 fps do look different.
Salvatore La Bua - www.slblabs.com
DICGIM - University of Palermo, Italy

jarrah31
Posts: 124
Joined: Wed Oct 10, 2012 10:16 am

Re: RPi Cam Web Interface

Mon Mar 24, 2014 9:19 pm

slabua wrote:
Trixster wrote:Great update!

But what do I need to change
to in order to set full fov 4:3 as the default preview size? I cant quite get it to work without an error message being thrown up.
video_width and video_height
Took me a moment to figure this one out too because it's not obvious that you need to change video_width and video_height to enable full FOV. I had to look at the index.html code to understand why.

Code: Select all

<option value="1920 1080 25 25 2592 1944">Select option...</option>
<option value="1920 1080 25 25 2592 1944">Std FOV</option>
<option value="1296 0730 25 25 2592 1944">16:9 wide FOV</option>
<option value="1296 0976 25 25 2592 1944">4:3 full FOV</option>
<option value="1920 1080 01 30 2592 1944">Std FOV, x30 Timelapse</option>
The first two numbers relate to video_width and video_height in the /etc/raspimjpeg config file, so by changing them to the 4:3 full FOV resolution, you'll get full FOV. e.g.

For Std FOV:

Code: Select all

#
# Video Options
#
video_width 1920
video_height 1080
video_fps 25
For 4:3 full FOV

Code: Select all

#
# Video Options
#
video_width 1296
video_height 976
video_fps 25
Hope that helps.

UPDATE: I've added this information to the Wiki as well.
Last edited by jarrah31 on Mon Mar 24, 2014 9:52 pm, edited 1 time in total.

jarrah31
Posts: 124
Joined: Wed Oct 10, 2012 10:16 am

Re: RPi Cam Web Interface

Mon Mar 24, 2014 9:27 pm

Just wondering whether this is an issue with my setup or not:

Basically in Night mode, my preview stream alternates between a very dark view of the scene and full night mode brightness. It seems to last 2 seconds in either mode and doesn't stay put in either. It does this even before enabling the Night Exposure Mode, and changing white balance to something other than auto makes no difference either.

It was doing this before the recent 4.x update, using the latest 3.x code. Performing a full dist-upgrade, rip-update, reboot, install updated raspimjpeg hasn't resolved it, so before I do a full reinstall I wanted to see if anyone else has a similar problem?

jarrah31
Posts: 124
Joined: Wed Oct 10, 2012 10:16 am

Re: RPi Cam Web Interface

Mon Mar 24, 2014 9:31 pm

silvanmelchior wrote: @Questionario: I bought the Pi-Pan (http://openelectrons.com/index.php?modu ... PAGE_id=15), because it seems pretty cool. As soon as I get it and find the time, I'm going to program a pan/tilt-control on the website incl. the ability to turn on/off the light.
I discovered Pi-Pan recently too and had thought about getting one, but I'm even more keen to buy it now that you plan to integrate pan/tilt control because that would be sooo amazing!! :)

User avatar
Trixster
Posts: 259
Joined: Sat Jul 07, 2012 3:53 pm

Re: RPi Cam Web Interface

Mon Mar 24, 2014 9:52 pm

jarrah31 wrote:
slabua wrote:
Trixster wrote:Great update!

But what do I need to change
to in order to set full fov 4:3 as the default preview size? I cant quite get it to work without an error message being thrown up.
video_width and video_height
Took me a moment to figure this one out too because it's not obvious that you need to change video_width and video_height to enable full FOV. I had to look at the index.html code to understand why.

Code: Select all

<option value="1920 1080 25 25 2592 1944">Select option...</option>
<option value="1920 1080 25 25 2592 1944">Std FOV</option>
<option value="1296 0730 25 25 2592 1944">16:9 wide FOV</option>
<option value="1296 0976 25 25 2592 1944">4:3 full FOV</option>
<option value="1920 1080 01 30 2592 1944">Std FOV, x30 Timelapse</option>
The first two numbers relate to video_width and video_height in the /etc/raspimjpeg config file, so by changing them to the 4:3 full FOV resolution, you'll get full FOV. e.g.

For Std FOV:

Code: Select all

#
# Video Options
#
video_width 1920
video_height 1080
video_fps 25
For 4:3 full FOV

Code: Select all

#
# Video Options
#
video_width 1296
video_height 976
video_fps 25
Hope that helps.
Thanks for the reply. I think the problem is that I'm using chrome on an ipad. Making the changes you suggest does not bring up full fov 4:3 as the default option for the live video, rather it just keeps the video the default aspect but also makes the video much much smaller. I'm talking about the live video on the options screen here, not the preview video you can view of a recording.

User avatar
slabua
Posts: 95
Joined: Tue Sep 11, 2012 7:00 pm
Contact: Website

Re: RPi Cam Web Interface

Mon Mar 24, 2014 10:00 pm

Trixster wrote:Thanks for the reply. I think the problem is that I'm using chrome on an ipad. Making the changes you suggest does not bring up full fov 4:3 as the default option for the live video, rather it just keeps the video the default aspect but also makes the video much much smaller. I'm talking about the live video on the options screen here, not the preview video you can view of a recording.
Did you restart raspimjpeg after changing the config file? Those options are for both the preview and the recording.
Salvatore La Bua - www.slblabs.com
DICGIM - University of Palermo, Italy

luxomattic
Posts: 1
Joined: Mon Mar 24, 2014 9:57 pm

Re: RPi Cam Web Interface

Mon Mar 24, 2014 10:03 pm

Hi,


Wonderful piece of software!

Would it be possible to add different filters to the image? Something like this maybe: http://camanjs.com/? I've seen something similar on the picam by adafruit: http://learn.adafruit.com/diy-wifi-rasp ... the-camera.

I'm very new to all this but looking forward to get more knowledge on the topic.

Kind regards

User avatar
Trixster
Posts: 259
Joined: Sat Jul 07, 2012 3:53 pm

Re: RPi Cam Web Interface

Mon Mar 24, 2014 10:04 pm

Yep, I'm doing sudo reboot after each edit of the config file.

User avatar
slabua
Posts: 95
Joined: Tue Sep 11, 2012 7:00 pm
Contact: Website

Re: RPi Cam Web Interface

Mon Mar 24, 2014 10:11 pm

Trixster wrote:Yep, I'm doing sudo reboot after each edit of the config file.
Hm, not sure then. It's sufficient to do the following, though:

Code: Select all

sudo ./RPi_Cam_Web_Interface_Installer.sh stop
sudo ./RPi_Cam_Web_Interface_Installer.sh start
Salvatore La Bua - www.slblabs.com
DICGIM - University of Palermo, Italy

Return to “Camera board”

Who is online

Users browsing this forum: No registered users and 12 guests