Linux software for time lapse?

  • 10 Replies
  • 18226 Views
Linux software for time lapse?
« on: 07 / November / 2010, 14:49:30 »
Advertisements
Can anyone suggest an easy to use (and ideally free :-) program for assembling time lapse videos that runs in Linux? I've found a few, such as "ffmpeg", but they require compiling and a lot of command line stuff that I don't really understand. I found one called "stopmotion" but it is apparently just a gui for ffmpeg, so all that compiling and stuff is still required. I don't even know what compiling means (I've been compiling up the leaves in my yard most of the day, and hauling them over to the compost pile ;-)

Someone claimed that time lapse could be done in Gimp, but I've looked around and couldn't find the tools for that.

I could do this under Windows, but all my photos are on the Linux side of my hard drive; I'd have to copy them to a thumb drive and move them over. But if there's nothing easy available for Linux, I'm open to suggestions for a simple Windows-based program.

Thanks.

*

Offline a1ex

  • *****
  • 661
  • ML dev
Re: Linux software for time lapse?
« Reply #1 on: 07 / November / 2010, 15:29:34 »
Avidemux (has GUI for both GTK and QT). Also, Virtualdub is more powerful and runs in wine.

If you have Ubuntu/Debian, just type "sudo apt-get install avidemux" (without quotes) to install it.

And if you like it, Avidemux runs in Windows, too. Very useful for converting videos.
« Last Edit: 07 / November / 2010, 15:32:05 by a1ex »

*

Offline reyalp

  • ******
  • 10069
Re: Linux software for time lapse?
« Reply #2 on: 07 / November / 2010, 15:35:57 »
Most linux distros offer pre-compiled packages for popular programs. I'd expect ffmpeg to fall into this category (it does on ubuntu). Third parties also frequently off binary pages (.rpm, .deb etc)

on windows, virutaldub is quite useful http://www.virtualdub.org/
Don't forget what the H stands for.

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Linux software for time lapse?
« Reply #3 on: 07 / November / 2010, 15:58:02 »
I've used mencoder via this small script (16:9 1920x1080, for smaller resolutions just change the scale=x:y and reduce vbitrate)

Code: [Select]
#!/bin/bash

if [ -z "$1" ]; then
  echo "USAGE: $0 listfile fps type"
  echo
  echo "listfile contains filenames for input images:"
  echo "ls -1 1/*.JPG > listfile"
  echo "ls -1 2/*.JPG >> listfile"
  echo
  echo "fps defaults to 25 frames/second"
  echo "type defaults to jpeg (png, tga, sgi also available)"
  echo
  exit 1
fi

listfile=$1

if [ -z "$2" ]; then fps=25; else fps=$2; fi
if [ -z "$3" ]; then ftype=jpeg; else ftype=$3; fi

mencoder "mf://@$listfile" -mf type="$ftype":fps=$fps -o timelapse_1080p.avi -ovc lavc -lavcopts vcodec=mpeg4:vpass=1:vbitrate=16000:autoaspect -vf scale=1920:1080
mencoder "mf://@$listfile" -mf type="$ftype":fps=$fps -o timelapse_1080p.avi -ovc lavc -lavcopts vcodec=mpeg4:vpass=2:vbitrate=16000:autoaspect -vf scale=1920:1080

for 4:3 aspect, replace mencoder commands with these:
Code: [Select]
mencoder "mf://@$listfile" -mf type="$ftype":fps=$fps -o timelapse_1080p.avi -ovc lavc -lavcopts vcodec=mpeg4:vpass=1:vbitrate=16000:autoaspect -vf scale=1440:1080
mencoder "mf://@$listfile" -mf type="$ftype":fps=$fps -o timelapse_1080p.avi -ovc lavc -lavcopts vcodec=mpeg4:vpass=2:vbitrate=16000:autoaspect -vf scale=1440:1080


*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Linux software for time lapse?
« Reply #4 on: 07 / November / 2010, 16:14:16 »
Most linux distros offer pre-compiled packages for popular programs. I'd expect ffmpeg to fall into this category (it does on ubuntu).

Due to fear of algorithm patent lawsuits, most distros only offer crippled versions of video encoder software. It's sometimes tedious to fix things to work the way they should, compiling ffmpeg/libavcodec may be one of the required steps. Integrating your build to the distro's package management and keeping things smooth at upgrades may be hard.

But since the problem is really very common, there are more or less 3rd party repositories for many distributions that may help (medibuntu for Ubuntu, debian-multimedia for Debian, livna for Fedora, ...).

Re: Linux software for time lapse?
« Reply #5 on: 08 / November / 2010, 23:34:02 »
Thanks for the suggestions guys; I'll have a look. Another browse through the "Ubuntu Software Center" revealed "WinFF", described as a gui for ffmpeg. Haven't tried it yet; work is getting in the way of fun this week.

Playing with the Stopmotion program some more last night I found that it does seem to have ffmpeg included in the package. It's very simple to drop your photos into and preview the time lapse. But when attempting to convert to a video file it failed, possibly because I had removed several badly exposed frames so the file number sequence was broken. I think I read something about that while surfing around for programs last night.

*

Offline na560

  • *
  • 11
Re: Linux software for time lapse?
« Reply #6 on: 16 / November / 2010, 07:17:58 »
I've used "dvd-slideshow" to create timelapse videos. It uses ffmpeg. There is an introduction at http://www.linux.com/archive/feature/127059. It requires a text file listing all the images along with the time to display each image which can be generated by "dir2slideshow". Since it is a text file the list can be edited and images can be deleted from the sequence. The list can also be reordered and more or less time can be given to each image individually. Documentation is on sourceforge and in man pages.

Re: Linux software for time lapse?
« Reply #7 on: 04 / March / 2011, 08:53:12 »
Ive used UHVO. Its a "video to image" stacking program and easy to use and its free. You can find it here https://sites.google.com/site/linuxuhvo/


Re: Linux software for time lapse?
« Reply #8 on: 05 / September / 2011, 03:51:44 »
My 2 cents:
Code: [Select]
#!/bin/bash
#set quality by scale;  $1=frame per second $2 filename
mencoder "mf://*.JPG" -mf w=1728:h=1152:type=jpg:fps=$1 -o /home/arch/video/time/$2-$1.fps.avi -of lavf -ovc lavc -lavcopts vcodec=mjpeg
-lavfopts format=avi
sleep 5 && dragon ~/video/time/$2-$1.fps.avi 

Edit paths and save as "timelapse"  in ~/bin I use this script directly in the   folder with the pictures  in the camera/sd card:
Code: [Select]
timelapse 25 video_name




Re: Linux software for time lapse?
« Reply #9 on: 26 / September / 2011, 21:41:59 »
Cool that someone does timelapse with linux! Read my guide i posted at ubuntu forums days ago (I copy and paste). Particularly i managed to have the timelapse encoded in H.264 codec, the best video codec ever. And in mp4 container, just as vimeo suggests.

P.D: I don't know how many users are we here... but this could go sticky.



Ok. You have taken a few thousands of photos, and now you expect to turn them into a cool time lapse video. You also would like to upload it to, for example, Vimeo, as an HD video. Of course, you want all of this without using Windows or any of it's apps.

That's exactly what i did here: (This video hasn't the full res of HD cos i wrote the resize settings wrong. However, it works as you input resize settings above 1280*720px. For vimeo specifications, read the Vimeo FAQ)

Vimeo tells you that:
Quote
A codec is the format in which your video will be encoded. Different codecs have different features and varying quality. For best results, we recommend using H.264 (sometimes referred to as MP4).

How to?
I managed to do it using MEncoder and FFMPEG: Both are in synaptic. However a special install is needed. Without it, the commands for encoding the video won't work properly (THANKS FakeOutdoorsman):


Quote from: FakeOutdoorsman;4907079
FFmpeg is a versatile tool to encode and decode a multitude of video and audio formats.  x264 encodes high-quality H.264 video.

[SIZE="4"]Choose your Ubuntu[/SIZE]
[SIZE="4"]0.[/SIZE]The instructions on the page are for [size="3"]Ubuntu Natty Narwhal 11.04[/size] and [size="3"]Ubuntu Maverick Meerkat 10.10[/size]. Separate instructions are also available for older, supported releases:
[SIZE="4"]Install the Dependencies[/SIZE]
[SIZE="4"]1.[/SIZE] Uninstall x264, libx264-dev, and ffmpeg if they are already installed. Open a terminal and run the following (you can usually paste into a terminal with shift+ctrl+v). Copy and paste the whole code box for each step.
Code: [Select]
sudo apt-get remove ffmpeg x264 libx264-dev[SIZE="4"]2.[/SIZE] Get all of the packages you will need to install FFmpeg and x264 (you may need to enable the Universe and Multiverse repositories):
Code: [Select]
sudo apt-get update
sudo apt-get install build-essential checkinstall git libfaac-dev libjack-jackd2-dev \
  libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev \
  libva-dev libvdpau-dev libvorbis-dev libx11-dev libxfixes-dev libxvidcore-dev texi2html \
  yasm zlib1g-dev


[SIZE="4"]Install x264[/SIZE]
[SIZE="4"]3.[/SIZE]  Get the current source files, compile, and install x264.
Code: [Select]
cd
git clone git://git.videolan.org/x264
cd x264
./configure --enable-static
make
sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | \
    awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes \
    --fstrans=no --default


Now that everything is properly installed, we're ready to encode the video:
3 commands here, each one is separated by a ";" from another, so you can run it by copy paste. This must be run in the same folder your photos are in.

Code: [Select]
mencoder mf://*.jpg -mf fps=30 -vf scale=1280:-1 -ovc x264 -x264encopts pass=1:bitrate=6000:crf=20:preset=veryslow -nosound -ofps 30 -noskip -of rawvideo -o rawoutput.264 ; ffmpeg -f h264 -i rawoutput.264 -r 30 -vcodec copy muxed.mp4 ; rm rawoutput.264
Aclaration: You can replace "30" by your desired frames per second. And in
Code: [Select]
preset=veryslow you can change to "veryfast" if you want just a sample video. Encoding time will shorten greately, and quality will suffer a little bit.

It took me few days until i get this. But of course, the point is that with ubuntu is more than possible to achieve a high quality timelapse video created from photos. It's really cool.


Expanation: 1)Mencoder creates a RAW video output using H.264 codec, b-frames, and a set of preseted parameters that goes for high quality. Now, since MEncoder's MP4 muxer doesn't get on well with b-frames videos, we will have to mux it into a MP4 container with FFMEG. That's what the second command do. 3) The third command deletes the RAW H.264 video, leaving alone the mp4 video.

Finally, you can add an audio track to make it more interesting:

Code: [Select]
ffmpeg -i video-without-audio.mp4 -i audio.mp3 -vcodec copy -acodec copy video-with-audio.mp4


The truth is that FFMPEG can do this all, but the H.264 encoding with FFMPEG was terrible in my case, the dynamic range happened to be from 14,14,14 to 235,235,235, ergo, darkest pixels weren't black (0,0,0) and whitest pixels weren't white (255,255,255). Greyish and awful image, but i couldn't solve it.


Hope somebody finds this useful when googling.
« Last Edit: 26 / September / 2011, 21:44:00 by nahuel_89p »

 

Related Topics