Sryously
Posts: 7
Joined: Tue Sep 24, 2019 1:38 am

Re: RPi Cam Web Interface

Tue Sep 24, 2019 5:52 am

ras07 wrote:
Tue Sep 24, 2019 5:48 am
Sryously wrote:
Tue Sep 24, 2019 2:06 am
I'm having trouble with RPI Cam Web Interface on a Raspberry Pi Zero W, it's locking up or something, and it seems to happen only once I've opened up the camera.
Make sure the camera connection is solid. Take the cable out, maybe clean the contacts with isopropyl acohol, and re-insert. Do the same on the camera end if your camera allows. Make sure the cable is in the right way, make sure the connector locks, and make sure there isn't any stress on the cable when in use.

If Raspbian works fine until the camera starts I doubt if it is a problem burning the MicroSD.
It's not immediate, it's a few mins after running the camera, viewing or recording, the camera and Pi are still powered but not responding. Hmmm, I guess your right about burning Raspbian though, seeing as I can just give it commands for an hour and it runs normally, so it should be something going on with RPi Cam Web Interface installation then? Apache couldn't be causing it, could it? Is there recommended install settings for a Pi Zero W or something?

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

Re: RPi Cam Web Interface

Tue Sep 24, 2019 6:04 am

Sryously wrote:
Tue Sep 24, 2019 5:52 am
ras07 wrote:
Tue Sep 24, 2019 5:48 am
Make sure the camera connection is solid. Take the cable out, maybe clean the contacts with isopropyl acohol, and re-insert. Do the same on the camera end if your camera allows. Make sure the cable is in the right way, make sure the connector locks, and make sure there isn't any stress on the cable when in use.

If Raspbian works fine until the camera starts I doubt if it is a problem burning the MicroSD.
It's not immediate, it's a few mins after running the camera, viewing or recording, the camera and Pi are still powered but not responding. Hmmm, I guess your right about burning Raspbian though, seeing as I can just give it commands for an hour and it runs normally, so it should be something going on with RPi Cam Web Interface installation then? Apache couldn't be causing it, could it? Is there recommended install settings for a Pi Zero W or something?
Apache defaults should work fine. Check the connections. I've had very sporadic weird stuff happen with flaky camera cable connections.

Sryously
Posts: 7
Joined: Tue Sep 24, 2019 1:38 am

Re: RPi Cam Web Interface

Tue Sep 24, 2019 2:44 pm

ras07 wrote:
Tue Sep 24, 2019 6:04 am
Sryously wrote:
Tue Sep 24, 2019 5:52 am
ras07 wrote:
Tue Sep 24, 2019 5:48 am
Make sure the camera connection is solid. Take the cable out, maybe clean the contacts with isopropyl acohol, and re-insert. Do the same on the camera end if your camera allows. Make sure the cable is in the right way, make sure the connector locks, and make sure there isn't any stress on the cable when in use.

If Raspbian works fine until the camera starts I doubt if it is a problem burning the MicroSD.
It's not immediate, it's a few mins after running the camera, viewing or recording, the camera and Pi are still powered but not responding. Hmmm, I guess your right about burning Raspbian though, seeing as I can just give it commands for an hour and it runs normally, so it should be something going on with RPi Cam Web Interface installation then? Apache couldn't be causing it, could it? Is there recommended install settings for a Pi Zero W or something?
Apache defaults should work fine. Check the connections. I've had very sporadic weird stuff happen with flaky camera cable connections.
Shoot, it was working fine for over an hour last night disconnecting and reconnecting the camera cable! Then I stopped the camera on the web interface. This morning I enable camera and again it works, but for 5 minutes, then nothing. Unplug power and reconnect, works again. Play with picture settings and stuff for like an hour, see how bright I can get the picture and then...I turn on the lights and it's gone again? Did turning on the lights make it do that or just coincidence? LOL I'm using a 2.5Amp power adapter, I have a heatsink on the Zero W. One thing I was noticing, I mentioned I had tried MotionEye before, the address ended with /admin/ instead of /html/ but both still work?

Edit: Forget I mentioned traces of MotionEye seeming to be left over after 3 formats, I think it was Android loading showing a page that wasn't there.

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

Re: RPi Cam Web Interface

Tue Sep 24, 2019 4:30 pm

Sryously wrote:
Tue Sep 24, 2019 2:44 pm
I mentioned I had tried MotionEye before, the address ended with /admin/ instead of /html/ but both still work?
I don't know anything about MotionEye, but I wouldn't try to install both on the same system.
Edit: Forget I mentioned traces of MotionEye seeming to be left over after 3 formats,
Not sure I understand you ... "traces of MotionEye" can't be there if you are re-imaging the microSD card with a fresh Raspian image using Balina Etcher (or something similar), and then a fresh RPi-CWI install. If there is, something is going wrong with your re-imaging process.
I think it was Android loading showing a page that wasn't there.
Didn't understand that comment either; none of this has anything to do with Android ...

Sryously
Posts: 7
Joined: Tue Sep 24, 2019 1:38 am

Re: RPi Cam Web Interface

Tue Sep 24, 2019 4:42 pm

ras07 wrote:
Tue Sep 24, 2019 4:30 pm
Sryously wrote:
Tue Sep 24, 2019 2:44 pm
I mentioned I had tried MotionEye before, the address ended with /admin/ instead of /html/ but both still work?
I don't know anything about MotionEye, but I wouldn't try to install both on the same system.
Edit: Forget I mentioned traces of MotionEye seeming to be left over after 3 formats,
Not sure I understand you ... "traces of MotionEye" can't be there if you are re-imaging the microSD card with a fresh Raspian image using Balina Etcher (or something similar), and then a fresh RPi-CWI install. If there is, something is going wrong with your re-imaging process.
I think it was Android loading showing a page that wasn't there.
Didn't understand that comment either; none of this has anything to do with Android ...
I was seeing MotionEye page on http://192.168.10.20/admin/ which I had open on an Android phone, looked like it was refreshing as if it was there. I was wrong, seemed to just be Android loading it from cache, the page went nowhere on desktop, that's why I edited that incase it was read.

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

Re: RPi Cam Web Interface

Tue Sep 24, 2019 5:00 pm

Sryously wrote:
Tue Sep 24, 2019 4:42 pm
I was seeing MotionEye page on http://192.168.10.20/admin/ which I had open on an Android phone, looked like it was refreshing as if it was there. I was wrong, seemed to just be Android loading it from cache, the page went nowhere on desktop, that's why I edited that incase it was read.
Ah - got it. I have seen an odd thing or two with the cache on the viewing device. If possible, clear the cache on your phone and/or view the RPi CWI page from a computer with a cleared cache. That's also something to try when the camera seems dead - make sure it's not just your browser.

You can also take a look at the log files, particularly the system log (/var/log/syslog) and the Apache logs (/var/log/apache2/access.log and error.log). (If the logs look short they may have rotated; try adding .1 to all the file names to see the previous log.)

Failing that, I'm running out of ideas. If you have multiple components, you can try swapping out various parts - different Pi, different camera, different microSD card, different power supply, etc. I've got one particular Zero W that doesn't get along with one particular camera, for reasons I've never figured out - I get a kernel panic every couple hours. But if I swap the camera with another system, both systems run fine.

Exorcisto
Posts: 4
Joined: Fri Mar 22, 2019 3:14 pm

Re: RPi Cam Web Interface

Tue Sep 24, 2019 8:27 pm

Great soft!
But can I get video stream for using in media players? More precise I would like show video in android software.
I not find answers in that topic.
Sorry for my English, I'm not a native speaker.

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

Re: RPi Cam Web Interface

Wed Sep 25, 2019 3:57 am

Exorcisto wrote:
Tue Sep 24, 2019 8:27 pm
Great soft!
But can I get video stream for using in media players? More precise I would like show video in android software.
I not find answers in that topic.
Sorry for my English, I'm not a native speaker.
There's a couple ways to do this. The easiest way is to just use a browser on your Android device. If you want a video-only page without any controls, see https://elinux.org/RPi-Cam-Web-Interfac ... _only_page for info on how to generate a preview-only web page. This works well on mobile devices.

You can also view the stream directly in many media players by accessing cam_pic_new.php (for example, http://192.168.0.100/html/cam_pic_new.php - adjust IP address and directory as appropriate for your installation). I can verify this works well in VLC on Android (use the Open Network Stream function) - I haven't tried other media players, but it should work with anything that can listen to a stream.

Note however that this can use a LOT of bandwidth, since it's accessing the raw stream directly - you can come close to saturating 2.4 GHz wifi doing this. If you're running over wired Ethernet or as the only wifi user this can be fine, but if you have a crowded wifi link or multiple cameras and/or multiple viewers on the same wifi, this can end up being a problem.

Sryously
Posts: 7
Joined: Tue Sep 24, 2019 1:38 am

Re: RPi Cam Web Interface

Wed Sep 25, 2019 11:29 pm

I don't have another Pi or camera to try so I tried the different servers without luck. NGINX wouldn't start, giving me this error:

Code: Select all

nginx: [emerg] open() "/etc/nginx/sites-enabled/default" failed (2: No such file or directory) in /etc/nginx/nginx.conf:62
I tried lighttpd and the server worked, logged into the web interface, but I couldn't get the camera in Default or MJPEG Stream.
I over to a 16GB MicroSD, installed Apache again and left everything in the web interface basically as is except camera orientation, loaded it up in iSpy and left it at that all night. This morning it was still running, but then the whole thing locked up again, no camera stream on iSpy (shows disconnected), no web interface, can't even SSH into the Pi. I'm not sure if I accessed the web interface at all before the Pi crashed/locked up.
I did notice something odd in iSpy before that happened though, it's as if it zoomed into the video, looked normal in the Web Interface before though.
Any hint from this as to what's going on? Is Apache bugging out? I'm in the middle of messing with the camera again but without touching the web interface, just through iSpy to see how long it will run.

Edit: Without accessing the RPI Cam Web Interface the Pi still locked up, maybe lasted about 1 hour.

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

Re: RPi Cam Web Interface

Thu Sep 26, 2019 12:19 am

Sryously wrote:
Wed Sep 25, 2019 11:29 pm
I don't have another Pi or camera to try so I tried the different servers without luck. NGINX wouldn't start, giving me this error:

Code: Select all

nginx: [emerg] open() "/etc/nginx/sites-enabled/default" failed (2: No such file or directory) in /etc/nginx/nginx.conf:62
I tried lighttpd and the server worked, logged into the web interface, but I couldn't get the camera in Default or MJPEG Stream.
I over to a 16GB MicroSD, installed Apache again and left everything in the web interface basically as is except camera orientation, loaded it up in iSpy and left it at that all night. This morning it was still running, but then the whole thing locked up again, no camera stream on iSpy (shows disconnected), no web interface, can't even SSH into the Pi. I'm not sure if I accessed the web interface at all before the Pi crashed/locked up.
I did notice something odd in iSpy before that happened though, it's as if it zoomed into the video, looked normal in the Web Interface before though.
Any hint from this as to what's going on? Is Apache bugging out? I'm in the middle of messing with the camera again but without touching the web interface, just through iSpy to see how long it will run.

Edit: Without accessing the RPI Cam Web Interface the Pi still locked up, maybe lasted about 1 hour.
In the interests of debugging, I'd take iSpy out of the equation and just access through a browser. That said, if you're leaving everything as default as possible, it really sounds like more of a hardware issue to me.

Did the logs show anything?

Sryously
Posts: 7
Joined: Tue Sep 24, 2019 1:38 am

Re: RPi Cam Web Interface

Thu Sep 26, 2019 1:21 am

ras07 wrote:
Thu Sep 26, 2019 12:19 am
Sryously wrote:
Wed Sep 25, 2019 11:29 pm
I don't have another Pi or camera to try so I tried the different servers without luck. NGINX wouldn't start, giving me this error:

Code: Select all

nginx: [emerg] open() "/etc/nginx/sites-enabled/default" failed (2: No such file or directory) in /etc/nginx/nginx.conf:62
I tried lighttpd and the server worked, logged into the web interface, but I couldn't get the camera in Default or MJPEG Stream.
I over to a 16GB MicroSD, installed Apache again and left everything in the web interface basically as is except camera orientation, loaded it up in iSpy and left it at that all night. This morning it was still running, but then the whole thing locked up again, no camera stream on iSpy (shows disconnected), no web interface, can't even SSH into the Pi. I'm not sure if I accessed the web interface at all before the Pi crashed/locked up.
I did notice something odd in iSpy before that happened though, it's as if it zoomed into the video, looked normal in the Web Interface before though.
Any hint from this as to what's going on? Is Apache bugging out? I'm in the middle of messing with the camera again but without touching the web interface, just through iSpy to see how long it will run.

Edit: Without accessing the RPI Cam Web Interface the Pi still locked up, maybe lasted about 1 hour.
In the interests of debugging, I'd take iSpy out of the equation and just access through a browser. That said, if you're leaving everything as default as possible, it really sounds like more of a hardware issue to me.

Did the logs show anything?
I ran the debug.sh the other day but I don't see it telling me anything useful and nothing seems to happen after it shows "Starting command loop"

Code: Select all

[email protected]:~/RPi_Cam_Web_Interface $ bash ./debug.sh
start monitoring for pid: 1662
{2019/09/26 02:19:20} start monitoring for pid: 1662
RaspiMJPEG Version 5.9.1
recommended video buffer size 65536
h264 size set to 131072
recommended video buffers 1
h264 buffers set to recommended 1
Opening FIFO 0 /var/www/html/FIFO 7
Opening FIFO 1 /var/www/html/FIFO11 8
MJPEG streaming, ready to receive commands
send smd 9
[email protected]:~/RPi_Cam_Web_Interface $ Starting command loop

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

Re: RPi Cam Web Interface

Thu Sep 26, 2019 2:37 am

Sryously wrote:
Thu Sep 26, 2019 1:21 am
I ran the debug.sh the other day but I don't see it telling me anything useful and nothing seems to happen after it shows "Starting command loop"

Code: Select all

[email protected]:~/RPi_Cam_Web_Interface $ bash ./debug.sh
start monitoring for pid: 1662
{2019/09/26 02:19:20} start monitoring for pid: 1662
RaspiMJPEG Version 5.9.1
recommended video buffer size 65536
h264 size set to 131072
recommended video buffers 1
h264 buffers set to recommended 1
Opening FIFO 0 /var/www/html/FIFO 7
Opening FIFO 1 /var/www/html/FIFO11 8
MJPEG streaming, ready to receive commands
send smd 9
[email protected]:~/RPi_Cam_Web_Interface $ Starting command loop
What about the system logs?

Sryously
Posts: 7
Joined: Tue Sep 24, 2019 1:38 am

Re: RPi Cam Web Interface

Thu Sep 26, 2019 6:45 am

ras07 wrote:
Thu Sep 26, 2019 2:37 am
Sryously wrote:
Thu Sep 26, 2019 1:21 am
I ran the debug.sh the other day but I don't see it telling me anything useful and nothing seems to happen after it shows "Starting command loop"

Code: Select all

[email protected]:~/RPi_Cam_Web_Interface $ bash ./debug.sh
start monitoring for pid: 1662
{2019/09/26 02:19:20} start monitoring for pid: 1662
RaspiMJPEG Version 5.9.1
recommended video buffer size 65536
h264 size set to 131072
recommended video buffers 1
h264 buffers set to recommended 1
Opening FIFO 0 /var/www/html/FIFO 7
Opening FIFO 1 /var/www/html/FIFO11 8
MJPEG streaming, ready to receive commands
send smd 9
[email protected]:~/RPi_Cam_Web_Interface $ Starting command loop
What about the system logs?
This is what I got
syslog - https://pastebin.com/nkgtjA4b Something with bluetooth? And an Apache warning that doesn't mean much from what I Googled.
access.log - https://pastebin.com/sbEDiCKb Doesn't seem to show anything important.
error.log - https://pastebin.com/b2P7EKNE caught SIGTERM? shutting down errors?

Edit: I don't know what it's doing but I think it's the camera. MotionEyeOS (first one I installed) lagged like hell and RPi Cam Web Interface locks up the whole Pi no matter which way I install it. I basically had 0 issues using this Pi for Pi-Hole for a few weeks. I would think something like the full Raspbian Desktop OS would cause it to lock up if it was a hardware problem but without the camera this little guy is running the OS.

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

Re: RPi Cam Web Interface

Sat Sep 28, 2019 4:39 pm

Sryously wrote:
Thu Sep 26, 2019 6:45 am
Edit: I don't know what it's doing but I think it's the camera. MotionEyeOS (first one I installed) lagged like hell and RPi Cam Web Interface locks up the whole Pi no matter which way I install it. I basically had 0 issues using this Pi for Pi-Hole for a few weeks. I would think something like the full Raspbian Desktop OS would cause it to lock up if it was a hardware problem but without the camera this little guy is running the OS.
I don't see anything obvious in the logs. Camera, cable or connector would be my guess as well.

rpiuser2016
Posts: 77
Joined: Tue Jan 12, 2016 1:53 pm

Re: RPi Cam Web Interface

Sat Oct 05, 2019 7:00 pm

Is it possible to overwrite video file in case of insufficient storage volume?

For a week 2600 videos detected, overall size of all - 32 GB, full sd card

BigFishOnly
Posts: 1
Joined: Sun Oct 06, 2019 9:17 am

Re: RPi Cam Web Interface

Sun Oct 06, 2019 9:26 am

Sryously wrote:
Wed Sep 25, 2019 11:29 pm

Code: Select all

nginx: [emerg] open() "/etc/nginx/sites-enabled/default" failed (2: No such file or directory) in /etc/nginx/nginx.conf:62
I think this is due to a bug in the installation scripts when choosing Nginx.

Try removing the symbolic link /etc/nginx/sites-enabled/default and create a new one with the same name/location that points to /etc/nginx/sites-available/rpicam.

This is only if you want to install RPi Cam Web Interface at the root, not in a sub-directory.

Meowstopher
Posts: 1
Joined: Sun Oct 06, 2019 11:42 pm

Re: RPi Cam Web Interface

Mon Oct 07, 2019 3:05 am

I've seen this issue mentioned a few times on this board, but no potential solutions. Wondering if anyone has advice.

Context:
Security camera running RPi Cam Web Interface on a Raspberry Pi 0-W. Motion detection is set to "internal." Scheduler is set to "Sun". Video capture starts and stops with motion detection. Exposure mode is "auto" during the day, and switches to "night" for dusk, night, and dawn.

Problem:
When motion detection is off, exposure looks great in low light. However as soon as motion detection is turned on, the exposure mode seems to reset, the image darkens, and motion detection is triggered by the change in light. Once recording ends, the exposure mode changes back to "night", the image brightens, and motion detection is triggered again. Repeat ad infinitum.

Is there a known reason why this change in exposure occurs when motion detection/recording is turned on or off? Is there a way to have any exposure mode other than auto and motion detection co-exist?

I'm aware of a potential workaround to delay motion detection's reactivation after recording ends until the exposure returns. This prevents the exposure change from repeatedly re-activating motion detection, but doesn't address the loss of exposure during recording (since exposure mode reverts to auto once recording starts).

Thanks in advance for any help!

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

Re: RPi Cam Web Interface

Mon Oct 07, 2019 8:55 pm

rpiuser2016 wrote:
Sat Oct 05, 2019 7:00 pm
Is it possible to overwrite video file in case of insufficient storage volume?

For a week 2600 videos detected, overall size of all - 32 GB, full sd card
This can be handled in the Edit Schedule Settings screen. There's a few different ways to do it, but I set PurgeSpace_ModeEx to Min_Space % and set PurgeSpace_Level to 20. This will keep at least 20% free space on the card by deleting the oldest files first.

Don't cut it too close; you'll need a bare minimum of twice the free space as your largest expected video file (conversion from .h264 to .mp4 briefly takes up twice the file size) plus whatever temporary files Linux may happen to be using at the time. I like to make sure there's at least a couple gig free at all times.

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

Re: RPi Cam Web Interface

Mon Oct 07, 2019 9:37 pm

Meowstopher wrote:
Mon Oct 07, 2019 3:05 am
I've seen this issue mentioned a few times on this board, but no potential solutions. Wondering if anyone has advice.

Context:
Security camera running RPi Cam Web Interface on a Raspberry Pi 0-W. Motion detection is set to "internal." Scheduler is set to "Sun". Video capture starts and stops with motion detection. Exposure mode is "auto" during the day, and switches to "night" for dusk, night, and dawn.

Problem:
When motion detection is off, exposure looks great in low light. However as soon as motion detection is turned on, the exposure mode seems to reset, the image darkens, and motion detection is triggered by the change in light. Once recording ends, the exposure mode changes back to "night", the image brightens, and motion detection is triggered again. Repeat ad infinitum.
I've seen two suggestions for this: #1, make sure you are using the "new" internal motion detection scheme (where the noise level parameter is > 1000; see https://www.raspberrypi.org/forums/view ... 0#p1020905 for more details). This is generally a better detection scheme anyway, and is less sensitive to changes due to lighting. Increasing the Change Frames to start parameter can help as well.

Secondly, try using the scheduler to explicitly reduce the framerate (using the px command) whenever you switch to night mode. Night mode uses a very low framerate (as low as 2 fps), but it appears that the motion detection trigger overrides this, so forcing a low fps may stop the cycle you describe.

Good luck; please post back with your results!

BradZed
Posts: 1
Joined: Mon Oct 07, 2019 8:33 am

Re: RPi Cam Web Interface

Tue Oct 08, 2019 12:52 am

Sryously wrote:
Tue Sep 24, 2019 2:44 pm
ras07 wrote:
Tue Sep 24, 2019 6:04 am
Sryously wrote:
Tue Sep 24, 2019 5:52 am


It's not immediate, it's a few mins after running the camera, viewing or recording, the camera and Pi are still powered but not responding. Hmmm, I guess your right about burning Raspbian though, seeing as I can just give it commands for an hour and it runs normally, so it should be something going on with RPi Cam Web Interface installation then? Apache couldn't be causing it, could it? Is there recommended install settings for a Pi Zero W or something?
Apache defaults should work fine. Check the connections. I've had very sporadic weird stuff happen with flaky camera cable connections.
Shoot, it was working fine for over an hour last night disconnecting and reconnecting the camera cable! Then I stopped the camera on the web interface. This morning I enable camera and again it works, but for 5 minutes, then nothing. Unplug power and reconnect, works again. Play with picture settings and stuff for like an hour, see how bright I can get the picture and then...I turn on the lights and it's gone again? Did turning on the lights make it do that or just coincidence? LOL I'm using a 2.5Amp power adapter, I have a heatsink on the Zero W. One thing I was noticing, I mentioned I had tried MotionEye before, the address ended with /admin/ instead of /html/ but both still work?

Edit: Forget I mentioned traces of MotionEye seeming to be left over after 3 formats, I think it was Android loading showing a page that wasn't there.
Mate, I've been banging my head against a brick wall for the past two weeks with this zero wh I bought to do the exact same thing you are, and with the same results.

The bottom line is that sooner or later, usually sooner, when recording video with raspivid, something is causing the BCM2835 driver to crash, and given this controls a bunch of important stuff around memory, interrupts and even the USB stack, it being hosed either totally locks up the system, or even more weirdly for me leaves things completely inconsistent.

What I did, after reading through the following thread, is void my warranty and over voltage the unit (over_voltage=4 and force_turbo=1 to /boot/config.txt) and having done that, I've now been running RPi Cam Control and MotionEye without issue for a couple of days.

The thread I got this info: https://www.raspberrypi.org/forums/view ... 4AtKmxIqmc

The more important question for me is whether:

a) a small bunch of units are not quite fabbing up to spec and exhibit issues, possibly with power supply which we know is a sensitive issue with these Pi given overvoltaging seems to help in many cases

b) all Pi 0 have the issue and many/most just move on when it doesn't work and implement a different solution, or perhaps, there's just not that many people using Pi 0's for security camera functionality

c) It's an issue distinct to the Raspbian Jessie/Buster releases, and MotionEye, which uses BuildRoot to build the base operating system

I'd love to investigate this further and try and find an answer, at this point I consider the 0w unsuitable for camera duty, and have purchased several 3a's, as my 3B setup worked for years without so much as a keystroke of attention in the exact same setup.

pendente
Posts: 5
Joined: Sat Aug 17, 2019 2:06 am

Re: RPi Cam Web Interface

Wed Oct 09, 2019 5:15 pm

Hello!

How can i see the mp4 or the video files an convert them to a GIF file?

Other question is, the file cam.jpg is for the lowest picture file, rigth? Is there an high quality file?

Thank you.

pendente
Posts: 5
Joined: Sat Aug 17, 2019 2:06 am

Re: RPi Cam Web Interface

Thu Oct 10, 2019 12:42 am

Hello,

i was trying to copy a video mp4 to another file to use it after.

can anyone correct my code?

Code: Select all

import os
import time
import datetime
from datetime import datetime
import subprocess
from time import gmtime, strftime
import subprocess

cmdpipe = open("/var/www/html/FIFO", 'w')
cmdpipe.write('ca 1')
time.sleep(10)
cmdpipe.write('ca 0')
cmdpipe.close()
now=datetime.now()
tempo=now.strftime("%Y%m%d_%H%M")
print(tempo)
#fvideo =  os.popen('find /var/www/html/media -type f -iname "*"' + str(tempo) + '"*.mp4"')
fvideo = subprocess.check_output('find /var/www/html/media -type f -iname "*"' + str(tempo) + '"*.mp4"', shell=True)
print('filme: ', fvideo)
if fvideo <> 0 or fvideo <> '':
        s = subprocess.check_output('cp -f ' + str (fvideo) +  ' /var/www/html/video.mp4', shell=True)
I cann't pass throw the calling part. The subprocess doesn't work as i thoght...

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

Re: RPi Cam Web Interface

Thu Oct 10, 2019 1:03 am

pendente wrote:
Thu Oct 10, 2019 12:42 am
Hello,

i was trying to copy a video mp4 to another file to use it after.

can anyone correct my code?

Code: Select all

import os
import time
import datetime
from datetime import datetime
import subprocess
from time import gmtime, strftime
import subprocess

cmdpipe = open("/var/www/html/FIFO", 'w')
cmdpipe.write('ca 1')
time.sleep(10)
cmdpipe.write('ca 0')
cmdpipe.close()
now=datetime.now()
tempo=now.strftime("%Y%m%d_%H%M")
print(tempo)
#fvideo =  os.popen('find /var/www/html/media -type f -iname "*"' + str(tempo) + '"*.mp4"')
fvideo = subprocess.check_output('find /var/www/html/media -type f -iname "*"' + str(tempo) + '"*.mp4"', shell=True)
print('filme: ', fvideo)
if fvideo <> 0 or fvideo <> '':
        s = subprocess.check_output('cp -f ' + str (fvideo) +  ' /var/www/html/video.mp4', shell=True)
I cann't pass throw the calling part. The subprocess doesn't work as i thoght...
Not sure what you're trying to do, but I think you're making it too hard.

I'd recommend starting off with shell scripts rather than Python. If you are using the built-in motion capture system, you can then use the end_box macro (in the System settings) to do whatever post-processing you want. See https://elinux.org/RPi-Cam-Web-Interface#Job_Macros for more details.

pendente
Posts: 5
Joined: Sat Aug 17, 2019 2:06 am

Re: RPi Cam Web Interface

Thu Oct 10, 2019 12:06 pm

ras07 wrote:
Thu Oct 10, 2019 1:03 am
pendente wrote:
Thu Oct 10, 2019 12:42 am
Hello,

i was trying to copy a video mp4 to another file to use it after.

can anyone correct my code?

Code: Select all

import os
import time
import datetime
from datetime import datetime
import subprocess
from time import gmtime, strftime
import subprocess

cmdpipe = open("/var/www/html/FIFO", 'w')
cmdpipe.write('ca 1')
time.sleep(10)
cmdpipe.write('ca 0')
cmdpipe.close()
now=datetime.now()
tempo=now.strftime("%Y%m%d_%H%M")
print(tempo)
#fvideo =  os.popen('find /var/www/html/media -type f -iname "*"' + str(tempo) + '"*.mp4"')
fvideo = subprocess.check_output('find /var/www/html/media -type f -iname "*"' + str(tempo) + '"*.mp4"', shell=True)
print('filme: ', fvideo)
if fvideo <> 0 or fvideo <> '':
        s = subprocess.check_output('cp -f ' + str (fvideo) +  ' /var/www/html/video.mp4', shell=True)
I cann't pass throw the calling part. The subprocess doesn't work as i thoght...
Not sure what you're trying to do, but I think you're making it too hard.

I'd recommend starting off with shell scripts rather than Python. If you are using the built-in motion capture system, you can then use the end_box macro (in the System settings) to do whatever post-processing you want. See https://elinux.org/RPi-Cam-Web-Interface#Job_Macros for more details.
Thank you for the answer.

What i'm trying do is:
I want to send a telegrama command /film that execute this script to make a small filme, copy the file to a new and regular name that i can in the next phase send it to me.

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

Re: RPi Cam Web Interface

Fri Oct 11, 2019 5:36 am

pendente wrote:
Thu Oct 10, 2019 12:06 pm
ras07 wrote:
Thu Oct 10, 2019 1:03 am
I'd recommend starting off with shell scripts rather than Python. If you are using the built-in motion capture system, you can then use the end_box macro (in the System settings) to do whatever post-processing you want. See https://elinux.org/RPi-Cam-Web-Interface#Job_Macros for more details.
Thank you for the answer.

What i'm trying do is:
I want to send a telegrama command /film that execute this script to make a small filme, copy the file to a new and regular name that i can in the next phase send it to me.
You should be able to do that in one line in macros/end_box.sh:

Code: Select all

cp $1 /var/www/html/video.mp4

Return to “Camera board”