pertm84
Posts: 29
Joined: Sat Oct 20, 2018 10:59 am
Location: Norway

Raspicam+Motion/ffmpeg - Start/Stop stream on website and FTP

Wed Oct 24, 2018 8:41 am

Hi!

I have just installed Raspbian Stretch on Pi 2B, with raspicam and Motion, and it works like a charm! The plan is to use this on a boathouse with a 4G Mobile Router as internet, to keep an eye on our boat during the winterstorms in Norway. However, after running the stream for 5 hours, I noticed it might use too much of my data qouta (6GB). I am totally n00b about scripts, debian and commands, but I can do some copy/pasting and get results. So I would need a step-by-step guide.

My questions:
  • How can I make my Pi take a picture, say every 30 min, save it in memory, upload it to an FTP, and flush the image from memory? I guess the picture will have the same name, so it gets overwritten on the FTP. I guess it can be done using a script, but I need someone to teach me how to compile it, install it, and make it run at boot or intervals of 30 min.
  • And is it possible to have a start/stop button on my website to start livestreaming? Or could I limit the videostream to say, 2 minutes and then make the Pi stop streaming to save bandwidth? Refreshing the page would start the stream again.
Last edited by pertm84 on Wed Oct 24, 2018 9:09 am, edited 1 time in total.

User avatar
RaTTuS
Posts: 10245
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Raspicam+Motion/ffmpeg - Start/Stop stream on website and FTP

Wed Oct 24, 2018 8:48 am

see cron
*/30 * * * * /usr/bin/raspistill -o /tmp/cam.jpg && /usr/bin/scp /tmp/cam.jpg [email protected]:
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

pertm84
Posts: 29
Joined: Sat Oct 20, 2018 10:59 am
Location: Norway

Re: Raspicam+Motion/ffmpeg - Start/Stop stream on website and FTP

Wed Oct 24, 2018 11:03 am

RaTTuS wrote:
Wed Oct 24, 2018 8:48 am
see cron
*/30 * * * * /usr/bin/raspistill -o /tmp/cam.jpg && /usr/bin/scp /tmp/cam.jpg [email protected]:
Thank you for the reply. Is this all the information I need to transfer the image?
I want to upload the image to weather underground:

This is their ftp info:

Server: webcam.wunderground.com
Username: WU_88240
Password: Your Wunderground password
Directory: '/' or leave blank
Filename: image.jpg
Binary: Required

Also, is tmp an automatically created folder?

pertm84
Posts: 29
Joined: Sat Oct 20, 2018 10:59 am
Location: Norway

Re: Raspicam+Motion/ffmpeg - Start/Stop stream on website and FTP

Fri Oct 26, 2018 10:43 am

Actually I found the information I needed here: viewtopic.php?t=184577
And with some Googling, I figured out how to create a bash script and make it executable.

Hopefully, someone else will find some help in this in the future.

Return to “Camera board”