[Digikam-devel] [digikam] [Bug 315323] New: Create a Digikam Time Lapse plugin

Vangelis cyberang3l at gmail.com
Sun Feb 17 14:45:02 GMT 2013


https://bugs.kde.org/show_bug.cgi?id=315323

            Bug ID: 315323
           Summary: Create a Digikam Time Lapse plugin
    Classification: Unclassified
           Product: digikam
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: wishlist
          Priority: NOR
         Component: general
          Assignee: digikam-devel at kde.org
          Reporter: cyberang3l at gmail.com

One feature I really miss from Linux and not only digikam itself, is the
ability to create time lapse videos from photographs easily.

After some intensive search and work, I found my way to create time lapse
videos, but I need the console and a few manual steps that probably would be
easy to be implemented as a new feature in digikam (probably by a Google Summer
of Code project assigned to a student? :) ).

Step 1:
First you need to put all of the pictures in a folder that you will work with
(In digikam you should get a window with some options on either to choose the
photos one by one, or a folder and all of its contained images).

Step 2:
You need create a text file and put the filenames in the right frame order and
sometimes when the time your camera reaches the final file like DSC_9999.jpg,
it will start from DSC_0001.jpg again so this might not be trivial in specific
cases. So digikam should read the exif an put the photographs in order
according to their creation date.

Step 3:
The photographs must be resized to the desired output video resolution. For
example if you want to create a FullHD 1920x1080 video, but your photos are
18Mpixels, first you need to resize the pictures otherwise you will get much
unnecessary processing time. The plugin should give the option to the user to
keep the aspect ration or not.

Step 4:
Optionally you might want change the levels, brightness, contrast, saturation,
curves or sharpen all of the photographs to promote some details and enhance
the photos, so some batch processing should be done here similar to the
recording functionality of Photoshop but much simpler. Ideally open the first
photo in showfoto, make some limited changes, and perform these to the rest of
the photos being part of the time lapse

Step 5:
The photographs will usually have some flickering because even if you choose a
fixed shutter speed, this might not be exact for each photograph taken, due to
the mechanical parts of the camera (If 1/200s is chosen as the shutter speed,
first photo might 1/199s and the one after might 1/202s). In this case the
final time lapse video will be flickered. Optional deflickering with some
options chosen by the user (for example the rolling window averages for
luminance calculation for each photo) should take process.

Step 6:
Create a quick preview of the video and show it to the user.

Step 7:
Choose the codec to compile the time lapse video and save it.

This would give much value to digikam, and the whole open source Linux world as
I haven't found a tool to perform these simple tasks with a nice graphical user
interface.

The way I perform these steps now is the following:

Resize the images first to 1920x1080 (all of the rest of the operations will be
much much faster)

Resize pictures:
# cd source_folder_of_pictures
# mkdir resized
# mogrify -path resized -resize 1920x1080! *.jpg

Use ls to sort the files by their filename.
# cd resized
# ls -1 | grep -v files.txt > files.txt

Use mencoder to combine all of the photos in one video without losing quality!
WARNING: Use ONLY ONE of the following 3 commands
TIP: I usually choose the first one to quickly check the result and then I
re-make the video with the second or third command if I want to make some post
processing in kdenlive.

Command 1 # mencoder -nosound -noskip -oac copy -ovc copy -o test.avi -mf
fps=15 'mf://@files.txt' <- Very fast but does not create index so if you want
to edit with a non linear editor do not choose this.

Command 2 # mencoder -idx -nosound -noskip -ovc lavc -lavcopts vcodec=mjpeg -o
test.avi -mf fps=25 'mf://@files.txt' <- Fast, it will create index, but it
will re-compress the JPG files so some loss of quality will occur
(insignificant, so you can safely bet on this) 

Command 3 # mencoder -idx -nosound -noskip -ovc lavc -lavcopts vcodec=ljpeg -o
test.avi -mf fps=25 'mf://@files.txt' <- Slow, it will create index, it will
re-compress the JPG file but with the highest quality options to provide
lossless results (the final file will be larger than the total of the original
files, but if you are a quality freak, then go for this one)


Use ffmpeg to compress the video.
# avconv -i test.avi -c:v libx264 -preset slow -crf 15 output-final.mkv

Check here for more encoding options:
https://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide

To perform the two optional steps:
Step 4: I use photoshop in wine and the record functionality
Step 5: I have made my own perl script that uses imagemagick to calculate
luminance of each photo, calculate the new luminance for each photo with
rolling averages and eventually change the luminance for each photo
(https://www.youtube.com/watch?v=SNfq__chC5M).

Reproducible: Always

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Digikam-devel mailing list