scanner
Posts: 15
Joined: Tue Dec 23, 2014 4:25 pm

Re: RPi Cam Web Interface

Tue Mar 03, 2015 5:27 pm

I seem to be having a problem with the web page interface in that I cannot change any of the resolution or time laps settings
I have been running the time laps with 63s intervals because I cannot get rid of the 3.for three days. I lost half a day due to the raspimjpeg crash. all my images are saved to a mounted windows server. the other problem I seem to have is the resolution, as it is so high each image is 2.5MB I plan to run this for about 2 weeks constant (on a bed of flowers)(aimed at) I want to keep the after process down to at least an hour or so, but at this rate it is going o take several months to compile and a few large hard drives.
any suggestions on how I can reduce the size and make these changes to the web interface

User avatar
mad-hatter
Posts: 419
Joined: Sun Feb 26, 2012 2:58 pm
Location: By the UK seaside

Re: RPi Cam Web Interface

Tue Mar 03, 2015 7:51 pm

Hello,
btidey wrote:Check out post in this thread from Sat Feb 28, 2015 2:18 am.
Some systems seem to show this but not all.
Sorry, should have had a better look.
Makes me feel better, that its not just me being silly.
I guess we had better hope for a fix.

Regards

btidey
Posts: 1631
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Wed Mar 04, 2015 11:47 am

scanner wrote:I seem to be having a problem with the web page interface in that I cannot change any of the resolution or time laps settings
I have been running the time laps with 63s intervals because I cannot get rid of the 3.for three days. I lost half a day due to the raspimjpeg crash. all my images are saved to a mounted windows server. the other problem I seem to have is the resolution, as it is so high each image is 2.5MB I plan to run this for about 2 weeks constant (on a bed of flowers)(aimed at) I want to keep the after process down to at least an hour or so, but at this rate it is going o take several months to compile and a few large hard drives.
any suggestions on how I can reduce the size and make these changes to the web interface
In settings you can customise the video and the image recording resolutions. By default the images are 2592x1944 giving large 3MB Jpegs but at full camera resolution. If you set image lower (e.g. 640x480) then the file size will be much less (300Kb for those) but obviously you are sacrificing quality.

If you use custom settings make sure all fields are filled in otherwise raspimjpeg can crash.

If you can't change any settings then you need to get to the bottom of that first.

edimi
Posts: 6
Joined: Wed Mar 04, 2015 8:15 am

Re: RPi Cam Web Interface

Wed Mar 04, 2015 1:37 pm

jbeale wrote:
anb8 wrote:I have one major problem with the motion detection with raspimjpeg. The thing is that this way it is not possible to record the video starting a few frames before the motion actually triggered the recording. ...Has anyone else encountered or dealt with this problem?
You are not the only one. I tried it today looking at the street. Cars passing would trigger motion detection, but by the time video recording started, the car was already past, so every video showed only the empty street.

The "raspivid" application has a feature using a built-in circular buffer so it can record at least several seconds of video before the trigger occurs (exact pre-roll time depends on the resolution). However, this would need to be combined with motion in some way. See for example: http://www.raspberrypi.org/forums/viewt ... 0&p=484954

Another alternative: the current version of MMAL-Motion (see: http://www.raspberrypi.org/forums/viewt ... 43&t=75240 ) does not use a circular buffer, but it uses a split-resolution strategy to enable good framerates. It can do motion detection at 15 fps on low-res frames, while simultaneously delivering much higher-res frames for recording. This doesn't give you images before the trigger, but the latency is a whole lot better.
hi,
i have the same problem. is there any improvement or solution on RaspiMJPEG?

chenks
Posts: 21
Joined: Mon Feb 02, 2015 9:50 am

Re: RPi Cam Web Interface

Wed Mar 04, 2015 3:12 pm

chenks wrote:i still can't get the settings (with RPi 4.0.3) to apply when using Chrome.

the following don't seem to work.
Chrome 40.x on mac
Chrome 40.x on android
Chrome 41.x (beta) on android

the following do work
Safari 8.0.3 on mac
Chrome 40.x on windows

can anyone offer any help on this?
no-one able to advise on this then?
is the developer still active in this thread?

btidey
Posts: 1631
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Wed Mar 04, 2015 7:59 pm

edimi wrote: hi,
i have the same problem. is there any improvement or solution on RaspiMJPEG?
I am not the original developer but have been working on improvements to the web pages in the areas of previews, motion settings and scheduled automation.

I am now looking at changing some parts of the raspimjpeg core itself to improve a few areas.

First making the thumbnail generation part of rapimjpeg to avoid delays in switching to preview.

Secondly, as mentioned Raspivid does have a facility to do circular buffering so that when it gets a trigger then you get the video before that trigger. I think if that functionality can be incorporated into raspimjpeg then pre motion trigger capture should be possible without significantly changing the basic motion / raspimjpeg interface.

I'm just starting on those but if the original developers or any other c programmers familiar with this stuff want to jump in then

btidey
Posts: 1631
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Wed Mar 04, 2015 8:09 pm

chenks wrote:
chenks wrote:i still can't get the settings (with RPi 4.0.3) to apply when using Chrome.

the following don't seem to work.
Chrome 40.x on mac
Chrome 40.x on android
Chrome 41.x (beta) on android

the following do work
Safari 8.0.3 on mac
Chrome 40.x on windows

can anyone offer any help on this?
no-one able to advise on this then?
is the developer still active in this thread?
Given that it is working on some browsers for you and not on others then I would start at the browser end. You can turn on developer tools in the browser to see what is going on.

The basic mechanism when a setting is changed is that the web page runs a bit of local javascript in script.js which in turn uses a send_cmd function in the javascript to send the changed parameters back by calling a web page at the server called cmd_pipe.php?cmd That php runs at the server to extract the changed parameters and then in turn sends the changes to raspimjpeg.

The fact that some browsers are working implies the server end is OK. It is more likely that something is stopping the javascript running properly and making the cmd_pipe server call successfully. The developer tools should allow this part to be checked and debugged.

scanner
Posts: 15
Joined: Tue Dec 23, 2014 4:25 pm

Re: RPi Cam Web Interface

Thu Mar 05, 2015 8:34 am

btidey wrote:
scanner wrote:I seem to be having a problem with the web page interface in that I cannot change any of the resolution or time laps settings
I have been running the time laps with 63s intervals because I cannot get rid of the 3.for three days. I lost half a day due to the raspimjpeg crash. all my images are saved to a mounted windows server. the other problem I seem to have is the resolution, as it is so high each image is 2.5MB I plan to run this for about 2 weeks constant (on a bed of flowers)(aimed at) I want to keep the after process down to at least an hour or so, but at this rate it is going o take several months to compile and a few large hard drives.
any suggestions on how I can reduce the size and make these changes to the web interface
In settings you can customise the video and the image recording resolutions. By default the images are 2592x1944 giving large 3MB Jpegs but at full camera resolution. If you set image lower (e.g. 640x480) then the file size will be much less (300Kb for those) but obviously you are sacrificing quality.

If you use custom settings make sure all fields are filled in otherwise raspimjpeg can crash.

If you can't change any settings then you need to get to the bottom of that first.
I can't change any of the settings as I cannot replace the current settings, all I can do is add numbers to the front of the current setting, Del won't delete and I cant place my cursor after the number to backspace. Im using firefox, when I tried with chrome the response was just unbearably slow

btidey
Posts: 1631
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Thu Mar 05, 2015 1:14 pm

scanner wrote: I can't change any of the settings as I cannot replace the current settings, all I can do is add numbers to the front of the current setting, Del won't delete and I cant place my cursor after the number to backspace. Im using firefox, when I tried with chrome the response was just unbearably slow
I think some other people have reported this.

Editing the entry settings on the main page is done within the browser until the OK button is pressed for that entry. At that point a request is sent back to the server.

So a problem editing these entries is likely a local browser based issue. These are standard HTML text entry boxes but with css styling applied.

Some possibilities here are

1) Browser is having problem with text entry boxes; pretty unlikely
2) Browser is having problem with the styling of the text entry boxes
3) Browser is so busy trying to get refreshes of the preview image from the server that it is interfering with the text entry

To help diagnose further, I attach a test zip containing a stripped version of the main page that can just be opened locally in a browser (e.g. right click the html and Open with)

It should show the just settings table of the main page. It doesn't show preview etc.

The entry boxes should be styled because the css is also included. If that allows normal entry then I suspect the cause is 3) and we would need to dig further.

If entry doesn't work then rename the css file to something else and re-open the html. You should now see the same table but no styling. If that works then the cause is 2)

If entry is still not possible even with no styling then there is something really weird going on.

I have also seen that the time lapse setting doesn't have an OK button and so doesn't work. I have updated the version in my fork so this does work. [Edit] This was wrong. The time lapse number is just a local browser thing and is only used when starting time lapse. I reverted this change.
Attachments
test.zip
(19.78 KiB) Downloaded 65 times

btidey
Posts: 1631
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Thu Mar 05, 2015 6:25 pm

I have made my first change to baseline raspimjpeg core in my fork.

This adds a new setting lapse_path to the config file and controls where time lapse images go.

Code: Select all

lapse_path /var/www/media/lapse_%04d_%04d_%04d%02d%02d_%02d%02d%02d.jpg
The naming to lapse_ means that these don't show up in preview web page which is normally a good thing.

The name also has an extra 4 digit field in its name lapse_image.count_lapse.count_date_time. The image.count is the same as the normal one-shot images but doesn't change within a lapse batch. The lapse.count starts at 0 for each batch and increments. This should make it easier to group items together. It may also allow say the first image of a lapse sequence to be shown in preview in the future.

If one puts lapse_path to null or any other short name then it will revert to the previous behaviour of sharing normal image naming.

Note that just like all the other settings lapse_path setting must be present in the config file or raspimjpeg may crash.

btidey
Posts: 1631
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Fri Mar 06, 2015 12:22 am

Second change to Raspimjpeg. This now generates the thumbnails for preview for both manual and motion triggered captures. This means there is no delay in going into preview as the thumbnails are already there.

There is an extra setting thumb_gen which controls whether thumbnails are generated for images, videos and time lapses. By default it does video and images.

The output_normal in motion.conf should now be off as motion is no longer required to generate thumbnails.

carlosgr
Posts: 2
Joined: Mon Mar 24, 2014 4:41 am
Location: Tijuana, Mexico
Contact: Website

Re: RPi Cam Web Interface

Fri Mar 06, 2015 3:26 pm

Excellent Work and Thanks for sharing !!!

One question here, is there a way to save the settings that are changed on the web interface ?

I mean Vertical Flip specifically , since every time I restart my PI have to do it manually.

Thanks again
------------------------------------------------
Carlos G.

btidey
Posts: 1631
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Fri Mar 06, 2015 4:23 pm

carlosgr wrote:One question here, is there a way to save the settings that are changed on the web interface ? [/color]

I mean Vertical Flip specifically , since every time I restart my PI have to do it manually.

Thanks again
Only way at the moment is to edit the default settings file in /etc/raspimjpeg.

However I like the idea of leaving the base defaults alone (like a factory setting) so I have been working on extra enhancement. It was beginning to irritate me, particularly as I am restarting so many times during development.

I have already updated raspimjpeg so that it reads the basic defaults (/etc/raspimjpeg) and can then read another file in the same format which can then overwrite selected values with specific preferences. The second user file is itself a new setting in the main default /etc/raspimjpeg called user_config. Currently I have that pointed to /var/www/uconfig

The idea here is then to let the web page commands add to this uconfig file as they are issued. The commands take immediate effect as they do now, but will then be reloaded when raspimjpeg starts up. I haven't done that bit yet.

piecam
Posts: 84
Joined: Mon Feb 23, 2015 12:55 am

Re: RPi Cam Web Interface

Fri Mar 06, 2015 7:23 pm

btidey,

It looks that vthumb is continuous being generated, even though I turned the "schedule" and "motion" .

What could be the problem?
thanks

piecam
Posts: 84
Joined: Mon Feb 23, 2015 12:55 am

Re: RPi Cam Web Interface

Fri Mar 06, 2015 7:26 pm

see above
Attachments
Screenshot.png
Screenshot.png (57.17 KiB) Viewed 2418 times

piecam
Posts: 84
Joined: Mon Feb 23, 2015 12:55 am

Re: RPi Cam Web Interface

Fri Mar 06, 2015 7:28 pm

Also, the video .mp4 can not be played using vlc. I chagned in setting to 1280x720. Any possible causes? tks

btidey
Posts: 1631
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Fri Mar 06, 2015 10:01 pm

piecam wrote:see above
Those thumb names were what I was using before when motion was generating some. Because motion didn't know what the video count number (second field) then it was left out. Preview then had to work a bit harder to associate the right thumbnail with the video and also had to take into account potentially a difference in the time stamps.

With the new scheme where all thumbnails are generated by raspimjpeg then all that is unnecessary. Thumbnails are all named the same as the original file (different prefix and extension). So for example a video thumbnail looks like

vthumb_0045_20150306_171221.jpg

Also the old preview.php generated a thumbnail if it was missing. That is no longer required.

So what you need to do is sync everything up to the fork. An install upgrade will change raspimjpeg, preview.php, and the raspimjpeg and motion etc settings.
Last edited by btidey on Fri Mar 06, 2015 10:04 pm, edited 1 time in total.

btidey
Posts: 1631
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Fri Mar 06, 2015 10:03 pm

piecam wrote:Also, the video .mp4 can not be played using vlc. I chagned in setting to 1280x720. Any possible causes? tks
Don't know about that one. Did you have settings that were working before? If so maybe revert to those and then change them one at a time.

So far none of the changes I have made from the original has affected the video recording or format.

btidey
Posts: 1631
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Fri Mar 06, 2015 11:50 pm

My fork now has version of raspimjpeg and a cmd_pipe.php (which processes the web commands).

These work together to save any camera settings changes made from the web into a uconfig file in /var/www/ This gets loaded when raspimjpeg restarts to restore those values.

It is still a bit experimental as although it works I haven't been through all the settings yet to confirm they all work. If there is a problem the fork still has the old cmd_pipe.php which could be manually restored.

piecam
Posts: 84
Joined: Mon Feb 23, 2015 12:55 am

Re: RPi Cam Web Interface

Sat Mar 07, 2015 1:56 am

HI robert,

so we do this to get updated version?

cd RPi_Cam_Web_Interface
git pull origin master
./RPi_Cam_Web_Interface_Installer.sh install
./RPi_Cam_Web_Interface_Installer.sh start

How do we check the version number to make sure it's your new version?

thanks in advance.

jazzyuk
Posts: 3
Joined: Sun Mar 01, 2015 12:37 pm

Re: RPi Cam Web Interface

Sat Mar 07, 2015 11:47 am

Hi,

I'm still having some issues with the preview resolution being the default 512px x 288px. I've gone to:

/home/pi/RPi_Cam_Web_Interface/etc/raspimjpeg/raspimjpeg

And changed the preview the settings to be:

Code: Select all


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

Then rebooted the pi, but the resolution stays the same...

Any help, greatly appreciated.

Regards

btidey
Posts: 1631
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Sat Mar 07, 2015 12:18 pm

piecam wrote:HI robert,

so we do this to get updated version?

cd RPi_Cam_Web_Interface
git pull origin master
./RPi_Cam_Web_Interface_Installer.sh install
./RPi_Cam_Web_Interface_Installer.sh start

How do we check the version number to make sure it's your new version?

thanks in advance.
Yes. That should be fine. If you already have an original one you might want to keep the installers in different folders so you can flip back and forward more easily. These folders just hold the installation files. There are no operating files in these locations once installed.

I haven't changed the version number yet, but I'll start doing that. You can tell its the modified one running as it has the extra buttons on the main page for motion and scheduling settings.

btidey
Posts: 1631
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Sat Mar 07, 2015 1:01 pm

jazzyuk wrote:Hi,

I'm still having some issues with the preview resolution being the default 512px x 288px. I've gone to:

/home/pi/RPi_Cam_Web_Interface/etc/raspimjpeg/raspimjpeg

And changed the preview the settings to be:

Code: Select all


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

Then rebooted the pi, but the resolution stays the same...

Any help, greatly appreciated.

Regards
Editing the set up in the install folder will have no effect unless you re-install. These files are just copied to their operational directories. In the case of the raspimjpeg that is /etc/raspimjpeg (file not folder). If you edit it there it should work.

The preview settings in the raspimjpeg config should control the width of the stream of cam.jpg files which are being generated by raspimjpeg in the /dev/shm/mjpeg folder. The height is calculated depending on the video format. These files are then used by motion (for movement detection) and by the main web page to give the front screen live display. This page is basically just continuously fetching updated versions of this file, effectively a mjpeg stream.

The size of the cam.jpg image should also affect the size seen in the web page. It does on my systems. You can also click the image to go between normal and full screen view but this does not affect the underlying resolution; t is just being scaled by the browser.

Note you don't have to reboot the Pi after changing that setting, you just need to stop and start the raspimjpeg system. If the web page is still up then you see the change immediately.

To stop and start use the Installer script and put stop or start on the end.

Code: Select all

./RPi_Cam_Web_Interface_Installer.sh stop
If, like me, you do this a lot then it is worth while making a link in say /usr/bin to this. I have rpi.sh doing the same thing.

Note also I wouldn't set preview too large if doing motion detection; it will give motion a lot more work to do. The idea here is to get a reasonable preview and enough resolution fo rmotion. THe resolution of real captures and video recordings can be much higher as they don't go anywhere near motion.

Gawan
Posts: 12
Joined: Sat Mar 07, 2015 5:47 pm

Re: RPi Cam Web Interface

Sat Mar 07, 2015 5:49 pm

Hi,

i did the intial installation and evertything worked fine.
But after a restart of my RaspPi I get the error message:

Error in RaspiMJPEG: Could not set annotation

End when I try to RPi_Cam_Web_Interface_Installer.sh start then I get this error message:

pi@raspberrypi ~/RPi_Cam_Web_Interface $ mmal: mmal_vc_port_parameter_set: failed to set port parameter 64:0:ENOSYS
Error: Could not set annotation

Can anyone help me please ??

BR
Gawan

Gawan
Posts: 12
Joined: Sat Mar 07, 2015 5:47 pm

Re: RPi Cam Web Interface

Sat Mar 07, 2015 6:04 pm

Does anyone know why the datetime on top of the picture is flickering all the time ?
it seems as if the font would change between larger and smaller approx. 10 times a second ... quite annoying :)

Return to “Camera board”