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

Re: RPi Cam Web Interface

Thu Jan 30, 2014 9:37 pm

It means that the program raspimjpeg, which interfaces with the camera, has ended. This would happen, as an example, if you use the webpage with the camera running and then start raspistill or raspivid from the command line. If you reboot the Pi it should work again.

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

Re: RPi Cam Web Interface

Thu Jan 30, 2014 11:07 pm

assuming that the "install" step was done so that /etc/rc.local is starting raspimjpeg in the first place...

samir_sogay
Posts: 17
Joined: Tue Jun 18, 2013 9:05 am

Re: RPi Cam Web Interface

Fri Jan 31, 2014 11:45 am

Could someone help me to change the source code so as to permanently change video fps to 25 from 30 as it is causing moving bands on recorded video.

tigroz
Posts: 7
Joined: Fri Jan 31, 2014 4:26 pm

Re: RPi Cam Web Interface

Fri Jan 31, 2014 4:37 pm

Hi, very good work!
I'm trying to configure to send an email automatically with the link to the video generated by following this guide:
http://jeremyblythe.blogspot.co.uk/2012 ... r-and.html
the script that upload the video on Google drive and send an email works indeed, but
but the problem it's that the motion.conf uses
on_event_end echo 'ca 0' > /var/www/FIFO
so if i use :
on_movie_end sudo python /etc/motion/uploader.py /etc/motion/uploader.cfg %f
it doesn't do nothing,
any clue?

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

Re: RPi Cam Web Interface

Fri Jan 31, 2014 7:00 pm

tigroz wrote:Hi, very good work!
I'm trying to configure to send an email automatically with the link to the video generated by following this guide:
http://jeremyblythe.blogspot.co.uk/2012 ... r-and.html
the script that upload the video on Google drive and send an email works indeed, but
but the problem it's that the motion.conf uses
on_event_end echo 'ca 0' > /var/www/FIFO
so if i use :
on_movie_end sudo python /etc/motion/uploader.py /etc/motion/uploader.cfg %f
it doesn't do anything...
Right, the 'motion' program does not realize that there is any video recording, it just sends some characters to the /var/www/FIFO pipe and the recording is done elsewhere (raspimjpeg). In the motion.conf file, "on_movie_end" applies only if you turned on the MPEG encoding option of "motion" and that by default is not on.

So what you need to do is modify "on_event_end" to not only send the 'ca 0' command to halt recording, but also send the email. So, something like

Code: Select all

on_event_end echo 'ca 0' > /var/www/FIFO && sudo python /etc/motion/uploader.py /etc/motion/uploader.cfg
Note that you cannot pass %f to your uploader.py script because "motion" did not record the video and does not know its filename. Your script will have to check for the most recent file in /var/www/media to find out what it is. That becomes another issue, because at that moment raspimjpeg closes out the raw .h264 it had been recording, it calls MP4Box to convert it to .mp4 format, which takes some seconds depending on length, and then deletes the .h264 file. So your script should either wait for MP4Box to complete its work, or substitue the .mp4 extension by itself in the email message, while realizing that the .mp4 file will not exist for some unknown period of time until MP4Box is done.

Thaui
Posts: 30
Joined: Thu Jan 16, 2014 8:32 pm
Location: Germany

Re: RPi Cam Web Interface

Sat Feb 01, 2014 2:23 pm

First of all I need to say excellent work but the latest version is not so stable than the previous one. I need to reboot my unit minimum once a day. It seems that MJEPG will be the problem but I am not sure. Best case is that the index page is frozen and the detection does not work. Mostly I can connect via SSH for rebooting the unit. But sometimes you need to power off the complete unit. Nothing was changed on the bare installation. Anybody else who has this behavior?

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

Re: RPi Cam Web Interface

Sat Feb 01, 2014 3:13 pm

I seem to have the same, although I'm struggling a bit from the start so I think I have some sort of power problem. Anyway the banding has gone for no apparent reason.

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

Re: RPi Cam Web Interface

Sat Feb 01, 2014 3:47 pm

BTW, is there a reason that the video is more contrasty than either the preview or the saved jpegs?
contrast.jpg
contrast.jpg (47.31 KiB) Viewed 7248 times

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

Re: RPi Cam Web Interface

Sat Feb 01, 2014 4:55 pm

samir_sogay wrote:Could someone help me to change the source code so as to permanently change video fps to 25 from 30 as it is causing moving bands on recorded video.
I'm also having banding problems (in the UK) so it would be interesting if this solves the problem.

On another note, when I take pictures the whole sensor appears to be used, yet the streaming video only shows a portion of that. Is this normal or can I tweak something to show the whole sensor area in the streaming video?

lagurus
Posts: 46
Joined: Wed Aug 07, 2013 8:02 am

Re: RPi Cam Web Interface

Sat Feb 01, 2014 9:20 pm

jarrah31 wrote:
samir_sogay wrote:Could someone help me to change the source code so as to permanently change video fps to 25 from 30 as it is causing moving bands on recorded video.
I'm also having banding problems (in the UK) so it would be interesting if this solves the problem.
No time to test it, but is seems that 30fps is hardcoded in source code. You can try to change line

Code: Select all

format->es->video.frame_rate.num = 30;
to

Code: Select all

format->es->video.frame_rate.num = 25;
There are two appearence, around line 256 and 270 of RaspiMJPEG.c.
jarrah31 wrote: On another note, when I take pictures the whole sensor appears to be used, yet the streaming video only shows a portion of that. Is this normal or can I tweak something to show the whole sensor area in the streaming video?
It's "normal" status. Now is no way to change.

unnamed7
Posts: 42
Joined: Mon Jun 18, 2012 8:44 pm

Re: RPi Cam Web Interface

Sat Feb 01, 2014 9:25 pm

thanks silvanmelchior for great app, installation went without any problems for me and everything is working great :)
i did small change to www interface using bootstrap and jquery, if anyone intersted i can upload my files somewhere, looks like this:
http://grid.stronazen.pl/rpi/RPi-Cam-Control_index.jpg
http://grid.stronazen.pl/rpi/RPi-Cam-Download-files.png
http://grid.stronazen.pl/rpi/RPi-Cam-Do ... review.jpg

itsmedoofer
Posts: 356
Joined: Wed Sep 25, 2013 8:43 am

Re: RPi Cam Web Interface

Sat Feb 01, 2014 9:34 pm

Sweet, would love a copy!

stefan.knight
Posts: 24
Joined: Tue Dec 17, 2013 7:43 pm

Re: RPi Cam Web Interface

Sat Feb 01, 2014 11:02 pm

unnamed7 wrote:thanks silvanmelchior for great app, installation went without any problems for me and everything is working great :)
i did small change to www interface using bootstrap and jquery, if anyone intersted i can upload my files somewhere, looks like this:
http://grid.stronazen.pl/rpi/RPi-Cam-Control_index.jpg
http://grid.stronazen.pl/rpi/RPi-Cam-Download-files.png
http://grid.stronazen.pl/rpi/RPi-Cam-Do ... review.jpg
awesome, I knew it was only a matter of time to make the UI incredible. I was thinking of doing some of it with DoJo, however no time as yet so this is great. Thank you.

Please post files in github or some other place where updates and be downloaded easily.

itsmedoofer
Posts: 356
Joined: Wed Sep 25, 2013 8:43 am

Re: RPi Cam Web Interface

Sat Feb 01, 2014 11:18 pm

I've got a bit of webspace would be more than happy to host.

samir_sogay
Posts: 17
Joined: Tue Jun 18, 2013 9:05 am

Re: RPi Cam Web Interface

Sun Feb 02, 2014 5:50 am

jarrah31 wrote:
samir_sogay wrote:Could someone help me to change the source code so as to permanently change video fps to 25 from 30 as it is causing moving bands on recorded video.
I'm also having banding problems (in the UK) so it would be interesting if this solves the problem.

On another note, when I take pictures the whole sensor appears to be used, yet the streaming video only shows a portion of that. Is this normal or can I tweak something to show the whole sensor area in the streaming video?
For banding, take 2 videos, 1 with 25 and 1 with 30 fps and you will see the difference. You can do this with raspivid. As for the streaming, Raspimjpeg uses a certain resolution (as given in the script) and the webpage has a certain width and height for video stream, tweak with those and see.

samir_sogay
Posts: 17
Joined: Tue Jun 18, 2013 9:05 am

Re: RPi Cam Web Interface

Sun Feb 02, 2014 5:52 am

lagurus wrote:
jarrah31 wrote:
samir_sogay wrote:Could someone help me to change the source code so as to permanently change video fps to 25 from 30 as it is causing moving bands on recorded video.
I'm also having banding problems (in the UK) so it would be interesting if this solves the problem.
No time to test it, but is seems that 30fps is hardcoded in source code. You can try to change line

Code: Select all

format->es->video.frame_rate.num = 30;
to

Code: Select all

format->es->video.frame_rate.num = 25;
There are two appearence, around line 256 and 270 of RaspiMJPEG.c.
jarrah31 wrote:
I have myself seen the source code and the lines you have quoted but since I am no expert on changing source codes and compiling it, could you please let me know how to go about it.

unnamed7
Posts: 42
Joined: Mon Jun 18, 2012 8:44 pm

Re: RPi Cam Web Interface

Sun Feb 02, 2014 4:46 pm

http://grid.stronazen.pl/rpi/rpi-cam-visual-pack.zip
just upload contents of .zip to var/www and delete default index.html
i haven't really tested it in all browsers but it should be ok since it's based on twitter bootstrap.
hope you like it :)

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

Re: RPi Cam Web Interface

Sun Feb 02, 2014 10:08 pm

I've had a go at changing the framerate from within the source code (thanks for the pointer lagurus), but it hasn't removed the banding unfortunately. Now it could very well be I've done something wrong, or perhaps not changed everything I should have, so here is what I did:

Obtained the source code from github:

Code: Select all

sudo apt-get install cmake
git clone https://github.com/silvanmelchior/userland.git
cd userland
Edited RaspiMJPEG

Code: Select all

sudo vim host_applications/linux/apps/raspicam/RaspiMJPEG.c
Searched for all entries that had "= 30" and replaced with "= 25". (I found 3 to 4 entries)

Made a copy of the original raspimjpeg:

Code: Select all

sudo cp /opt/vc/bin/raspimjpeg /opt/vc/bin/raspimjepg-orig
Then compiled and rebooted after it had finished (around 20-30 mins):

Code: Select all

./buildme

I can see that the raspimjpeg date has changed so it must have been updated, but it made no difference to the banding.

I found the only way to removing banding is using night mode when testing in the dark with an IR source. No idea why that stops the banding, as going back to Auto exposure causes it to appear again.

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

Re: RPi Cam Web Interface

Sun Feb 02, 2014 10:17 pm

I would expect banding on the image to be fundamentally a hardware issue, which may be influenced as a side-effect of various software configuration that exposes or hides the problem. Like a shutter speed or framerate that happens to integrate over an even multiple of cycles of the interfering signal. My first guess is an oscillating or noisy power supply; check it with a different power supply (and also in a different building, if you can). Second guess is interference from the board itself: try to get the camera's ribbon cable away from the board and any RF transmitters (wifi-USB, wifi hub etc) as much as possible.

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

Re: RPi Cam Web Interface

Sun Feb 02, 2014 10:21 pm

The banding you describe, visible in Auto but not in Night, is the exact same as I had. With me it started gradually after a few hours until in the end the SD card got corrupted.

Not sure what causes it, but I doubt it's net frequency as I never seen it before with the same Pi in the past month. My best guess at this moment is that the polyfuses degenerate when running the camera plus a WiFi dongle continuously. I did not come around to try feeding the Pi (original rev1) through the GPIO pins as the wires I have that go onto the pins are too thin.

Not sure what model you use, but I guess you have too little power some way.

itsmedoofer
Posts: 356
Joined: Wed Sep 25, 2013 8:43 am

Re: RPi Cam Web Interface

Mon Feb 03, 2014 8:34 am

Post by unnamed7 » Sun Feb 02, 2014 5:46 pm
http://grid.stronazen.pl/rpi/rpi-cam-visual-pack.zip
just upload contents of .zip to var/www and delete default index.html
i haven't really tested it in all browsers but it should be ok since it's based on twitter bootstrap.
hope you like it :)
Many thanks, very much appreciated !!

tigroz
Posts: 7
Joined: Fri Jan 31, 2014 4:26 pm

Re: RPi Cam Web Interface

Mon Feb 03, 2014 10:55 am

itsmedoofer wrote:
Post by unnamed7 » Sun Feb 02, 2014 5:46 pm
http://grid.stronazen.pl/rpi/rpi-cam-visual-pack.zip
just upload contents of .zip to var/www and delete default index.html
i haven't really tested it in all browsers but it should be ok since it's based on twitter bootstrap.
hope you like it :)
Many thanks, very much appreciated !!

Hi, i've tested on Chrome 32 stable release on OSX and the video doesn't start, on Safari works but it's decentered,
on Android Chrome works but it's decentered,

unnamed7
Posts: 42
Joined: Mon Jun 18, 2012 8:44 pm

Re: RPi Cam Web Interface

Mon Feb 03, 2014 11:16 am

ok, i'll make a fix later, when i'am back home :)

edit//

i've tested my skin in chrome (v32.0.1700.102 on OSX Mavericks) and video starts fine for me. Settings were broken, but i took care of it now, and new files are uploaded to my webserver, same link as above.

Safari (v7.0.1 (9537.73.11)) on OSX Mavericks looks good, video feed is centered for me.

dunno why it's not ok for You :(
Last edited by unnamed7 on Mon Feb 03, 2014 5:28 pm, edited 1 time in total.

samir_sogay
Posts: 17
Joined: Tue Jun 18, 2013 9:05 am

Re: RPi Cam Web Interface

Mon Feb 03, 2014 4:52 pm

For those folks living in the countries with power lines at 50hz, you can use the below mentioned raspimjpeg which shoots videos at 25 fps rather than the default 30 fps. Also, following is the video which demonstrates the effects of line frequency on video, shooting at 30 fps in fluorescent light driven by 50Hz line causes moving bands on the video.

https://dl.dropboxusercontent.com/u/92299797/raspimjpeg
http://www.youtube.com/watch?v=wa7UG4EAZNA

tigroz
Posts: 7
Joined: Fri Jan 31, 2014 4:26 pm

Re: RPi Cam Web Interface

Mon Feb 03, 2014 5:50 pm

unnamed7 wrote:ok, i'll make a fix later, when i'am back home :)

edit//

i've tested my skin in chrome (v32.0.1700.102 on OSX Mavericks) and video starts fine for me. Settings were broken, but i took care of it now, and new files are uploaded to my webserver, same link as above.

Safari (v7.0.1 (9537.73.11)) on OSX Mavericks looks good, video feed is centered for me.

dunno why it's not ok for You :(
ok just a cache clean and the video recorded works now on chrome (v32.0.1700.102 on OSX Mavericks) .
the video it's decentered:
https://www.dropbox.com/s/oog6xvcc6z0sy ... .48.21.png

Return to “Camera board”