emphillips18
Posts: 15
Joined: Mon Jan 14, 2019 6:11 pm

Re: RPi Cam Web Interface

Wed Jan 23, 2019 4:09 am

I have tried looking through this thread but may not be using the right words.

Is there a way to set 10 minutes or so of no recording between motion detected events? We are trying to use time lapse and video for a project, but we want to maximize storage space and only need the beginning of the event. The problem we are having is that once the camera hits the max capture mode, it automatically is activated as another event and begins recording right after.

Any ideas? Thanks in advance.

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

Re: RPi Cam Web Interface

Wed Jan 23, 2019 2:33 pm

@Robert

I'm wanting to add a '+' in my annotation, but the plus symbol keeps getting removed. Am I not able to add special characters in the annotation?
3b+, 2b, b+, b, Zero & Zero-W

ras07
Posts: 67
Joined: Tue May 22, 2018 4:04 am

Re: RPi Cam Web Interface

Fri Jan 25, 2019 6:24 pm

Is there a way to make the default user level (when there is no login required) something other than the highest level?

My ultimate goal is to grant access level 2 to anybody with no login required, and then be able to log in and get access level 6. I think the latter is doable by setting up a separate Apache configuration on a different port (although I'm certainly open to suggestions if there's a better way). However I haven't been able to figure out how to grant only level 2 access when no login is required.

YummyMeat
Posts: 1
Joined: Sat Feb 02, 2019 8:46 pm

Re: RPi Cam Web Interface

Sat Feb 02, 2019 8:53 pm

Hi, sorry if this is the wrong place, but I am very new to this. I have been experimenting with this cam web interface to try to send a live feed of the camera to another computer and receive commands from the other computer. I currently am using buttons to do this and I am trying to run macros from those buttons, but I am having no luck. I want to be able to control some motors I have hooked up to the GPIO and I can do it locally on the computer through a program I wrote in python, but I haven't found a way for it to receive commands from another computer. I would like to do this either through a new app I will write on the other computer, or through a website. I have been trying to use the camera interface that this website provides, but I want to use keyboard input on the other computer to control a program on the raspberry pi that controls the GPIO and therefore the motor, and I am unsure of how to do this. I have done extensive research into this topic, but have not found a way to do it, and I am too new to python to develop something myself. If someone could just point me in the right direction, it would be much appreciated. Thank you!!

TLDR: I am looking for a way to control a raspberry pi's GPIO from another computer, while viewing the live camera feed.

ras07
Posts: 67
Joined: Tue May 22, 2018 4:04 am

Re: RPi Cam Web Interface

Thu Feb 07, 2019 10:52 pm

@emphillips18 - I'm doing something very similar; I'm using the macros to accomplish this. One example: edit (or create) the end_box.sh script in the /var/www/html/macros directory to add following:

Code: Select all

#!/bash/bin
echo 'md 0' > /var/www/html/FIFO
sleep 600
echo 'md 1' > /var/www/html/FIFO
Some caveats:
  • You may need to change the paths (/var/www/html/...) to match your installation
  • The macro scripts should be executable (e.g., run sudo chmod 744 /var/www/html/macros/end_box.sh )
  • The macro scripts should be owned by www-data (e.g., run sudo chown www-data:www-data /var/www/html/macros/end_box.sh )
  • Depending on your system you might need to set enforce_lf 1 in the raspimjpeg file for this to be reliable. This setting is only available in version 6.4.44 or later, and could possibly break other scripts or programs that write to the FIFO queue. (If you have scripts that use echo -n 'whatever' > /var/www/html/FIFO to issue commands, removing the -n parameter should make them compatible with the enforce_lf 1 directive.)
end_box.sh runs after "boxing" (essentially, the conversion of the video output from .h264 to .mp4). This process can take a few seconds, so it's possible for the motion detection to trigger before the script executes. You could put the above code in end_vid.sh to avoid this; if you do, you will probably want to put an ampersand in front of the macro definition in the System settings (accessible from the preview page*), or processing will stall while waiting for the script to finish running. (Also, using the env_vid.sh script may make it more likely that you'll need the enforce_lf 1 setting shown above, since your Pi will be working hard on the boxing process, and therefore the FIFO reader is more likely to time out and read a partial command.)

*At the moment I can't edit those settings through the UI on my system; could just be me. These can be manually edited in raspimjpeg directly, if necessary (or, more appropriately, added to uconfig manually).

oldjake
Posts: 90
Joined: Fri Aug 03, 2018 12:39 pm

Re: RPi Cam Web Interface

Fri Feb 15, 2019 5:07 pm

I've just installed a Samsung Smartthings hub and I'm using Action tiles to control everything. There's a tile that you can set up for media which is aimed at a camera feed but I just get a broken image all the time. In the config of ActionTiles, the checkbox I have ticked is:

This Media is an MJPEG video stream

I've tried all the combinations I can think of where ActionTiles is asking for the URL but I just get a broken image.

Has anyone done this? Or can they throw any light on it?

Cheers
A

Zuifer
Posts: 12
Joined: Mon Apr 16, 2018 11:02 pm

Re: RPi Cam Web Interface

Sat Feb 16, 2019 10:15 pm

Hi,
is it possible to have the webinterface running with motion detection and recording and all the features and parallel an output h.264 for piping constantly to vlc for archiving a rtsp h.264 Quality stream?

Is it difficult changing the code for this?
I mean there is an video buffer which loops the video. Can the stream copied to stout for piping to vlc?
There is also the possibility of constant recording which writes to sdcard. Can the output doubled for piping?
So..while motion detected recording enabled, using webinterface, an parallel h.264 output for piping.
I have no clue or an idea where to look.
Just asking, if this is a problem of just a couple of added code lines or a whole change of an architecture. :)

ras07
Posts: 67
Joined: Tue May 22, 2018 4:04 am

Re: RPi Cam Web Interface

Sun Feb 17, 2019 4:23 am

Zuifer wrote:
Sat Feb 16, 2019 10:15 pm
is it possible to have the webinterface running with motion detection and recording and all the features and parallel an output h.264 for piping constantly to vlc for archiving a rtsp h.264 Quality stream?
It looks like

Code: Select all

http://<IP>/cam_pic_new.php
will give you the mjpeg stream directly. I can open this as a network stream with VLC and view the feed. (I'm not familiar with how you would use VLC for archival, but assuming there is a way to do that, this should get it done for you.) All the normal web interface controls, motion detection, etc. function as normal.

Note that this can consume A LOT of bandwidth (assuming VLC isn't on the Pi) - potentially several times the bandwidth used by the standard preview in the web interface.

Take a look at https://elinux.org/RPi-Cam-Web-Interface#Data_Flow for more info.

Zuifer
Posts: 12
Joined: Mon Apr 16, 2018 11:02 pm

Re: RPi Cam Web Interface

Sun Feb 17, 2019 8:57 pm

Hi,
no this is not what i meant :)
I want the h.264 output of the camera as an live stream parallel to the webinterface with mjpeg.
I think there were decisions made for using mjpeg. My IP-Camera can do webinterface with mjpeg preview and 3 different solutions rtsp streams.
Is this possible with RPi Cam Web Interface?
It is not that easy to launch raspivid and the Web interface. Only one process can use the camera or gpu.
So there has to be a chance to do this in the code. I dont know where to look. My question is, is this even possible?
Can the code part of recording be changed in a way that it outputs to stout for piping to vlc?
Or can the buffer part (a ring array?) splitted to not only fill the preevent buffer, but also to stout for piping?
So where to look?

Can a novice do this or try this? Thinking of copy and paste, some typing and a wonder. :)

Loddi
Posts: 1
Joined: Mon Feb 18, 2019 6:34 pm

Re: RPi Cam Web Interface

Mon Feb 18, 2019 6:37 pm

Hey all, i prepared a working Image with Raspi Cam 6.4.43 Rasbian Stretch updated, Firewall and some more, HTTPS and Htacess for Download and free, to get the needed Htaccess user and password contact me
Link to download: http://linuxnet.ddns.net/RaspiliveCam6. ... 019.img.xz

Regards

flinxtmas
Posts: 1
Joined: Tue Feb 19, 2019 10:46 am

Re: RPi Cam Web Interface

Tue Feb 19, 2019 10:53 am

Hello!
Please, point me the files in repo, which contains source code of internal motion detection algorithm.

pjbca
Posts: 4
Joined: Sun Nov 18, 2018 9:16 pm

Re: RPi Cam Web Interface

Tue Feb 19, 2019 7:06 pm

I have RPi Cam Web Interface working great! Thanks!

I have a Win10 machine client that can use a web browser to view the video that the RPi Cam Web interface is serving, exactly as designed.

On that Win10 machine, I'd like to get a video stream that I can INPUT into gstreamer on the Win10 machine, so that eventually I can feed it into another Win10 application.

What would people recommend as a strategy for that?

pjbca
Posts: 4
Joined: Sun Nov 18, 2018 9:16 pm

Re: RPi Cam Web Interface

Tue Feb 19, 2019 7:43 pm

I have RPi Cam Web Interface working great.

On a web browser on Win10 client, I can see everything as designed in the web browser window, including the video preview.

Is there a way to get access to the video stream to feed it into gstreamer on the Win10 client machine? I want to then pipe it into another WIn10 application (Mission Planner, which is a drone control program and takes gstreamer output to display video).

What strategy would be best for this?

BellyButtonHole
Posts: 1
Joined: Sun Feb 24, 2019 8:17 am

Re: RPi Cam Web Interface

Sun Feb 24, 2019 8:31 am

Pretty new to this, and when the guide https://elinux.org/RPi-Cam-Web-Interface directs you to use the link http://ipAddress:port/subfolder ,i assumed it wanted you to sub in your ip/port .So i got no idea ho to tell what my port is, and i got no idea what the sub folder is. But i read the next line and it says that if you havent changed any it should be http://ipAdress ,yeah nah didnt work. both times comes up with "This site can’t be reached". couldmi get a hand?

oldjake
Posts: 90
Joined: Fri Aug 03, 2018 12:39 pm

Re: RPi Cam Web Interface

Sun Feb 24, 2019 3:21 pm

What IP are you using? Is it an internal one, or your public facing one? Which port and sub folder did you choose when you ran the setup script? If you chose Apache as the server, is Apache running?

feichter
Posts: 3
Joined: Fri Feb 07, 2014 2:18 pm

No connection from outside world

Tue Feb 26, 2019 3:38 pm

Hi All

I need some help, please.
The rpi_cam_web_interface is running well, but only on my internal ip address currently set on http://192.168.1.170:3638 . As you can see I've defined a port as 3638.
I have configured my router to forward to this port 3638. However, when I try to access my external ip with this port, it can't find it.

Is there a setting somewhere in rpi_cam_web_interface that needs to be changed for this to work??

P.S. I have another rpi (no rpi_cam_web_Interface) that I have also given a (different) port and I forward to that and that works absolutely fine.

Thanks for any help.

ras07
Posts: 67
Joined: Tue May 22, 2018 4:04 am

Re: No connection from outside world

Tue Feb 26, 2019 6:02 pm

feichter wrote:
Tue Feb 26, 2019 3:38 pm
The rpi_cam_web_interface is running well, but only on my internal ip address currently set on http://192.168.1.170:3638 . As you can see I've defined a port as 3638.
I have configured my router to forward to this port 3638. However, when I try to access my external ip with this port, it can't find it.

Is there a setting somewhere in rpi_cam_web_interface that needs to be changed for this to work??

P.S. I have another rpi (no rpi_cam_web_Interface) that I have also given a (different) port and I forward to that and that works absolutely fine.
There shouldn't be anything special you need to do with RPi-CWI to forward it externally. Some things to look at:
  • Double-check the Pi's IP. If you have it set up for DHCP, depending on your router, it might get a different IP after you reboot. Best to either configure it for a static IP or else configure your router to always issue it the same IP (if your router has that capability).
  • If you have a firewall installed on the Pi, make sure port 3638 is open for inbound TCP traffic (or temporarily turn the firewall off for testing purposes).
  • If you have customized your Apache configuration, be sure a virtualhost is defined that will respond to an external request (the default RPi-CWI config, which should be in /etc/apache2/sites-available/raspicam.conf, will have a section that starts with <VirtualHost *:3638> , which is fine for this).
  • Double-check your router config to be sure you have IPs, ports, etc. set correctly.
It should go without saying that you should have RPi-CWI installed with a strong password if you are exposing it to the internet. also, if you intend to set up multiple users with different permissions, be sure you read and understand the security ramifications of this (see https://elinux.org/RPi-Cam-Web-Interfac ... _functions ).

jokkemoose
Posts: 5
Joined: Mon Jan 30, 2017 8:37 pm

Re: RPi Cam Web Interface

Sun Mar 03, 2019 12:45 pm

Hi all,

For some reason I don't see the video's being created.
I see following logs:

Code: Select all

{2019/03/03 13:41:39} External motion detection started
{2019/03/03 13:41:39} h264 search /var/www/html/media/vi_0273_20190303_134139.mp4
{2019/03/03 13:41:39} recommended video buffer size 65536
{2019/03/03 13:41:39} h264 size set to 131072
{2019/03/03 13:41:39} recommended video buffers 1
{2019/03/03 13:41:39} h264 buffers set to recommended 1
but when I check /var/www/html/media or via the GUI, I don't see any movie.

Any idea?

J.

thelewiss
Posts: 11
Joined: Wed Oct 03, 2018 5:18 pm

Re: RPi Cam Web Interface

Sun Mar 03, 2019 4:09 pm

Hey all,

How do I change the path where the images are saved. I understood the line from the Wiki:
There are separate path settings for video, images and time lapse in the /etc/raspimjpeg config file.
but not
If you change the 'root' from the media folder in the web install then you also have to change that setting in the web side config.php.
and what's below it.

Can anyone explain if I have to do more than just edit /etc/raspimjpeg?

Thanks!

ras07
Posts: 67
Joined: Tue May 22, 2018 4:04 am

Re: RPi Cam Web Interface

Mon Mar 04, 2019 3:45 am

How do I change the path where the images are saved.
The wiki isn't the clearest on this. Look for the File Locations section in /etc/raspimjpeg; these are the settings you need to change. base_path is the install directory (default is /var/www/html but could be different depending on how you installed it); it's recommended that you don't mess with this as there are several other things you'd also have to change. media_path is the main media directory, and image_path, lapse_path and video_path are the paths for still images, time-lapses, and videos, respectively. (These should all be either in the media_path directory or else subdirectories of it; otherwise, certain functions misbehave.)

It doesn't seem to work right unless the media directory is a subdirectory of the base_path.

A typical thing to do would be to use a USB drive or network share to store media files (images, video, etc.). For example you could mount a USB drive to /var/www/html/media/usb, and then edit /etc/raspimjpeg as follows (replace the base directory /var/www/html/ as appropriate):

Code: Select all

image_path /var/www/html/media/usb/im_%i_%Y%M%D_%h%m%s.jpg
lapse_path /var/www/html/media/usb/tl_%i_%t_%Y%M%D_%h%m%s.jpg
video_path /var/www/html/media/usb/vi_%v_%Y%M%D_%h%m%s.mp4
Note that when you update RPi Cam Web Interface it overwrites /etc/raspimjpeg, so you'll have to re-create the changes. (The updater backs your old file to /etc/raspimjpeg.bak, but you'll need to do a compare to make sure nothing new has been added/changed to /etc/raspimjpeg.)

All things considered it's probably best to not try to change the configuration at all, but just mount your desired device directly to /var/www/html/media.

champloo
Posts: 1
Joined: Fri Mar 08, 2019 10:07 am

Re: RPi Cam Web Interface

Fri Mar 08, 2019 10:09 am

Good day.
I have problem after isntall:

Code: Select all

199.199.199.150/:7 Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://199.199.199.150:8080/css/style_minified.css".
199.199.199.150/:8 Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://199.199.199.150:8080/css/es_Default.css".
style_minified.js:1 Uncaught SyntaxError: Unexpected token <
script.js:1 Uncaught SyntaxError: Unexpected token <
pipan.js:1 Uncaught SyntaxError: Unexpected token <
VM225:1 Uncaught SyntaxError: Unexpected token ,
RPi Cam Control v6.4.49_ mycam@osmc - Google Chrome 2019-03-08 13.08.40.png
RPi Cam Control v6.4.49_ mycam@osmc - Google Chrome 2019-03-08 13.08.40.png (66.66 KiB) Viewed 3380 times

tk1
Posts: 12
Joined: Sat Apr 06, 2013 3:46 pm

Re: RPi Cam Web Interface

Mon Mar 11, 2019 12:24 am

For the last few weeks (in my spare time), I've been trying to figure out how to get a video file from the time-lapse images. I finally figured it out (for me, the option to do it from within the otherwise excellent picam software wouldn't work).

Anyone wanting to convert the time-lapse images to an mp4, try this:

Remote to your Pi (either SSH or VNC and open a terminal), then enter this command:

Code: Select all

/usr/bin/ffmpeg -f image2 -framerate 10 -i "/var/www/html/media/tl_0000_%04d*.jpg" -r 30 -pix_fmt yuv444p -vcodec mpeg4 Documents/timelapse.mp4
Where:
-f = force format, 'image2'
-framerate = input frame rate (per second)
-i = input file(s)
%04d = 4 decimal characters (e.g. 0001) NOTE: input file must be in double quotes
-r = output frame rate (per second)
-pix_fmt = output format
-vcodec = output codec

This will create a file, timelapse.mp4, in your Documents folder.

Hope this helps and saves people the time/effort it took me to work this out.

-tk1

User avatar
HermannSW
Posts: 1666
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: RPi Cam Web Interface

Mon Mar 11, 2019 1:03 am

Thanks, good to know how to do that with ffmpeg ‒ can be done with gstreamer's multifilesrc as well:
https://github.com/Hermann-SW/fork-rasp ... w2ogg2anim
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

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

Re: RPi Cam Web Interface

Mon Mar 11, 2019 6:42 pm

I’ve just done a fresh install on the new bigger MicroSD card and I’m using the internal motion setting, I’m getting recordings with long times 200s+

I forgot to take note of what my setting were before doing the install.

What are people’s internal motion setting please and I’ll try and reset them again, no idea why it’s not working with the default but I remembered I had to change the setting last time I installed a fresh build.
3b+, 2b, b+, b, Zero & Zero-W

ricolk
Posts: 1
Joined: Sun Aug 26, 2018 11:34 pm

Re: RPi Cam Web Interface

Mon Mar 11, 2019 7:53 pm

@Gary Littlemore
I’ve just done a fresh install on the new bigger MicroSD card and I’m using the internal motion setting, I’m getting recordings with long times 200s
You could recover your setting from your old SD if you did't format it.


I'm trying to manage RPi Cam Web Interface process with pm2, to ensure continuous operation also after fails or restart.

I created a .sh script with start.sh content:

Code: Select all

#Debug enable next 3 lines
exec 5> start.txt
BASH_XTRACEFD="5"
set -x

cd $(dirname $(readlink -f $0))

source ./config.txt

fn_stop ()
{ # This is function stop
   sudo killall raspimjpeg 2>/dev/null
   sudo killall php 2>/dev/null
   sudo killall motion 2>/dev/null
}

#start operation
fn_stop
sudo mkdir -p /dev/shm/mjpeg
sudo chown www-data:www-data /dev/shm/mjpeg
sudo chmod 777 /dev/shm/mjpeg
sleep 1;sudo su -c 'raspimjpeg > /dev/null &' www-data
if [ -e /etc/debian_version ]; then
   sleep 1;sudo su -c "php /var/www/$rpicamdir/schedule.php > /dev/null &" www-data
else
   sleep 1;sudo su -c '/bin/bash' -c "php /var/www/$rpicamdir/schedule.php > /dev/null &" www-data
fi
and then I lunch with pm2 the script:

Code: Select all

pm2 start start.sh
But when the script finishes, pm2 detect the exit value and it restarts the process every second.

How can I implement it?
How can I lunch RPi Cam Web Interface with pm2?

Thanks in advance,
Ricolk

Return to “Camera board”