Monatage Labeling
Posted: 2012-08-23T04:30:16-07:00
Hi,
Been fiddling for a couple days now trying to get this just right but feel like I'm starting to spin my wheels. In short I'm trying to label my storyboard thumbs.
xubuntu 12.04 Precise
Version: ImageMagick 6.6.9-7 2012-04-30 Q16
In detail:
I would like to have a defined image size when I'm done (600x800) with the title of the video placed at the bottom in the padded space. (possibly adding a semi-transparent frame around the image or border the sides with film sprockets)
The script I'm using will always create an image width of 600x, but the height can change depending on the aspect of the video. This should afford me the space for labeling on my 16:9 videos which are the bulk of my collection. The 4:3 videos however result in an image over x900. For these I just want to distort/squish the height enough to add the label and keep the result at x800.
I'm not even sure how to start in handling the padding/squish, but the script as it is now will produce the basic result I'm seeking minus the frame. If I could get some ideas of how to pad/squish properly and any advice on where I should add the frame commands in the sequence it would be a big help.
Thanks,
Ako
Been fiddling for a couple days now trying to get this just right but feel like I'm starting to spin my wheels. In short I'm trying to label my storyboard thumbs.
xubuntu 12.04 Precise
Version: ImageMagick 6.6.9-7 2012-04-30 Q16
In detail:
I would like to have a defined image size when I'm done (600x800) with the title of the video placed at the bottom in the padded space. (possibly adding a semi-transparent frame around the image or border the sides with film sprockets)
The script I'm using will always create an image width of 600x, but the height can change depending on the aspect of the video. This should afford me the space for labeling on my 16:9 videos which are the bulk of my collection. The 4:3 videos however result in an image over x900. For these I just want to distort/squish the height enough to add the label and keep the result at x800.
I'm not even sure how to start in handling the padding/squish, but the script as it is now will produce the basic result I'm seeking minus the frame. If I could get some ideas of how to pad/squish properly and any advice on where I should add the frame commands in the sequence it would be a big help.
Thanks,
Ako
Code: Select all
#!/bin/bash
# Script to create a storyboard montage from any video file that
# ffmpegthumbnailer supports.
echo "–> Generating thumbnails with ffmpegthumbnailer"
montagefiles=""
# Next command determines how many & at what % the thumbs are created
# Also used to create outputfilename.
for i in {5..90..5}
do
fileProper=$(readlink -f "$1") # full path of file
pathNoExt=${fileProper%.*} # full path minus extension
fname=`echo "$fileProper"`
echo "$fname"
outputfilename="seek-${i}.png"
# Set ffmpegthumbnailer options here.
ffmpegthumbnailer -i "${1}" -t "${i}%" -o "${outputfilename}" -s 200
montagefiles="${montagefiles} ${outputfilename}"
echo -n ".${i}%"
done
echo
echo "–> Creating montage with ImageMagick"
# Set montage options here.
montage -geometry +0+0 -tile 3x6 -background none -fill white \
${montagefiles} "${pathNoExt}"_temp.png
echo "–> Adding Border & Label"
piclabel=`echo "${fileProper}" | sed 's/^\/.*\/\(.*\)\ \[.*\....$/\1/'`
convert "${pathNoExt}"_temp.png -background black -fill white -font Verdana\
-size 550x -gravity center\
label:"${piclabel}" -gravity South -append \
"${pathNoExt}".png
echo "–> Cleanup:Removing individual temporary thumbnails"
for i in {5..90..5}
do
rm -f "seek-${i}.png"
done
echo "Done."