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

Re: RPi Cam Web Interface

Wed Jun 10, 2015 6:54 am

wb4dhc wrote:This looks perfect for our Time/Motion studies. Often when we record since the workcenter operator is aware of someone recording they modify their behavior. This is human nature. Being able to schedule start and stop capture times is critical to capturing a natural work performance. Has anyone made a mod to have more than 3 recording sessions? It looks like I'd need to use one line for the start time and one line to end the recording giving the 3 sessions.

Also, the boxing is great in that I can box at a different fps than recording. I would like to add 2 options to run in the background to yield 2 additional mp4 files (one fast to skim through the session and one slow to analyze motion) before deleting the h264 file. I haven't been able to find where that MP4Box background command is issued. Can someone please point me to the right file?

Thanks for the help. I don't want to "Reinvent the wheel" if someone has already done these things.
Robert
It would be fairly easy to expand the time periods from 6 upwards that is all in schedule.php, but it might be better to have a facility to set duration so that each session can be done on one line. I'll think about that.

The MP4Box command is issued by the core raspimjpeg program as it processes each captured h264 file. Currently the command line is built into that executable and is modified to include the relevant source and dest filenames and the Box fps.

It would be possible to make the command line a config option so that it could be edited, but then there are some other considerations; where does the other fps come from, what is the other dest file called, what visibility is there of more than one file in the web interface, and deleting both files when required. The last one would probably be the trickiest part. If one was just trying to produce 2 files but only one was viewable in web that wouldn't be so bad.

rmjspa
Posts: 13
Joined: Wed Jun 10, 2015 11:03 am

Re: RPi Cam Web Interface

Wed Jun 10, 2015 11:24 am

Hello,

since the new Update a few days ago I had several problems to install the RPI Cam Web Interface.

However it seems to work fine now.

But with the new update the Cam Web Interface hijack my apache web server.

I am unable to call any other website on Apache.

For example: the IP address ist 192.168.200.150 then I get immediately the RPI Cam Web Interface. Even I installed it in the folder /var/www/rcam. Other sites in /var/www/ or in /var/www/subfolder are ignored.

On the version before June 1st I not saw such behavior. For the Cam Page I hat to use 192.168.200.150/rcam/cam.jpg
And I was able to access also pages in different subfolders of www.

How can I stop hijacking my whole Apache thru RPI Cam Web Interface?

Thanks

User avatar
JeremPi
Posts: 24
Joined: Tue May 05, 2015 1:33 pm

Re: RPi Cam Web Interface

Wed Jun 10, 2015 12:40 pm

I have discovered Raspimjpeg few days ago.
I followed those commands :

Code: Select all

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

sudo ln -s /opt/vc/bin/raspimjpeg /usr/bin/raspimjpeg

mkdir -p /var/www/media
mkdir -p /dev/shm/mjpeg
mknod /var/www/FIFO p
chmod 666 /var/www/FIFO
I get a copy of this config file (in /etc/raspimjpeg) and I commented the lines which posed problems with a "# "
The only error I get now is :

Code: Select all

pi@raspberrypi:~$ raspimjpeg 
Segmentation fault
But, I wouldn't be here if it work, so what's the problem ?

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

Re: RPi Cam Web Interface

Wed Jun 10, 2015 1:31 pm

this thread is about the web interface, you download the pre-compiled version. that has always worked for me. check the instructions on the very first post in this thread.
http://elinux.org/RPi-Cam-Web-Interface

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

Re: RPi Cam Web Interface

Wed Jun 10, 2015 2:00 pm

btidey wrote:
wb4dhc wrote: Has anyone made a mod to have more than 3 recording sessions? It looks like I'd need to use one line for the start time and one line to end the recording giving the 3 sessions.
, but it might be better to have a facility to set duration so that each session can be done on one line. I'll think about that.
To help with this I have added an optional second parameter to ca 1 (start video commands). If present it specifies the duration of the video_capture in seconds.

So ca 1 600 will capture a 10 minute video.

This is implemented in raspimjpeg so available from anywhere. For example, a schedule period start command can now specify a video started together with a duration.

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

Re: RPi Cam Web Interface

Wed Jun 10, 2015 2:09 pm

JeremPi wrote:I have discovered Raspimjpeg few days ago.

But, I wouldn't be here if it work, so what's the problem ?
As jbeale said your best bet is to start with the full RPi_Cam_Web_Install.

If you then want to run raspimjpeg standalone then at least you are starting from a known set up.

Your specific issue may be something like missing stuff in raspimjpeg config (the one you got is quite old), or maybe a permissions problem.

Edit: You were also cloning from the silvanmelchior version of userland. The current 'official' version as worked on by silvan and myself is hosted at https://github.com/roberttidey/userland

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

Re: RPi Cam Web Interface

Wed Jun 10, 2015 3:02 pm

I'm still trying to embed my stream into a site, it's a Wix site and their support pages say they don't have a live streaming app on there web-editor but you could try via html I assume HTML5 but I'm not able to upload a .js file. Can anyone help on how I get the stream embedded with HTML5?

Edit: so far I'm managed to get a image loading when the page is loaded or refreshed... http://garylittlemore.wix.com/myrpicam
3b+, 2b, b+, b, Zero & Zero-W

wb4dhc
Posts: 10
Joined: Tue Jun 09, 2015 12:39 pm

Re: RPi Cam Web Interface

Wed Jun 10, 2015 7:02 pm

Thanks for the reply and quick update on the duration parameter. That'll get us six which should be fine at least at the beginning as it'll be more than can be analyzed during a day anyway. Regarding the h264 boxing. If the h264 file could be moved (mv) into a different directory instead of deleted after the boxing then I could use my own scripting to do further mp4 files at different speeds. Guess that would require an "Archive h264?" flag and either an "Archive directory" parameter or make it a fixed directory in media. If you don't see a wider application for that other than my one then please spend your time on updates that benefit more people. I'll check into the source code and try to make the change.
Robert
btidey wrote: It would be fairly easy to expand the time periods from 6 upwards that is all in schedule.php, but it might be better to have a facility to set duration so that each session can be done on one line. I'll think about that.

The MP4Box command is issued by the core raspimjpeg program as it processes each captured h264 file. Currently the command line is built into that executable and is modified to include the relevant source and dest filenames and the Box fps.

It would be possible to make the command line a config option so that it could be edited, but then there are some other considerations; where does the other fps come from, what is the other dest file called, what visibility is there of more than one file in the web interface, and deleting both files when required. The last one would probably be the trickiest part. If one was just trying to produce 2 files but only one was viewable in web that wouldn't be so bad.

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

Re: RPi Cam Web Interface

Wed Jun 10, 2015 9:50 pm

wb4dhc wrote:Thanks for the reply and quick update on the duration parameter. That'll get us six which should be fine at least at the beginning as it'll be more than can be analyzed during a day anyway. Regarding the h264 boxing. If the h264 file could be moved (mv) into a different directory instead of deleted after the boxing then I could use my own scripting to do further mp4 files at different speeds. Guess that would require an "Archive h264?" flag and either an "Archive directory" parameter or make it a fixed directory in media. If you don't see a wider application for that other than my one then please spend your time on updates that benefit more people. I'll check into the source code and try to make the change.
Robert
If you want to get the h264 and then box yourself at different speeds then you can do that today just by turning boxing off. Video captures will just be left as h264 in the normal video path. If you do this then in the web interface you can see the thumbnails of the captures and you can download the h264 files, but you can't play them from the web interface as that requires mp4 format.

If you want the h264 AND mp4 so the web side still works then that would require a change.

devilinside
Posts: 5
Joined: Fri Jun 12, 2015 12:46 pm

Re: RPi Cam Web Interface

Fri Jun 12, 2015 12:51 pm

I've installed the Project and did the Setup as instructed, i have the Apache starting on as by default to stream, i can access the Apache page and all that without Problem and see the cam streaming, until a certain point where i assume the PI crashes - i dont know why:

- i can neither Access the Apache stream after that nor the Pi via remote or Putty, its like frozen...

Anybody experienced the same? Suggestions...?

Addition: I have received the Pi just yesterday, so its complete fresh OS Installation + this Webcam + some Driver and OS updates, not more than that....

devilinside
Posts: 5
Joined: Fri Jun 12, 2015 12:46 pm

Re: RPi Cam Web Interface

Fri Jun 12, 2015 8:09 pm

Can someone help me with this:

I am try to setup the Scheduler to capture each of these periods a Video which is 1 hour Long, at each period end the cam should end previous file and start a new one therefore the 0/1 (see attachment).

I dont understand exactly the command references which might be the reason for the cam doing nothing, not starting first recording nor the next ones, should be a quick one for the experts here no?
scheduler.png
scheduler.png (11.74 KiB) Viewed 2603 times

User avatar
Lombra
Posts: 67
Joined: Tue Sep 16, 2014 12:41 am
Location: Sweden

Re: RPi Cam Web Interface

Sat Jun 13, 2015 1:19 am

Maybe slightly off topic, but I'm trying to make a HTML button that takes a picture (works), and afterwards display a popup that links to it. (and eventually the same for video) The problem is there's some delay after writing to FIFO before the file exists, so I can't tell at that point whether it exists or if it will anytime soon. I just realised there's the status file, though. Can I use it for this somehow?

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

Re: RPi Cam Web Interface

Sat Jun 13, 2015 8:14 am

devilinside wrote:Can someone help me with this:

I am try to setup the Scheduler to capture each of these periods a Video which is 1 hour Long, at each period end the cam should end previous file and start a new one therefore the 0/1 (see attachment).

I dont understand exactly the command references which might be the reason for the cam doing nothing, not starting first recording nor the next ones, should be a quick one for the experts here no?
scheduler.png
ca 0/1 is not a valid command. In the reference that is supposed to indicate ca 1 (starts) or ca 0 (stops).

You can do one of two things here.

If you do ca 0; ca 1. The command boxes can take multiple commands separated by a semicolon. If there are mutlipe commands then it issues them in sequence witha gap of about 2 seconds between each one.

The second method is to use a new facility recently added where you can optionally specify a duration as an extra parameter on a ca 1 command. So, for example ca 1 3555 will start a recording which will last just under an hour. If you do this then don't try to get it to the nearest second else you risk the next period starting before the capture has ended.

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

Re: RPi Cam Web Interface

Sat Jun 13, 2015 8:22 am

Lombra wrote:Maybe slightly off topic, but I'm trying to make a HTML button that takes a picture (works), and afterwards display a popup that links to it. (and eventually the same for video) The problem is there's some delay after writing to FIFO before the file exists, so I can't tell at that point whether it exists or if it will anytime soon. I just realised there's the status file, though. Can I use it for this somehow?
Yes. The status file is updated by raspimjpeg to indicate what it is doing. It is a text file with a single word (no line ending). Possible values are
ready
md_ready
image
video
timelapse
Error
halted

So in your case it would be in ready, then transition to image, and then revert to ready again. Note however, that there could be a delay of a few hundred millisecond between issuing a command and the status changing. So if you checked too quickly for 'ready' then you might see that even before it started taking the picture. If you were to issue the command, wait say 300mS, then start checking fro ready that should be safe.

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

Re: RPi Cam Web Interface

Sat Jun 13, 2015 8:25 am

devilinside wrote:I've installed the Project and did the Setup as instructed, i have the Apache starting on as by default to stream, i can access the Apache page and all that without Problem and see the cam streaming, until a certain point where i assume the PI crashes - i dont know why:

- i can neither Access the Apache stream after that nor the Pi via remote or Putty, its like frozen...

Anybody experienced the same? Suggestions...?

Addition: I have received the Pi just yesterday, so its complete fresh OS Installation + this Webcam + some Driver and OS updates, not more than that....
If you are still suffering from this my first suggestion would be power supply + USB power cable. The camera takes a bit of extra current. You need a good PSU plus a short thick USB lead that does not introduce to much drop under load.

devilinside
Posts: 5
Joined: Fri Jun 12, 2015 12:46 pm

Re: RPi Cam Web Interface

Sat Jun 13, 2015 9:19 am

btidey wrote:
devilinside wrote:I've installed the Project and did the Setup as instructed, i have the Apache starting on as by default to stream, i can access the Apache page and all that without Problem and see the cam streaming, until a certain point where i assume the PI crashes - i dont know why:

- i can neither Access the Apache stream after that nor the Pi via remote or Putty, its like frozen...

Anybody experienced the same? Suggestions...?

Addition: I have received the Pi just yesterday, so its complete fresh OS Installation + this Webcam + some Driver and OS updates, not more than that....
If you are still suffering from this my first suggestion would be power supply + USB power cable. The camera takes a bit of extra current. You need a good PSU plus a short thick USB lead that does not introduce to much drop under load.
Yes still experiencing this. Thank you for the hint, i will try another charger as next- have here a Nokia AC-10E lying- which should be fine i guess with 1200mA. Apart from the cam i have only the Edimax Wlan stick in there.
I have also a guess that the WLAN connection could be killing my PI accessibility, my router Shows that the wlan datarates are very low when i experience the issue that i can't access it anymore - while the PI is really not far from router (which is odd).
If the charger Change doesn't resolve the issue, i will try to Switch to LAN as next and Report back what of these helped or if not - see for further suggestions...

User avatar
Lombra
Posts: 67
Joined: Tue Sep 16, 2014 12:41 am
Location: Sweden

Re: RPi Cam Web Interface

Sat Jun 13, 2015 4:55 pm

btidey wrote:
Lombra wrote:Maybe slightly off topic, but I'm trying to make a HTML button that takes a picture (works), and afterwards display a popup that links to it. (and eventually the same for video) The problem is there's some delay after writing to FIFO before the file exists, so I can't tell at that point whether it exists or if it will anytime soon. I just realised there's the status file, though. Can I use it for this somehow?
Yes. The status file is updated by raspimjpeg to indicate what it is doing. It is a text file with a single word (no line ending). Possible values are
ready
md_ready
image
video
timelapse
Error
halted

So in your case it would be in ready, then transition to image, and then revert to ready again. Note however, that there could be a delay of a few hundred millisecond between issuing a command and the status changing. So if you checked too quickly for 'ready' then you might see that even before it started taking the picture. If you were to issue the command, wait say 300mS, then start checking fro ready that should be safe.
Thanks! Too bad with the delay, but okay. Had a look at the included status_mjpeg.php. Not sure how bad it would be to have that script constantly running. Would there be any case where status_mjpeg.txt would be unable to set the status to image after echoing the appropriate command to the pipe, assuming the status was ready at the time, and that there's no issue with the piping itself?

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

Re: RPi Cam Web Interface

Sat Jun 13, 2015 6:16 pm

Lombra wrote: Thanks! Too bad with the delay, but okay. Had a look at the included status_mjpeg.php. Not sure how bad it would be to have that script constantly running. Would there be any case where status_mjpeg.txt would be unable to set the status to image after echoing the appropriate command to the pipe, assuming the status was ready at the time, and that there's no issue with the piping itself?
raspimjpeg executable should be the only thing trying to write the file and set the status according to what is doing. So providing readers like status_mjpeg.php don't lock it then there shouldn't be any issue. In RPi Cam Web operation status_mjpeg.php only executes when the main web index page is open and it is called periodically by the index page to return the status which then sets the state of the buttons.

It might not be a great strategy to rely on seeing the status go to image. Although raspimjpeg will definitely set it to image, it will then set it back to ready a short time later so it might be possible to miss it depending on the timing of the checks. That is why I suggested waiting for a short delay till you know the command has been executed. The status file would then show either image because it was still in progress or ready because it had terminated. Video status is a little easier because the start and stop commands are separate so that you know a start will end up in video status and will stay there until a stop is issued.

devilinside
Posts: 5
Joined: Fri Jun 12, 2015 12:46 pm

Re: RPi Cam Web Interface

Sun Jun 14, 2015 8:32 am

Did anyone managed to get Audio streamed as well in this setup of the project with additional Hardware (ext. USB soundcard + micro?), any hints for that i would appreciate?
That's the only missing Piece here, otherwise very satisfied with the offering here!
Last edited by devilinside on Sun Jun 14, 2015 5:46 pm, edited 1 time in total.

devilinside
Posts: 5
Joined: Fri Jun 12, 2015 12:46 pm

Re: RPi Cam Web Interface

Sun Jun 14, 2015 8:34 am

devilinside wrote:
btidey wrote:
devilinside wrote:I've installed the Project and did the Setup as instructed, i have the Apache starting on as by default to stream, i can access the Apache page and all that without Problem and see the cam streaming, until a certain point where i assume the PI crashes - i dont know why:

- i can neither Access the Apache stream after that nor the Pi via remote or Putty, its like frozen...

Anybody experienced the same? Suggestions...?

Addition: I have received the Pi just yesterday, so its complete fresh OS Installation + this Webcam + some Driver and OS updates, not more than that....
If you are still suffering from this my first suggestion would be power supply + USB power cable. The camera takes a bit of extra current. You need a good PSU plus a short thick USB lead that does not introduce to much drop under load.
Yes still experiencing this. Thank you for the hint, i will try another charger as next- have here a Nokia AC-10E lying- which should be fine i guess with 1200mA. Apart from the cam i have only the Edimax Wlan stick in there.
I have also a guess that the WLAN connection could be killing my PI accessibility, my router Shows that the wlan datarates are very low when i experience the issue that i can't access it anymore - while the PI is really not far from router (which is odd).
If the charger Change doesn't resolve the issue, i will try to Switch to LAN as next and Report back what of these helped or if not - see for further suggestions...
Just to give Feedback - this is resolved, it was indeed the WLAN Connection. The camera got only an upload speed of unstable ~100KB which was too low to remain stable and use both (camera stream and access it) at the same time. With LAN i dont have any issues anymore.

Robin B
Posts: 4
Joined: Sat Jun 06, 2015 5:45 pm

Re: RPi Cam Web Interface

Sun Jun 14, 2015 11:08 am

Sorry for the delay in getting back to this thread. I'm happy to report my original problem is resolved. The answer, and a lesson for us all is, don't use Blue-Tack (TM) to stick your RPi camera board to a window! There's a tiny component on the camera module next to the camera itself which is not firmly attached to the board as it would appear on first inspection. It is in fact a connector which attaches the camera sensor to the board and upon pulling the camera board away from its (Blue-Tack (TM)) window fixing this connector simply gets "unplugged". To fix, it just needs a firm press until a distinct click is heard. This I think is as an important a warning as the one about electrostatic sensitivity and should be made "out of the box".

nospam
Posts: 54
Joined: Sun Jun 14, 2015 10:38 pm

Re: RPi Cam Web Interface

Sun Jun 14, 2015 10:50 pm

Are there problems installing the software on the new RasPi model 2?

I have an older version of RPi Cam Control software installed and working fine on an old rasPi B+.

I just got a new Pi2 and installed the latest RPi Cam Control software on the latest version of raspian. I can generate a raspistill image using a NOIRcam, save to /var/www and view that image in my web browser.

The RPi Cam Control software only displays "Loading" and won't show any image. If I manually copy a jpg file in the media folder it won't show up under "preview.php". I cannot get a screen snapshot via cam_pic.php (just shows an empty placeholder)

What gives?

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

Re: RPi Cam Web Interface

Sun Jun 14, 2015 11:38 pm

yes, the SUNY micro flex connector. one of the most common hardware problems with the camera.http://elinux.org/Rpi_Camera_Module#Troubleshooting

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

Re: RPi Cam Web Interface

Mon Jun 15, 2015 4:13 pm

nospam wrote:Are there problems installing the software on the new RasPi model 2?

I have an older version of RPi Cam Control software installed and working fine on an old rasPi B+.

I just got a new Pi2 and installed the latest RPi Cam Control software on the latest version of raspian. I can generate a raspistill image using a NOIRcam, save to /var/www and view that image in my web browser.

The RPi Cam Control software only displays "Loading" and won't show any image. If I manually copy a jpg file in the media folder it won't show up under "preview.php". I cannot get a screen snapshot via cam_pic.php (just shows an empty placeholder)

What gives?
There's no specific Pi2 issues are far as I know. However, there have been quite a few changes to installer so it's possible something is going wrong during that phase.

1. Were there any errors during the install?
2. Are you installing straight into /var/www or a sub-folder?
3. Are you using the default web port / no security or changing that during the install?

Further checks you can apply to see what may be going wrong.
a) Issue a ps -A command from a terminal. There should be two copies of raspimjpeg process running.
b) There should be a cam.jpg being continuously refreshed in the /dev/shm/mjpeg folder
c) The log in the scheduler set up also contains useful info on what may be happening.

You won't get anything to show up just by copying a random jpg into the media folder. The web bases all it's operation on the thumbnails which have to fit the name pattern used to show up.

nospam
Posts: 54
Joined: Sun Jun 14, 2015 10:38 pm

Re: RPi Cam Web Interface

Mon Jun 15, 2015 5:42 pm

To the previous poster who answered: I powered down the Pi2, reseated the cable connecters then powered back up. No difference. I can manually create snapshots using "sudo raspistill -v -o /var/www/test3.jpg" and view the results in my browser, but the RPi Cam Control web page only shows "Loading...".

1. Were there any errors during the install?
A. No
2. Are you installing straight into /var/www or a sub-folder?
A. Yes
3. Are you using the default web port / no security or changing that during the install?
A. Yes

>Further checks you can apply to see what may be going wrong.
>a) Issue a ps -A command from a terminal. There should be two copies of raspimjpeg process running.
A.No, no copies of raspimjpeg appear to be running.

b) There should be a cam.jpg being continuously refreshed in the /dev/shm/mjpeg folder
A.The file exists but I cant do anything with it nor can I access it from the browser as on my other Pi. When I try accessing cam.jpg from my browser I get the error "Forbidden. You don't have permission to access /cam.jpg on this server."

c) The log in the scheduler set up also contains useful info on what may be happening.
A. Which log specifically? Path and file please.

You won't get anything to show up just by copying a random jpg into the media folder. The web bases all it's operation on the thumbnails which have to fit the name pattern used to show up.
A. OK I will tweak that later

Return to “Camera board”