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

Re: RPi Cam Web Interface

Mon Mar 17, 2014 5:26 pm

silvanmelchior wrote:It's now possible to record videos with the full FOV (1296x976 px) or a wider FOV (1296x730 px) than standard. Of course is a 1080p video capture with the standard FOV still possible. The desired FOV can be chosen in the settings. By the way, motion detection is now also available for the full FOV.

Great job, thank you for this very nice feature improvement!

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

Re: RPi Cam Web Interface

Mon Mar 17, 2014 6:39 pm

slabua wrote:
poing wrote:The new update works, but what suddenly changed is that the 'Night' setting doesn't give a good exposed image any more. This must be due to the RaspCam Web Interface as it worked with the previous update but now doesn't any more and I didn't update the firmware in between. It also didn't work with the update before the previous one.
I'm having the same issue. With version 3.0 (no full fov) I get clear images and it seems to correctly pick up the auto white balance. With version 3.2, instead, my images are really dark and overly yellow, and also as quoted above, the Night setting seems to do nothing. Does anyone else have the same issue?

I have another thought/request, It would be nice to be able to choose among more (smaller) resolutions for the recorded images/videos, to possibly minimise the file size or just in case, for various reasons, the user wouldn't actually need that a high resolution.
Do you still have the original v3.0 to compare against? Can you see the difference just by swapping v3.0 with v3.2 of raspimjpeg in /opt/vc/bin? This is something I want to do but can't get hold of the original v3 raspimjpeg command to test.

I don't think the actual code changes between the versions of raspimjpeg would be causing the Night setting issues because when I try to compile the command by itself it complains that lots of dependancies are required. It seems you need to have the entire Raspberry Pi userland source code (git clone https://github.com/silvanmelchior/userland.git) on the Pi in order to compile raspimjpeg, so my theory is that some other source code file changed, and that by compiling a new version of raspimjpeg it pulls in these other files to make the final program, resulting in a bodged Night mode.

Please correct me if I'm wrong because I'm new to C compiling, but it seems raspimjpeg requires a lot of other files in order to compile...

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

Re: RPi Cam Web Interface

Mon Mar 17, 2014 6:53 pm

jarrah31 wrote:Do you still have the original v3.0 to compare against? Can you see the difference just by swapping v3.0 with v3.2 of raspimjpeg in /opt/vc/bin? This is something I want to do but can't get hold of the original v3 raspimjpeg command to test.
Yes, I switched between them several times, just to be sure it wasn't placebo effect, and the white balance plus auto exposure are working far better in 3.0 than in 3.2.
You can get the raspimjpeg v3.0 by reverting the git repo with:

Code: Select all

git reset --hard 34cd952
get the binary and then update the repo again with:

Code: Select all

git pull
jarrah31 wrote:I don't think the actual code changes between the versions of raspimjpeg would be causing the Night setting issues because when I try to compile the command by itself it complains that lots of dependancies are required. It seems you need to have the entire Raspberry Pi userland source code (git clone https://github.com/silvanmelchior/userland.git) on the Pi in order to compile raspimjpeg, so my theory is that some other source code file changed, and that by compiling a new version of raspimjpeg it pulls in these other files to make the final program, resulting in a bodged Night mode.

Please correct me if I'm wrong because I'm new to C compiling, but it seems raspimjpeg requires a lot of other files in order to compile...
I would agree on this part too.
Salvatore La Bua - www.slblabs.com
DICGIM - University of Palermo, Italy

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

Re: RPi Cam Web Interface

Mon Mar 17, 2014 9:00 pm

I've tried using "git reset --hard 34cd952", but it doesn't change the raspimjpeg version for me (do you get the jarrah31/patch-1 as well? Just wondered if it's coincidence based on the minor bug fix I made to the installer):

Code: Select all

pi@raspberrypi ~/RPi_Cam_Web_Interface $ git reset --hard 34cd952
HEAD is now at 34cd952 Merge pull request #2 from jarrah31/patch-1
pi@raspberrypi ~/RPi_Cam_Web_Interface $ git pull
Updating 34cd952..dce7a44
Fast-forward
 RPi_Cam_Web_Interface_Installer.sh |    1 -
 bin/raspimjpeg                     |  Bin 29543 -> 29371 bytes
 www/Version.txt                    |    2 +-
 www/index.html                     |   14 ++++++++++++--
 www/script.js                      |   50 +-------------------------------------------------
 5 files changed, 14 insertions(+), 53 deletions(-)
 mode change 100644 => 100755 bin/raspimjpeg
pi@raspberrypi ~/RPi_Cam_Web_Interface $ cd bin/
pi@raspberrypi ~/RPi_Cam_Web_Interface/bin $ ./raspimjpeg --version
RaspiMJPEG Version 3.2
I'm just about to try an old version of the raspimjpeg code (from 5th Jan 2014) that I've compiled with the latest set of dependant source code files to prove to myself that the Night mode has changed outside of raspimjpeg's control.

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

Re: RPi Cam Web Interface

Mon Mar 17, 2014 9:16 pm

jarrah31 wrote:I've tried using "git reset --hard 34cd952", but it doesn't change the raspimjpeg version for me (do you get the jarrah31/patch-1 as well? Just wondered if it's coincidence based on the minor bug fix I made to the installer):

Code: Select all

pi@raspberrypi ~/RPi_Cam_Web_Interface $ git reset --hard 34cd952
HEAD is now at 34cd952 Merge pull request #2 from jarrah31/patch-1
pi@raspberrypi ~/RPi_Cam_Web_Interface $ git pull
Updating 34cd952..dce7a44
Fast-forward
 RPi_Cam_Web_Interface_Installer.sh |    1 -
 bin/raspimjpeg                     |  Bin 29543 -> 29371 bytes
 www/Version.txt                    |    2 +-
 www/index.html                     |   14 ++++++++++++--
 www/script.js                      |   50 +-------------------------------------------------
 5 files changed, 14 insertions(+), 53 deletions(-)
 mode change 100644 => 100755 bin/raspimjpeg
pi@raspberrypi ~/RPi_Cam_Web_Interface $ cd bin/
pi@raspberrypi ~/RPi_Cam_Web_Interface/bin $ ./raspimjpeg --version
RaspiMJPEG Version 3.2
I'm just about to try an old version of the raspimjpeg code (from 5th Jan 2014) that I've compiled with the latest set of dependant source code files to prove to myself that the Night mode has changed outside of raspimjpeg's control.
Yes, I get your patch too.
I can't check in detail at the moment, but you can run git log and get any previous hash you may want to hard reset your repo to, and check the version again.
Later after university I'll get back to it :)
Salvatore La Bua - www.slblabs.com
DICGIM - University of Palermo, Italy

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

Re: RPi Cam Web Interface

Mon Mar 17, 2014 9:46 pm

I must admit I am puzzled why reverting https://github.com/silvanmelchior/RPi_Cam_Web_Interface gives you a working version of raspimjpeg because the compiled binary changes only started to be tracked when this GitHub was created. I know that myself and a few others experienced the poor Night mode after Silvanmelchoir's first raspimjpeg update (8th March) since January, which would have been overwritten to us on his server before it was tracked in GitHub.

Also looking at the source code, the change from v2.0 to v3.0 happened when time-lapse was implemented, and I certainly still have Night mode issues at this version as it's what I'm running at the moment.

Perhaps things have become even more worse with the new binary at v3.1 and v3.2 that I haven't seen, and in which case just ignore my mumblings above. :)

Anyway, I've been unable to test the old, newly compiled raspimjpeg code this evening because my remote Pi with IR failed to reboot for some reason, so have to check it in the morning...

It's a shame there's no obvious way to find out why Night mode is so poor now.

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

Re: RPi Cam Web Interface

Mon Mar 17, 2014 10:07 pm

I have put the v3.0 here http://www.slblabs.com/raspimjpeg30
Not much else I can check at the moment from phone, hope that helps :)
And besides the night mode, I really hope the auto exposure and awb get sorted as well. Indoor especially, even during daylight, the result is very dark and yellow. I'll see tomorrow if I can post some pics.
Last edited by slabua on Tue Mar 18, 2014 7:49 pm, edited 1 time in total.
Salvatore La Bua - www.slblabs.com
DICGIM - University of Palermo, Italy

User avatar
Mrbcsimpson
Posts: 17
Joined: Tue Jan 07, 2014 9:29 pm
Location: Lincolnshire, UK
Contact: Website

Re: RPi Cam Web Interface

Mon Mar 17, 2014 10:12 pm

Do we know if the Visual Pack still works on these recent updates?

yvonnezoe
Posts: 127
Joined: Thu Feb 14, 2013 2:10 am
Contact: Website

Re: RPi Cam Web Interface

Tue Mar 18, 2014 2:54 am

How do I use script_min.js in my own page? I remembered the last time I was here,I read it somewhere. Now i couldn't find it.
Just started my Raspberry Pi journey >> http://yvonnezoe.wordpress.com

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

Re: RPi Cam Web Interface

Tue Mar 18, 2014 5:13 am

yvonnezoe wrote:How do I use script_min.js in my own page? I remembered the last time I was here,I read it somewhere. Now i couldn't find it.
http://elinux.org/RPi-Cam-Web-Interface ... n_homepage
Salvatore La Bua - www.slblabs.com
DICGIM - University of Palermo, Italy

peere
Posts: 1
Joined: Tue Mar 18, 2014 10:56 am

Re: RPi Cam Web Interface

Tue Mar 18, 2014 10:58 am

Hi @all,

first - fine work!
I'm searching howto change the default folder for recording, found /var/www/media - but i want it on a mounted folder.

thx,
peter

yvonnezoe
Posts: 127
Joined: Thu Feb 14, 2013 2:10 am
Contact: Website

Re: RPi Cam Web Interface

Tue Mar 18, 2014 11:31 am

How can i change everything into jQuery mobile? I tried, but the words on the buttons are gone and they are no longer functioning. :(
Just started my Raspberry Pi journey >> http://yvonnezoe.wordpress.com

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

Re: RPi Cam Web Interface

Tue Mar 18, 2014 12:13 pm

script.js and script_min.js contain dedicated functions for this project. You can't replace them with jQuery.

yvonnezoe
Posts: 127
Joined: Thu Feb 14, 2013 2:10 am
Contact: Website

Re: RPi Cam Web Interface

Tue Mar 18, 2014 12:26 pm

poing wrote:script.js and script_min.js contain dedicated functions for this project. You can't replace them with jQuery.
thanks for informing or I might take forever to keep trying. :D If I were to just embed the live preview, will it work?
Just started my Raspberry Pi journey >> http://yvonnezoe.wordpress.com

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

Re: RPi Cam Web Interface

Tue Mar 18, 2014 12:43 pm

The minimum you need is this pasted somewhere in your page:

Code: Select all

  <script src="script_min.js"></script>
  <img id="mjpeg_dest">
  <script>setTimeout('init();', 100);</script>
You'll also need the files script_min.js and FIFO in the folder.
Last edited by poing on Tue Mar 18, 2014 1:48 pm, edited 2 times in total.

Gary Littlemore
Posts: 327
Joined: Thu Oct 11, 2012 11:52 am
Location: Cheshire, UK

Re: RPi Cam Web Interface

Tue Mar 18, 2014 12:47 pm

Just stumbled across this, Is there an updated complete how to or has the first post been updated as the project moves along?
3b+, 2b, b+, b, Zero & Zero-W

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

Re: RPi Cam Web Interface

Tue Mar 18, 2014 1:48 pm

Gary Littlemore wrote:Just stumbled across this, Is there an updated complete how to or has the first post been updated as the project moves along?
The latter. note that little line at the bottom of the first post:

Code: Select all

Last edited by silvanmelchior on 14 Mar 2014 15:36, edited 28 times in total. 

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

Re: RPi Cam Web Interface

Tue Mar 18, 2014 9:54 pm

UPDATE

I fixed the exposure settings-bug, so night-mode etc should work now in preview. Note that for the video recording, a fixed framerate of 25fps is set, so if you want to record a dark room you won't see a lot, where as in preview mode it might be that only 1fps is produced and so you'll see much more.

Update as usual:

Code: Select all

./RPi_Cam_Web_Interface_Installer.sh install
./RPi_Cam_Web_Interface_Installer.sh start
raspimjpeg --version should output 3.3

Important: If you cloned my userland-git-repo and compiled it, a lot of old stuff is installed now on your system (old versions of raspistill and raspivid for example), because I forked my repo a long time ago and updated only raspimjpeg. I did a complete update of everything else now, so please update your cloned version and rebuild:

Code: Select all

git pull origin master
./buildme

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

Re: RPi Cam Web Interface

Tue Mar 18, 2014 10:03 pm

Is the recording actually happening at 24 fps? I ask because it seems to me the playback is slightly slow-motion, as if it was recorded at 30 fps and played back at 24 fps (this is the version of raspimjpeg from several days ago).

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

Re: RPi Cam Web Interface

Tue Mar 18, 2014 10:10 pm

Yes, with the old version, I requested 30fps from the cam but it only delivered ca 27fps as I measured. MP4Box made 25fps out of it and so it was a bit slow motion. Now (v3.3) I request 25fps and get exactly 25fps, as measured and I even added "-fps 25" to the MP4Box command, so this problem should also be fixed

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

Re: RPi Cam Web Interface

Tue Mar 18, 2014 10:56 pm

Thanks, I just updated. For some reason it seems my load average is lower now; with motion detect on, 'top' reports 0.80 for long-term load average, whereas before I think it was 1.05 even without a remote host watching the live MJPEG web page. Maybe it is because MP4Box has less work to do when motion is detected, with fewer frames per second being recorded.

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

Re: RPi Cam Web Interface

Wed Mar 19, 2014 5:54 am

For what it's worth: I tried running the current (today's) version (RaspiMJPEG Version 3.3, /var/www/Version.txt = 3.2). I had motion detection at night with the "night" exposure selected. I ended up with a continuous cycle of motion being detected every 4 to 6 seconds, although the camera's view was completely unchanging. It seems to be caused by the transition from bright-image long-exposure MJPEG mode to shorter exposure 25 fps video-recording mode. I think the 'motion' program is detecting the brightness change (which happens over several frames every time video mode stops or start) as motion. So the end of one motion event quickly triggers the next one.

I was not able to fix it with "lightswitch 100" or "minimum_motion_frames 3" in /etc/motion/motion.conf
Maybe a higher setting for minimum_motion_frames would work, but at the cost of significant delay before any motion is detected and recorded. Probably I just have to accept that "night" mode is not suitable for motion detection.

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

Re: RPi Cam Web Interface

Wed Mar 19, 2014 2:00 pm

As a followup to my previous post, the problem may not be the gradual change in intensity. I changed the motion.conf file to save the first still image triggering motion detection,

Code: Select all

output_normal first
target_dir /var/www/media
and it is invariably a partial or incomplete image (see attached). There was a similar problem of grey blocks at the lower-right corner triggering motion, very early on with this program, but it had been fixed (I thought) by feeding the MJPEG to motion via the webserver ( http://localhost/ ) instead of direct through the filesystem. Also, this time the grey area (missing JPEG data) is nearly the entire image.

UPDATE: motion detection is working correctly this morning since the sun came up. All the problems happened in low-light before sunrise, so this may be somehow linked to shutter speed.
Attachments
16-20140319065316-00.jpg
16-20140319065316-00.jpg (6.42 KiB) Viewed 3236 times
Last edited by jbeale on Wed Mar 19, 2014 4:21 pm, edited 1 time in total.

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

Re: RPi Cam Web Interface

Wed Mar 19, 2014 2:09 pm

silvanmelchior wrote:UPDATE
I fixed the exposure settings-bug, so night-mode etc should work now in preview. Note that for the video recording, a fixed framerate of 25fps is set, so if you want to record a dark room you won't see a lot, where as in preview mode it might be that only 1fps is produced and so you'll see much more.
Fantastic news!! I'll try that tonight.

Out of interest, how did you fix the exposure bug because the only code changes I can see were related to the 25fps update?

Thanks.

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

Re: RPi Cam Web Interface

Wed Mar 19, 2014 4:51 pm

I still have exposure / white balance issues in 3.3 compared to 3.0, especially in low light conditions. Both pictures are taken without any artificial lighting. Night mode now works fine, but from the given pictures, I suppose that the Auto mode behaves now differently than before.

v3.0:
Image

v3.3:
Image
Salvatore La Bua - www.slblabs.com
DICGIM - University of Palermo, Italy

Return to “Camera board”