This GIF is from the new Section 31 film. The advert is the Paramount+ promotional clip released last week, which is a crossover between Star Trek and Spongbob: https://lemmy.world/post/28662901
Alternate sizes/qualities
Low quality GIF (376.3 KB):
Low quality WEBP (167.7 KB):
High quality WEBP (1.5 MB):
Full quality MP4 (786.8 KB):
Is this sorta stuff doable with free software? If so, can you point me in the right direction? I definitely have some scenes with this treatment in mind.
Yes, I make these with Kdenlive! I have been putting off finishing the tutorial I have been working on creating, but in short:
- Import video into Kdenlive
- Use Title Clips to add text
- Use various Effects (mainly Transform) to animate the text
- Render as MP4
- Use ffmpeg to convert the MP4 to WEBP or GIF
- Use gifski and gifsicle to further compress the GIF (the WEBP is fine as-is)
Here is a bash script that I wrote to use ffmpeg/gifski/gifsicle to convert all MP4 files in the current directory:
bash
#!/usr/bin/env bash
#prerequisites:
# ffmpeg
# gifski
# gifsicle
# creates animated images out of all MP4 files
# in the working directory, as well as creating
# a thumbnail out of one frame
# if argument passed to script, the thumbnail
# will be created out of that frame, but none of
# the animated files will be created
# pass an argument to this script to specify
# which frame to use as the thumbnail
# if none passed, use default
if [[ $1 == "" ]]; then
frame=0.85
else
frame=$1
fi
# frame passed must be decimal < 1.0 and >= 0.0
if ! ([[ $frame =~ 0\.[0-9]+ ]]); then
echo frame passed: $frame
else
# loop through all MP4 files in directory
for file in *.mp4
do
# only proceed if file found
if [[ $file != *"*"* ]]; then
# create paths
input_path=$(pwd)/"$file"
output_path_animated=${input_path%.*}.webp
output_path_animated_low=${input_path%.*}-low.webp
output_path_gif=${input_path%.*}.gif
output_path_thumb=${input_path%.*}_thumb.webp
# determine the exact frame to use as thumbnail
frames_total=$(ffprobe -v error -select_streams v:0 -count_packets -show_entries stream=nb_read_packets -of csv=p=0 "$input_path")
thumb_frame=$(awk -vnumber="$(awk -v var1=$frames_total 'BEGIN { print (var1 * '$frame') }')" -vdiv="1" 'function ceiling(x){return x%1 ? int(x)+1 : x} BEGIN{ print ceiling(number/div) }')
# if argument had been passed to script, skip creating
# animated images and ONLY create thumbnail
if [[ $1 == "" ]]; then
#full webp
ffmpeg -y -hide_banner -loglevel error -i "$input_path" -vcodec libwebp -lossless 0 -loop 0 -preset default -an -fps_mode passthrough -vf "fps=25, scale=-1:500" -quality 80 "$output_path_animated"
#low webp
ffmpeg -y -hide_banner -loglevel error -i "$input_path" -vcodec libwebp -lossless 0 -loop 0 -preset default -an -fps_mode passthrough -vf "fps=15, scale=-1:270" -quality 10 "$output_path_animated_low"
#low gif
ffmpeg -y -hide_banner -loglevel error -i "$input_path" -f yuv4mpegpipe - | gifski --quiet --height=270 --fps 10 --quality=50 --lossy-quality 50 -o "$output_path_gif" -;gifsicle -O3 --lossy=200 --colors 256 -o "$output_path_gif" "$output_path_gif"
fi
#thumb
ffmpeg -y -hide_banner -loglevel error -i "$input_path" -vf "select=eq(n\,$thumb_frame), scale=-1:270" -c:v libwebp -quality 50 "$output_path_thumb"
echo $input_path
else
echo MP4 not found
fi
done
fi
Another helpful resource would be gif-template.kdenlive
from my 30 Rock GIF repo below. This will not work exactly as you need, as that project file is made for a 1920x1080 source video and Section 31 is 1920x800 or whatever. But if you are new to Kdenlive, it might help you understand effects and keyframes.