After almost 4 weeks I have enough pictures to create my first video production. (How to capture images with a still camera attached to Raspberry Pi is described here and here.)
I started from converting all pictures to 1920x1080 resolution with convert
run from a simple Perl script. As the input file names are constructed as NIKYYYYMMDDHHMM.jpg
(where YYY denotes year, MM denotes month etc) alphabetic sorting is OK. The resulting files are named as hd1920_00001.jpg
, hd1920_00002.jpg
, etc.
#!/usr/bin/perl
opendir (DIR, ".");
my @files = sort { $a cmp $b } readdir(DIR);
while (my $file = shift @files ) {
if ($file =~ /.jpg$/) { $fileNo++;
$file_out = sprintf "hd1920_%05d.jpg", $fileNo;
print "$file -> $file_out\n";
system ("convert", $file, "-geometry", "1920x1080", "$file_out");
}
}
There are exactly 1784 pictures:
$ls -l hd1920_0* | wc -l
1784
Conversion of all images lasted circa half an hour on my decent PC. Each picture size is about 0,5Mb, while the total size is 0,85Gb:
$ls -l hd1920_0* | awk '{t+=$5}; END{print t}'
853332231
To create a video from the images I run ffmpeg
now:
ffmpeg -r 12 -qscale 2 -i hd1920_%05d.jpg Tomato_12.mp4
Where -r 12
means frames ratio (12 fps) and -qscale
determines video quality (1 denotes best quality and 32 is the lowest one).
The video size is about 450 Mb. The conversion takes circa 3min (on my decent PC) and the video length is 2min 29 seconds.
The movie's subject is a growing tomato (Pinkaccordion variety of course:-). The photographs were taken every 20 minutes from March 16th to April 11th.
Brak komentarzy:
Prześlij komentarz