ronnyvdbr
Posts: 68
Joined: Sun Mar 01, 2015 8:42 pm

Re: PHP/Bootstrap Web Interface for the Pi Camera

Mon Aug 14, 2017 10:28 am

Hi Indeed, the web interface is relying on HTTP Basic sub authentication, which has been removed from chrome and edge browser.
Use firefox for now.

Sennie
Posts: 2
Joined: Tue Aug 29, 2017 7:03 pm

Re: PHP/Bootstrap Web Interface for the Pi Camera

Tue Aug 29, 2017 7:10 pm

I found an error when starting the raspicam service. The error was that there was an error in the config file/etc/uv4l/uv4l-raspicam.conf with preview 0,0,1920,1080. When I removed that line it worked. Also i needed to adjust the camera-settings-array.php in the www folder. I removed the preview line in that file also.

Regards,
Sennie

ronnyvdbr
Posts: 68
Joined: Sun Mar 01, 2015 8:42 pm

Re: PHP/Bootstrap Web Interface for the Pi Camera

Thu Aug 31, 2017 6:23 pm

Hi Sennie, this is because you are not using the latest version of the released image. The latest version doesn't have this bug.

Sennie
Posts: 2
Joined: Tue Aug 29, 2017 7:03 pm

Re: PHP/Bootstrap Web Interface for the Pi Camera

Thu Aug 31, 2017 6:33 pm

Hmm OK. I downloaded the v1.8 image on monday. Did you update the image after that?

jakespeed
Posts: 1
Joined: Sun Sep 10, 2017 12:26 pm

Re: PHP/Bootstrap Web Interface for the Pi Camera

Sun Sep 10, 2017 12:46 pm

Hello,
First ! Geat Projekt very nice i love it. but..

i have an problem wenn i am change the Control Settings settings with apply the cam gos offline.
No i can see that an error in the uv4l-raspicam.conf occur.
Still the preview paramter is nor right.
Also i delete this from the file, and i can start the uv4l service again. Well donn...

No, if i change somting and push apply the parameter was recreadet und the server ist stopping.

I run the latest 1.8 beta from here now, on an raspberry pi 2

Anyone checkt this too ?
Also i habe allwasy an login wenn i wan't to use the website with jmpeg stream like http://192.168.33.62:8080/stream/video.mjpeg wenn entering the user / PW what i use for the config interface , it will alway und endles ask username /password. Also the "root" account do not work,.

Help!
Thanx
Norbert

gerrit75
Posts: 2
Joined: Mon Sep 11, 2017 7:42 am

Re: PHP/Bootstrap Web Interface for the Pi Camera

Mon Sep 11, 2017 7:57 am

Hello,
i have the same problem, a freshley backed image works fine, changing systems settings en wifi work fine, but when i change 1 thing in camera settings it stops working.
Webstream/webserver not working any more.I do not have the skills yet to debug it. Logging tells that uv41 srvices stopped , restart doen't work
Also the same with logging on stream using firefox, First it works fine but after time it does't accept usr/password

gerrit75
Posts: 2
Joined: Mon Sep 11, 2017 7:42 am

Re: PHP/Bootstrap Web Interface for the Pi Camera

Mon Sep 11, 2017 8:59 pm

Tried something, Sennie's 27-08-17 post fix fixed it, I removed preview from files resrrated services. Everthings working fine now.

wklar1
Posts: 1
Joined: Wed Sep 13, 2017 8:49 am

Re: PHP/Bootstrap Web Interface for the Pi Camera

Wed Sep 13, 2017 11:01 am

Hi gerrit75 and all,

Have the same problem. So I tried also to remove the preview. Unfortunately I could not find a file named close to something like "resrrated".

The only file with the word 'preview' is in the file 'camera-settings-array.php". As this is a readonly file am not shure if I should do this and how.

Thanks for some pointers.

Marcel

picamer
Posts: 1
Joined: Sun Sep 17, 2017 1:07 pm

Re: PHP/Bootstrap Web Interface for the Pi Camera

Sun Sep 17, 2017 4:32 pm

I got the same problem, i tried removing the preview but did not work, every time when i change camera settings raspicam goes offline. I also saw difference between the one you can download and the current version on github. Maybe the upload failed at some point Ronny?

See this log:
[email protected]:~ $ sudo systemctl status uv4l_raspicam.service
● uv4l_raspicam.service - LSB: Userspace Camera Driver
Loaded: loaded (/etc/init.d/uv4l_raspicam)
Active: failed (Result: exit-code) since Sun 2017-09-17 14:26:07 UTC; 15s ago
Process: 1035 ExecStart=/etc/init.d/uv4l_raspicam start (code=exited, status=1/FAILURE)

Sep 17 14:26:07 raspberrypi uv4l_raspicam[1035]: Starting UV4L Raspberry CSI Camera Driver: uv4l
Sep 17 14:26:07 raspberrypi uv4l_raspicam[1035]: <notice> [core] Trying driver 'raspicam' fr.....
Sep 17 14:26:07 raspberrypi uv4l_raspicam[1035]: <warning> [core] Driver 'raspicam' not found
Sep 17 14:26:07 raspberrypi uv4l_raspicam[1035]: <notice> [core] Trying driver 'raspicam' fr.....
Sep 17 14:26:07 raspberrypi uv4l_raspicam[1035]: <notice> [driver] Dual Raspicam Video4Linux...17
Sep 17 14:26:07 raspberrypi uv4l_raspicam[1035]: <error> [core] the argument ('0,0,1920,1080...id
Sep 17 14:26:07 raspberrypi uv4l_raspicam[1035]: <alert> [core] No device detected
Sep 17 14:26:07 raspberrypi systemd[1]: uv4l_raspicam.service: control process exited, code...s=1
Sep 17 14:26:07 raspberrypi systemd[1]: Failed to start LSB: Userspace Camera Driver.
Sep 17 14:26:07 raspberrypi systemd[1]: Unit uv4l_raspicam.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.

Can Ronny or anyone shine some light on this? <error> [core] the argument ('0,0,1920,1080...id <----- is this somewhere else in a config file i missed?

Thanks

marcel151
Posts: 4
Joined: Sun Jul 23, 2017 11:54 pm

Re: PHP/Bootstrap Web Interface for the Pi Camera

Tue Sep 26, 2017 1:50 am

Hello,

is it possible to record the stream as a video on a FTP/SMB Folder? I want to use it as a surveillance cam, but I don't want to buy a Synology Diskstation for doing this. It would be okay that the camera records 24/7 and split the files on the remote server. Would that be possible?

kentsor
Posts: 6
Joined: Sun Oct 08, 2017 1:18 pm

Re: PHP/Bootstrap Web Interface for the Pi Camera

Sun Oct 08, 2017 1:54 pm

I'm seeing some problems on the new stretch release. It seems that uv4l-server has a hard dependency on libssl 1.0.0 and there are some odd warnings about the repositories not being signed. Any suggestions about what I should do?

[email protected]:~ $ echo "deb http://www.linux-projects.org/listing/u ... /raspbian/ jessie main" | sudo tee -a /etc/apt/sources.list
deb http://www.linux-projects.org/listing/u ... /raspbian/ jessie main
[email protected]:~ $ sudo apt-get update
Hit:1 http://mirrordirector.raspbian.org/raspbian stretch InRelease
Get:2 http://www.linux-projects.org/listing/u ... o/raspbian jessie InRelease [1,172 B]
Hit:3 http://archive.raspberrypi.org/debian stretch InRelease
Ign:2 http://www.linux-projects.org/listing/u ... o/raspbian jessie InRelease
Get:4 http://www.linux-projects.org/listing/u ... o/raspbian jessie/main armhf Packages [3,483 B]
Fetched 4,655 B in 4s (1,064 B/s)
Reading package lists... Done
W: GPG error: http://www.linux-projects.org/listing/u ... o/raspbian jessie InRelease: The following signatures were invalid: 88E8F32F724468BA39585D4099DA5D2AFCE635A4
W: The repository 'http://www.linux-projects.org/listing/u ... o/raspbian jessie InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
[email protected]:~ $ sudo apt-get -y install uv4l uv4l-raspicam
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libfuse2
Suggested packages:
fuse
The following NEW packages will be installed:
libfuse2 uv4l uv4l-raspicam
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,175 kB of archives.
After this operation, 5,969 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
uv4l uv4l-raspicam
E: There were unauthenticated packages and -y was used without --allow-unauthenticated
[email protected]:~ $ sudo apt-get -y install uv4l-raspicam-extras
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libfuse2 uv4l uv4l-raspicam
Suggested packages:
fuse
The following NEW packages will be installed:
libfuse2 uv4l uv4l-raspicam uv4l-raspicam-extras
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,182 kB of archives.
After this operation, 6,022 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
uv4l uv4l-raspicam uv4l-raspicam-extras
E: There were unauthenticated packages and -y was used without --allow-unauthenticated
[email protected]:~ $ sudo apt-get -y install uv4l-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
uv4l-server : Depends: libssl1.0.0 but it is not installable
E: Unable to correct problems, you have held broken packages.

kentsor
Posts: 6
Joined: Sun Oct 08, 2017 1:18 pm

Re: PHP/Bootstrap Web Interface for the Pi Camera

Sun Oct 08, 2017 7:45 pm

This is for the Pi Zero W with the official camera module. After the problems with the new stretch version of Rasbpian I went back to the last jessie version and installed per the installation.sh file. I have had some success, the camera is now working and accessible through the web interface. Three problems remain:

1) Using the mjpeg option the image is very, very unresponsive and laggy. I'm seing the image update in the browser about once a second, so perhaps, somehow the hardware encoding acceleration is not enabled. I have selected 640x480 42-60 fps, but it behaves the same way with higher resolutions like 1280x720 1-49 fps. In the Mac Activity monitor I can see that I'm receiving (with the 640x480 option) about 200-300KB/sec when accessing the camera from the browser. This seems a bit low but I don't know. Why is the frame rate set at 42 as the lower bound ?

2) I cannot get the rtsp option to work. Using the mrl given, neither vlc nor a rtsp capable camera viewer like security spy (already watching several other network cameras through rtsp just fine, so it's ok). This might be related to the third problem:

3) The streaming mjpeg doesn't work either. I can view the image by going to "http://192.168.0.228/Status.php", log in, and everything seems to work in the web interface, but "http://192.168.0.228:8080/stream/video.mjpeg" will NOT let me log in. I am using the _same_ admin/raspberry credentials, so something weird is happening with the uv4l-server credentials. Now, I'm kinda curious, given that the filesystem was set to read only in installation.sh, how is changing passwords going to work?


Running top I get the following output
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3817 root rt 0 150876 148068 29880 S 23.8 59.3 2:20.33 uv4l
236 root 20 0 0 0 0 S 7.1 0.0 0:57.96 kworker/u2:2
60 root 1 -19 0 0 0 S 2.9 0.0 0:29.41 VCHIQ-0
66 root -51 0 0 0 0 S 2.9 0.0 0:33.61 irq/86-mmc1
4021 pi 20 0 7192 3736 3172 R 1.6 1.5 0:02.81 top
6 root 20 0 0 0 0 S 1.0 0.0 0:41.71 kworker/u2:0
224 root 20 0 0 0 0 S 0.3 0.0 0:02.06 brcmf_wdog/mmc1
517 www-data 20 0 15768 3548 2300 S 0.3 1.4 0:00.86 nginx
4005 pi 20 0 12276 3908 3176 S 0.3 1.6 0:00.52 sshd
1 root 20 0 22784 3832 2636 S 0.0 1.5 0:12.96 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kthreadd

The CPU doesn't seem to be maxed out. I would have expected to for example see ffmpeg in the process list, but it's not in there.

Any suggestions?
Thanks in advance

To summarize, I think this project is so very close to being a perfect fit for my needs, clearly a lot of fine work. The status I see is that the 1.8 image available for download does not work with a Zero W. Also, the UV4L project needs to be dapted to Raspbian Stretch (not in the developers hands). When following the instructions in installation.sh to the letter (as far as I know), something is missing, most likely UV4L passwords. Making the filesystem read only seems to be too drastic a change.

TheWaterbug
Posts: 77
Joined: Fri Feb 05, 2016 12:35 am
Location: Los Angeles, CA, USA, Earth

Re: PHP/Bootstrap Web Interface for the Pi Camera

Thu Nov 09, 2017 12:42 am

kentsor wrote:
Sun Oct 08, 2017 7:45 pm
The CPU doesn't seem to be maxed out. I would have expected to for example see ffmpeg in the process list, but it's not in there.
I haven't played with this since v1.6 in April, but I'm interested in starting up again.

Can you explain why you'd expect to see ffmpeg in the process list? I wanted to run ffmpeg on mine, but I had to compile it. It would be much nicer to have it built in already! Was this a recent change/add?

Also, I had better luck with controlling things by building the camera from scratch using pieces of the shell script and editing out the things I didn't want (such as read-only file systems).

leeshr
Posts: 9
Joined: Sun Jun 05, 2016 6:24 am

Re: PHP/Bootstrap Web Interface for the Pi Camera

Sun Dec 03, 2017 2:40 am

Sennie wrote:
Tue Aug 29, 2017 7:10 pm
I found an error when starting the raspicam service. The error was that there was an error in the config file/etc/uv4l/uv4l-raspicam.conf with preview 0,0,1920,1080. When I removed that line it worked. Also i needed to adjust the camera-settings-array.php in the www folder. I removed the preview line in that file also.

Regards,
Sennie
I can confirm that this solution worked for me also - with my Raspberry 3 :D

leeshr
Posts: 9
Joined: Sun Jun 05, 2016 6:24 am

Re: PHP/Bootstrap Web Interface for the Pi Camera

Sun Dec 03, 2017 2:45 am

picamer wrote:
Sun Sep 17, 2017 4:32 pm
I got the same problem, i tried removing the preview but did not work, every time when i change camera settings raspicam goes offline. I also saw difference between the one you can download and the current version on github. Maybe the upload failed at some point Ronny?

See this log:
[email protected]:~ $ sudo systemctl status uv4l_raspicam.service
● uv4l_raspicam.service - LSB: Userspace Camera Driver
Loaded: loaded (/etc/init.d/uv4l_raspicam)
Active: failed (Result: exit-code) since Sun 2017-09-17 14:26:07 UTC; 15s ago
Process: 1035 ExecStart=/etc/init.d/uv4l_raspicam start (code=exited, status=1/FAILURE)

Sep 17 14:26:07 raspberrypi uv4l_raspicam[1035]: Starting UV4L Raspberry CSI Camera Driver: uv4l
Sep 17 14:26:07 raspberrypi uv4l_raspicam[1035]: <notice> [core] Trying driver 'raspicam' fr.....
Sep 17 14:26:07 raspberrypi uv4l_raspicam[1035]: <warning> [core] Driver 'raspicam' not found
Sep 17 14:26:07 raspberrypi uv4l_raspicam[1035]: <notice> [core] Trying driver 'raspicam' fr.....
Sep 17 14:26:07 raspberrypi uv4l_raspicam[1035]: <notice> [driver] Dual Raspicam Video4Linux...17
Sep 17 14:26:07 raspberrypi uv4l_raspicam[1035]: <error> [core] the argument ('0,0,1920,1080...id
Sep 17 14:26:07 raspberrypi uv4l_raspicam[1035]: <alert> [core] No device detected
Sep 17 14:26:07 raspberrypi systemd[1]: uv4l_raspicam.service: control process exited, code...s=1
Sep 17 14:26:07 raspberrypi systemd[1]: Failed to start LSB: Userspace Camera Driver.
Sep 17 14:26:07 raspberrypi systemd[1]: Unit uv4l_raspicam.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.

Can Ronny or anyone shine some light on this? <error> [core] the argument ('0,0,1920,1080...id <----- is this somewhere else in a config file i missed?

Thanks
Try Sennie's solution - worked for me
Sennie wrote: ↑
Wed Aug 30, 2017 3:10 am
I found an error when starting the raspicam service. The error was that there was an error in the config file/etc/uv4l/uv4l-raspicam.conf with preview 0,0,1920,1080. When I removed that line it worked. Also i needed to adjust the camera-settings-array.php in the www folder. I removed the preview line in that file also.

Regards,
Sennie

TheWaterbug
Posts: 77
Joined: Fri Feb 05, 2016 12:35 am
Location: Los Angeles, CA, USA, Earth

Re: PHP/Bootstrap Web Interface for the Pi Camera

Mon Jan 29, 2018 5:01 am

^^
More on this.

I installed from the latest image (as of 28 Jan 18) from:

https://drive.google.com/open?id=0BzcZ1 ... jF3cHhKVGc

It installed just fine, and appeared to work on first boot, but any change in any of the camera configuration would cause the camera to shut off, the preview to fail, and the stream to fail.

To remove the invalid preview will require:

sudo mount -o remount rw /
sudo nano /etc/uv4l/uv4l-raspicam.conf
sudo nano /home/pi/RaspberryIPCamera/www/camera-settings-array.php

and remove or comment out the "preview 0,0,1920,1080" line.

Now things seem to working properly.

And now I'm compiling ffmpeg again . . . .

TheWaterbug
Posts: 77
Joined: Fri Feb 05, 2016 12:35 am
Location: Los Angeles, CA, USA, Earth

Re: PHP/Bootstrap Web Interface for the Pi Camera

Mon Jan 29, 2018 6:26 pm

TheWaterbug wrote:
Mon Jan 29, 2018 5:01 am
And now I'm compiling ffmpeg again . . . .
. . . and it's failing with "no space left on device."

TheWaterbug
Posts: 77
Joined: Fri Feb 05, 2016 12:35 am
Location: Los Angeles, CA, USA, Earth

Re: PHP/Bootstrap Web Interface for the Pi Camera

Thu Feb 08, 2018 9:15 pm

^^
I still haven't resolved the issue with compiling ffmpeg on top of the camera project, so my workaround is to just use another Pi as an ffmpeg relay station. It was doing this already for my Reolink camera, so now I just have two instances of ffmpeg running instead of one. They're not doing any transcoding, so they each use ~8 - 12% of the CPU, which is tolerable.

But now I have another question--is there any way to get a still image from this camera project if it's configured to serve h.264?

e.g. right now my ffmpeg relay server is pulling from rtsp://camera.pi.ip.address:8554. Is there another URL where I can pull a single JPG? I want to store those, once/minute, so that I can do a daily timelapse at the end of each day.

I'd also like to figure out how to get a near-real-time time/date stamp on the video.

Thanks!

TheWaterbug
Posts: 77
Joined: Fri Feb 05, 2016 12:35 am
Location: Los Angeles, CA, USA, Earth

Re: PHP/Bootstrap Web Interface for the Pi Camera

Fri Feb 09, 2018 1:22 am

TheWaterbug wrote:
Thu Feb 08, 2018 9:15 pm
I'd also like to figure out how to get a near-real-time time/date stamp on the video.
I'm halfway towards a solution, here. I found this handy shell script to sed the formatted date/time into the file that's specified in /etc/uv4l/uv4l-raspicam.conf. It took me a long time to figure that I also need to have the template file in place! (/etc/uv4l/text_template.json). So I turned it into UpdateDateTime.service, using the tips given to me in another thread.

So it works, but only halfway, because of the r/o filesystem. Right now I'm using the default text file location, namely /usr/share/uv4l/raspicam/text.json. I need to sudo mount -o remount rw / in order for the service to write the file, so it doesn't work after a reboot until I manually do that. I've also been advised that using /usr/share/uv4l/raspicam/text.json is a bad idea, because I'm writing to the SD card once/second, which will wear it out.

The author of that script suggests I specify a file in the ramdisk at /tmp, but the problem there is that /tmp is empty at startup, which causes the uv4l driver to fail the text overlay due to a missing file, even if that file gets created a few seconds later.

Ideally I'd start my UpdateDateTime.service, using /tmp, before the uv4l driver starts, but I'm not sure how to configure that.

TheWaterbug
Posts: 77
Joined: Fri Feb 05, 2016 12:35 am
Location: Los Angeles, CA, USA, Earth

Re: PHP/Bootstrap Web Interface for the Pi Camera

Fri Feb 09, 2018 3:42 am

TheWaterbug wrote:
Fri Feb 09, 2018 1:22 am
The author of that script suggests I specify a file in the ramdisk at /tmp, but the problem there is that /tmp is empty at startup, which causes the uv4l driver to fail the text overlay due to a missing file, even if that file gets created a few seconds later.

Ideally I'd start my UpdateDateTime.service, using /tmp, before the uv4l driver starts, but I'm not sure how to configure that.
Never mind. PEBCAK. The first time I'd tried to use /tmp I'd had a syntax error in the .json file. Now that that's fixed, I can use /tmp.

TheWaterbug
Posts: 77
Joined: Fri Feb 05, 2016 12:35 am
Location: Los Angeles, CA, USA, Earth

Re: PHP/Bootstrap Web Interface for the Pi Camera

Sat Feb 10, 2018 12:19 am

Ok! After a year of asking questions, I finally have something to contribute! I have real-time date/time/weather updating on my live video. I have 2 services running.

UpdateWeather updates once/minute and does:

Code: Select all

#!/bin/bash

while [[ 1 == 1 ]]; do
        curl -s 'api.openweathermap.org/data/2.5/weather?id=5388601&APPID=MyOpenWeatherMapAPIKey&units=imperial' | jq '.name,", ",.main.temp," F"' > /tmp/temp1.txt
        tr -d '"' < /tmp/temp1.txt > /tmp/temp2.txt
        tr -d '\n' < /tmp/temp2.txt > /tmp/weather.txt
        sleep 600
done
which results in something like: Rancho Palos Verdes, 65.17 °F I'm sure someone can figure out a way to condense that all into one operation.

I had to install jq, but that wasn't difficult.

UpdateDateTime runs once/second and does:

Code: Select all

 file=$(sed -rne '/^text-filename.*=/{s/^text-filename *= *(.*)$/\1/g;p}' /etc/uv4l/uv4l-raspicam.conf)

[[ "$file" == "" ]] && { echo "no configured overlay file"; exit 255; }

while [[ 1 == 1 ]]; do
        overlay=`cat /etc/uv4l/text_template.json`
        overlay=${overlay/\$time/`date +%Y-%m-%d:%l:%M:%S`}
        overlay=${overlay/\$weather/`cat /tmp/weather.txt`}

        echo "$overlay" > $file

        # Update overlay text
        v4l2-ctl --set-ctrl=text_overlay=1 &>/dev/null

        sleep 1
done
And that results in:

Image

I hope this helps someone!

TheWaterbug
Posts: 77
Joined: Fri Feb 05, 2016 12:35 am
Location: Los Angeles, CA, USA, Earth

Re: PHP/Bootstrap Web Interface for the Pi Camera

Wed Feb 14, 2018 4:17 am

Is there any way (now, or in the future) to configure the stack to output both MJPEG and h.264, on two different ports, with two different resolution settings? Outputting multiple streams is common on many commercially-available IP, for low-res or low-bandwidth previewing and for full-res viewing.

For me, I'd like to have a ~640 x 480 MPJEG stream for aiming and focusing. The latency of the MPJEG stream is typically low enough (1-2 seconds) to make focusing a real-time task, whereas the sometimes ~10 second latency of the h.264 stream makes it a set and . . . . wait . . . and . . . . see process.

But once I have it set up and focused I want to send 1080p/h.264 out to YouTube.

Yes, I can switch it back and forth, but it would be great to have both available, all the time.

Would a Pi 2 B have enough horsepower to do both?

TheWaterbug
Posts: 77
Joined: Fri Feb 05, 2016 12:35 am
Location: Los Angeles, CA, USA, Earth

Re: PHP/Bootstrap Web Interface for the Pi Camera

Wed Feb 14, 2018 7:47 pm

^^
Also, is there a way (or could there be a way) to get a single JPG from a different URL?

I want to save a frame every 30 or 60 seconds to an SMB share, and then compress those into a time lapse at the end of each day. I can do this with my Reolink camera, which has a built-in option to FTP a still every X seconds to a folder.

I know ffmpeg can create a jpg from the h.264 stream, via something like this:

ffmpeg -rtsp_transport tcp -y -i rtsp://192.168.1.30:8554 -vframes 1 /share/frame.jpg

or

ffmpeg -rtsp_transport tcp -y -i rtsp://192.168.1.30:8554 -f image2 -r 1/5 /share/frame%01d.jpg

but the CPU utilization goes up to 150% when I do this, possibly because ffmpeg is transcoding.

TheWaterbug
Posts: 77
Joined: Fri Feb 05, 2016 12:35 am
Location: Los Angeles, CA, USA, Earth

Re: PHP/Bootstrap Web Interface for the Pi Camera

Sun Mar 04, 2018 12:08 am

More questions! Is there a way to enable audio in the RSTP feed?

I see that the RTSP server included in this project has support for an ALSA audio device:

Code: Select all

./v4l2rtspserver [-v[v]] [-Q queueSize] [-O file] \
		       [-I interface] [-P RTSP port] [-p RTSP/HTTP port] [-m multicast url] [-u unicast url] [-M multicast addr] [-c] [-t timeout] \
		       [-r] [-s] [-W width] [-H height] [-F fps] [device1] [device2]
		       
where is seems like device2 would be an audio feed, e.g.:
ALSA options :
-A freq : ALSA capture frequency and channel (default 44100)
-C channels: ALSA capture channels (default 2)
-a fmt : ALSA capture audio format (default S16_BE)

device : V4L2 capture device and/or ALSA device (default /dev/video0)device : V4L2 capture device and/or ALSA device (default /dev/video0)
and the camera-settings-array.php file has commented-out sections for audio:

Code: Select all

# server-option = --enable-webrtc-audio=true
I already have a USB microphone connected, and I can successfully record with the microphone and play back through the headphone jack using:

Code: Select all

arecord -D plughw:1,0 -d 3 test.wav && aplay test.wav
How do I glue it all together?

xf2334
Posts: 2
Joined: Wed Sep 24, 2014 8:00 pm

Re: PHP/Bootstrap Web Interface for the Pi Camera

Sat Mar 31, 2018 3:42 pm

My hint for people having problems getting RTSP to run:

My Raspi was too old (Model B+). The camera couldn't be detected in RTSP mode
(systemctl status uv4l-raspicam shows "bad file descriptor on /dev/video0")
However, mjpeg was working without problems.

Solution:

Code: Select all

sudo mount -o remount -rw /
sudo mount -o remount -rw /boot
sudo apt-get update
sudo apt-get install rpi-update
sudo rpi-update
sudo reboot
This will update your Raspi firmware and get RTSP going.

(Don't forget to comment out the 'preview' line in /home/pi/RaspberryIPCamera/www/camera-settings-array.php and /etc/uv4l/uv4l-raspicam.conf)

best regards
Bernd

Return to “Camera board”