I have a project where my Raspberry Pi starts taking pictures at 4:30AM and stops at 7:30AM everyday. Then MENCODER or AVCONV should turn on to stitch them together into a movie. Then a Dropbox Uploader uploads the movie to my dropbox account, and another process deletes all of the pictures.
The only one of those that is not working is the MENCODER or AVCONV portion.
I started out using MENCODER, and it works just fine when I use it in the terminal. However, when I put it in Cron, it makes a movie with just one frame and then quits. Apparently it is a known problem and this was posted to get around it. I was not able to make the MAILTO solution work. I guess I don't know where it goes in my Crontab file.
I moved to using AVCONV, and again it works just fine in the terminal. However, when I put it in Cron as a scheduled task, nothing seems to happen. The time when it is supposed to kick on comes and goes, and there is no sign of a movie file. I searched and didn't find any kind of common problem with AVCONV.
This is my bash script for making the movie with MENCODER
#!/bin/bash
DATE=$(date +"%F") ls *.jpg > stills.txt mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:aspect=16/9:vbitrate=8000000 -vf scale=1920:1080 -o /home/pi/camera/$DATE.avi -mf type=jpeg:fps=17 mf://@stills.txt
This is my bash script for making the movie with AVCONV.
#!/bin/bash DATE=$(date +"%Y%m%d") avconv -r 10 -i frame_%04d.jpg -r 10 -vcodec libx264 -crf 20 -g 15 $DATE.mp4
This is my crontab file
30 4 * * * python /home/pi/camera/camera.py & 35 7 * * * /home/pi/camera/avconv.sh 2>&1 35 10 * * * python /home/pi/upload.py & 35 11 * * * python /home/pi/clearpic.py &
Any assistance would be greatly appreciated. As I mentioned, everything else works, and this is the one part that is keeping me from installing my project at a school.
Thank you!




