rpiswag
Posts: 804
Joined: Mon May 19, 2014 10:04 pm

Raspberry Pi Time Lapse With the Pi Camera

Fri Mar 27, 2015 11:01 pm

I want to make a Time Lapse Video that takes 5 mp pictures for 12 hours running on a raspberry pi 2 running raspbian with nothing but the default install. Do I have enough space? I want to compile the pictures into a video with the pi 2. I want all processing done on the pi 2 and nothing done on another pc. Can this be done? What commands with raspistill and what tool should I use to make the video? I would also like the video to be at 2592×1944 (the native picture resolution) if possible and I would like to to be compressed to save space.
A computer's power can't be just measured Gigahertz. It is the same thing with us humans.

User avatar
davidcoton
Posts: 3197
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Raspberry Pi Time Lapse With the Pi Camera

Fri Mar 27, 2015 11:26 pm

Try it. You'll soon find out. Even if people here say it can't be done, maybe you will find a way. And if someone tells you how, you won't learn anything.

BTW, it would make more sense to keep all your questions about one part of one project in one topic.
"Thanks for saving my life." See https://www.raspberrypi.org/forums/viewtopic.php?p=1327656#p1327656
“Raspberry Pi is a trademark of the Raspberry Pi Foundation”

rpiswag
Posts: 804
Joined: Mon May 19, 2014 10:04 pm

Re: Raspberry Pi Time Lapse With the Pi Camera

Fri Mar 27, 2015 11:38 pm

Not to be offensive in any way but there is plenty to learn. Getting the programs installed and working is just the beginning. There is so much to learn. What I am going to film, what angle, where I am going to film, What time am I going to film and there is so much more to learn. Help me get started and I will learn.
A computer's power can't be just measured Gigahertz. It is the same thing with us humans.

User avatar
davidcoton
Posts: 3197
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Raspberry Pi Time Lapse With the Pi Camera

Sat Mar 28, 2015 9:01 am

Of course there is much to learn. Including how to get started. Find the raspistill documentation and start there. Someone may be able to suggest a program for compiling the video, but it's not something I've tried.
"Thanks for saving my life." See https://www.raspberrypi.org/forums/viewtopic.php?p=1327656#p1327656
“Raspberry Pi is a trademark of the Raspberry Pi Foundation”

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20752
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi Time Lapse With the Pi Camera

Sat Mar 28, 2015 10:14 am

rpiswag wrote:I want to make a Time Lapse Video that takes 5 mp pictures for 12 hours running on a raspberry pi 2 running raspbian with nothing but the default install. Do I have enough space? I want to compile the pictures into a video with the pi 2. I want all processing done on the pi 2 and nothing done on another pc. Can this be done? What commands with raspistill and what tool should I use to make the video? I would also like the video to be at 2592×1944 (the native picture resolution) if possible and I would like to to be compressed to save space.
What size is the SD card? How often are you taking the pictures? Average size of the JPG is about 2.5MB IRC, so divide space left on SD card by that, and see how many pictures you can take. Then use the number you want per minute or so figure to work out how many minutes of storage you have.

Use ffmpeg (or avconv) to splice the images together.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

rpiswag
Posts: 804
Joined: Mon May 19, 2014 10:04 pm

Re: Raspberry Pi Time Lapse With the Pi Camera

Sat Mar 28, 2015 12:34 pm

I have 28 GB of space to use and I want to take a 5mp photo every minute.
A computer's power can't be just measured Gigahertz. It is the same thing with us humans.

gordon77
Posts: 3418
Joined: Sun Aug 05, 2012 3:12 pm

Re: Raspberry Pi Time Lapse With the Pi Camera

Sat Mar 28, 2015 1:37 pm

2.5MB x 12hours x 60mins = 1800MB or 1.8GB

rpiswag
Posts: 804
Joined: Mon May 19, 2014 10:04 pm

Re: Raspberry Pi Time Lapse With the Pi Camera

Sat Mar 28, 2015 1:51 pm

So Storage is not a problem. How do use raspistill to take a picture every minute for 12 hours and what tool should I use that is the best overall. It would be nice if the tool uses all of the Raspberry Pi 2B's 4 cores.
A computer's power can't be just measured Gigahertz. It is the same thing with us humans.

asavah
Posts: 347
Joined: Thu Aug 14, 2014 12:49 am

Re: Raspberry Pi Time Lapse With the Pi Camera

Sat Mar 28, 2015 1:56 pm

rpiswag wrote:So Storage is not a problem. How do use raspistill to take a picture every minute for 12 hours and what tool should I use that is the best overall. It would be nice if the tool uses all of the Raspberry Pi 2B's 4 cores.
Write a script in python to take pics with the intervals you need, subprocess.call() and threading.Timer() would do quite nicely.
Or grab raspistill sources and modify them to suit your needs.


rpiswag
Posts: 804
Joined: Mon May 19, 2014 10:04 pm

Re: Raspberry Pi Time Lapse With the Pi Camera

Sat Mar 28, 2015 2:45 pm

Ok now what tool should I use for turning those pictures into a video? It would be nice if the tool could use all of the Raspberry Pi 2B's 4 core cpu.
A computer's power can't be just measured Gigahertz. It is the same thing with us humans.

gordon77
Posts: 3418
Joined: Sun Aug 05, 2012 3:12 pm

Re: Raspberry Pi Time Lapse With the Pi Camera

Sat Mar 28, 2015 2:50 pm

My first link mentions mencoder

rpiswag
Posts: 804
Joined: Mon May 19, 2014 10:04 pm

Re: Raspberry Pi Time Lapse With the Pi Camera

Sat Mar 28, 2015 3:01 pm

Just saying is there a tool that the command is not as long but still has good functionality.
A computer's power can't be just measured Gigahertz. It is the same thing with us humans.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Raspberry Pi Time Lapse With the Pi Camera

Sat Mar 28, 2015 3:26 pm

C&P ?
It doesn't matter how long the command is then. I only type about half the stuff I use, I just find a convincing looking line on a website/forum somewhere and zap it in....
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

rpiswag
Posts: 804
Joined: Mon May 19, 2014 10:04 pm

Re: Raspberry Pi Time Lapse With the Pi Camera

Sat Mar 28, 2015 4:10 pm

What do you think of the tutorial that I found on youtube https://www.youtube.com/watch?v=C2b4aIirE48.
A computer's power can't be just measured Gigahertz. It is the same thing with us humans.

User avatar
kusti8
Posts: 3441
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

Re: Raspberry Pi Time Lapse With the Pi Camera

Sat Mar 28, 2015 4:32 pm

It looks like it would work. Just for the future, please Google your questions before asking because a lot of what you have been asking (including this question) is already outlined online like in the tutorial that you found.
There are 10 types of people: those who understand binary and those who don't.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Raspberry Pi Time Lapse With the Pi Camera

Sat Mar 28, 2015 4:39 pm

rpiswag wrote:What do you think of the tutorial that I found on youtube https://www.youtube.com/watch?v=C2b4aIirE48.
Not a lot, you can't cut and paste out of a video into the command line....

While we're on Youtube

https://www.youtube.com/watch?v=2aXWWps3pJU

A series of stills I stitched together into a video about 7 years ago using mencoder and linux. The stills were pulled out of motion so aren't a true timelapse, but its an interesting effect. This stuff isn't unique to the Raspberry Pi. 2008 predates the Pi by a long way.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

rpiswag
Posts: 804
Joined: Mon May 19, 2014 10:04 pm

Re: Raspberry Pi Time Lapse With the Pi Camera

Sat Mar 28, 2015 5:45 pm

I know you can't copy and paste from a video which would be awesome. What I meant by that was that I wanted to see if the instructions where correct and were up to date and non of the steps to make the time lapse were missed.
A computer's power can't be just measured Gigahertz. It is the same thing with us humans.

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: Raspberry Pi Time Lapse With the Pi Camera

Sat Mar 28, 2015 6:12 pm

You're already 6 hours further asking questions answered long ago. I remember when the Pi camera came out it took me about half an hour to create my first time lapse movie, including taking the photographs. All by just googling. In other words, why not give it a try and ask questions if you hit a wall?

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Raspberry Pi Time Lapse With the Pi Camera

Sat Mar 28, 2015 6:27 pm

I struggle following videos and other peoples code, so I don't know. It isn't a difficult process, break it into two pieces, the first bit is the time lapse to get a collection of stills, then the second bit which needn't even be done on a Pi, is to stitch 'em together into a video. My stills came from a hacked NAS box running motion on Debian, I pulled 'em of said box into my Linux PC with ssh/sftp and then ran mencoder on that. Its very flexible, sø there are literally millions of ways of doing it. The mencoder bit is pretty intensive so its probably done on something with a bit more grunt than a Pi anyway.

I'd write a shell script that ran from crontab once a minute to make directory full of sequentially numbered stills from the Pi's camera for starters. When you've got that far then do the mencoder bit.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

mikerr
Posts: 2729
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Raspberry Pi Time Lapse With the Pi Camera

Sat Mar 28, 2015 6:55 pm

Covert a load of jpegs file into a video:

Code: Select all

sudo apt-get install libav-tools

Code: Select all

sudo avconv -r 4 -i %04d.jpg -r 4 webcam.mp4 
Android app - Raspi Card Imager - download and image SD cards - No PC required !

rpiswag
Posts: 804
Joined: Mon May 19, 2014 10:04 pm

Re: Raspberry Pi Time Lapse With the Pi Camera

Sat Mar 28, 2015 8:52 pm

Thank you now can you tell me what sudo avconv -r 4 -i %04d.jpg -r 4 webcam.mp4 means? How would I adjust frame rate?
A computer's power can't be just measured Gigahertz. It is the same thing with us humans.

mikerr
Posts: 2729
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Raspberry Pi Time Lapse With the Pi Camera

Sat Mar 28, 2015 9:12 pm

Android app - Raspi Card Imager - download and image SD cards - No PC required !

rpiswag
Posts: 804
Joined: Mon May 19, 2014 10:04 pm

Re: Raspberry Pi Time Lapse With the Pi Camera

Sat Mar 28, 2015 11:08 pm

So what is a good frame rate with what I want to film. I talked about what I wanted to film in a previous post.
A computer's power can't be just measured Gigahertz. It is the same thing with us humans.

gordon77
Posts: 3418
Joined: Sun Aug 05, 2012 3:12 pm

Re: Raspberry Pi Time Lapse With the Pi Camera

Sun Mar 29, 2015 8:41 am

Can 1fpm be classed as filming. So I am not sure what difference the subject you are taking will make.
Try different values and see how the playback looks.

Return to “General discussion”