taim
New Member
Posts: 32
|
Post by taim on Sept 6, 2021 8:08:02 GMT -8
Hi!
I have just updated to version 27.1
However, I have some issues with the generation of timelapse videos on my raspberry pi zero w.
First, it generated no videos at all. I checked this also with the testPicturemanagement.py script.
Then I also installed ffmpeg via apt-get install an now at least the command buildTimeLapse() seems to work but also seems to brick the pi (green led is blinking constantly). Maybe this is just "overload", since the zero is not a very high-performing machine?
Any advice?
Greetings, Timo
|
|
|
Post by SDL on Sept 10, 2021 10:02:23 GMT -8
Timo,
It is absolutely a Pi Zero problem. SkyWeather2 will run just fine on a Zero, but not the time lapses! It's a bug in the virtual memory system on the Pi we suspect. Theoretically, it should still work, but a lot slower. We had the same problem on an A+. No problem on the 3B+ or the 4B.
BP
|
|
taim
New Member
Posts: 32
|
Post by taim on Sept 11, 2021 5:22:15 GMT -8
I see, well that's a pitty...
Anything I could try though, like reducing the quality of the videos?
|
|
|
Post by SDL on Sept 13, 2021 14:52:34 GMT -8
Yep, try reducing the quality of the video. That might do it.
BP
|
|
|
Post by dmommen on Sept 28, 2021 17:28:20 GMT -8
Hi BP,
I noticed this issue too after upgrading two units based on the A+ Pi. The stills are taken, copied to the temp location, renamed but the resulting mp4 clearly isn't what was intended.
When investigating the issue I came across a recommendation that involved using this parameter:
Note: If you are working with an older model of the raspberrypi (< 3 B+) then you may not have 4 cores available. You will then have to change make -j4 to make -j.
I don't currently have any spare cameras to test this with but should do over the next week and will report back if I make progress here.
Dustin
|
|
|
Post by SDL on Sept 29, 2021 8:45:26 GMT -8
I'm thinking that will not do it Dustin. The -j4 command is to use 4 cores during compiling and not using the cores during execution.
What do you mean by "but the resulting mp4 clearly isn't what was intended"? Specifically.
BP
|
|
|
Post by dmommen on Sept 29, 2021 9:47:54 GMT -8
Hi BP,
I meant that the resultant time lapse MP4 is less than 1KB in size for both systems that I have upgraded to v27. All four are based on Pi 3 A+ to minimize power consumption (mine are LTE connected via Sixfab Hats) and enables them to operate continuously in their remote locations.
Is there another solution other than to upgrade all of them to newer model of Pi?
Thanks,
|
|
|
Post by SDL on Oct 1, 2021 14:17:41 GMT -8
I know of no other solution than to upgrade to newer pi models with more memory. There apparently is some kind of a problem with the older Pis and using Virtual Memory (which would be really slow in any case).
BP
|
|
taim
New Member
Posts: 32
|
Post by taim on Oct 2, 2021 1:28:01 GMT -8
FYI
I have been able to encode a video using ffmpeg without bricking the pi zero by changing to the following options for the ffmpeg command in PictureMangement.py
command ="nice -n 15 ffmpeg -r 20 -i %s -c:v libx264 -preset veryfast -crf 23 %s " % (inputFiles, outputFile)
I needed to install ffmpeg via sudo apt-get install ffmpeg in addition to sudo pip3 install ffmpeg, which I think is not mentioned in the documentation of ver 27.1.
I also only tested this by sudo python3 testPictureManagement.py I will have to wait if it also works automatically.
Please note that the testPicturemanagement.py script still took quite some time (~10min or so) to finish. So be patient when testing. Probably this can be tweaked further using some other -preset options like "superfast" or "ultrafast". All the options are documented here: trac.ffmpeg.org/wiki/Encode/H.264I have not tested this though.
|
|
|
Post by SDL on Oct 3, 2021 13:17:01 GMT -8
Please keep us updated. What did you change to make it work? Othere will want to understand.
BP
|
|
taim
New Member
Posts: 32
|
Post by taim on Oct 3, 2021 23:12:10 GMT -8
Please keep us updated. What did you change to make it work? Othere will want to understand. BP Like I posted previously, I did the following things: 1.) install prerequisites and ffmpeg via
sudo apt-get install ffmpeg and
sudo pip3 install python-aqi and
sudo pip3 install ffmpeg
2.) edit PictureManagement.py using
sudo nano PictureManagement.py 3.) changed the line 208 in PictureManagement.py from
command ="/usr/bin/ffmpeg -r 20 -i %s -c:v libx264 %s " % (inputFiles, outputFile) to
command ="nice -n 15 ffmpeg -r 20 -i %s -c:v libx264 -preset veryfast -crf 23 %s " % (inputFiles, outputFile)" 4.) tested the encoding of the video by using
sudo python3 testPictureManagement.py
In my setting (pi zero w) this successfully generates the timelapse video using the testPictureManagement.py script. However, it still does not work in the "pipeline" at 05:00 for yet unknown reasons... It generates a file, but this file is only 48kb. Note that the first two files from Oct-02 and Oct-03 were generated using the test script.
|
|
|
Post by SDL on Oct 5, 2021 18:03:34 GMT -8
I was specifically asking for what command parameters you changed and why in #3 above.
I'm not sure why you think this will fix it. When you ran it by hand, did you try running "nice"? or staight as you showed.
BP
|
|
|
Post by SDL on Oct 5, 2021 18:03:36 GMT -8
I was specifically asking for what command parameters you changed and why in #3 above.
I'm not sure why you think this will fix it. When you ran it by hand, did you try running "nice"? or staight as you showed.
BP
|
|
taim
New Member
Posts: 32
|
Post by taim on Oct 5, 2021 22:54:26 GMT -8
I was specifically asking for what command parameters you changed and why in #3 above. I'm not sure why you think this will fix it. When you ran it by hand, did you try running "nice"? or staight as you showed. BP Dear BP,
when you compare the two lines in #3 above I hope you can appreciate that I essentially added three things "nice -n 15", "-preset veryfast" and "-crf 23" to the ffmpeg command. Which of the ones does the trick, I did not test and don't know.
Ragarding your second question, why do I think that it will fix it? Simply because in my case it works now and before it didn't. Since I am not an expert at all I have no further explanation, sorry.
Btw. it seems to work in "the pipeline" now as well and generates daily timelapses, which is curious since I did not change anything there.
Regards, Timo
|
|
|
Post by SDL on Oct 6, 2021 14:51:26 GMT -8
Bizarre! Thanks for your explanation. I still have a really good model on why it is working for you now. Since it does fail on my Raspberry Pi A+
BP
|
|