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):

  • SatyrSack@feddit.orgOP
    link
    fedilink
    English
    arrow-up
    4
    ·
    4 days ago

    Yes, I make these with Kdenlive! I have been putting off finishing the tutorial I have been working on creating, but in short:

    1. Import video into Kdenlive
    2. Use Title Clips to add text
    3. Use various Effects (mainly Transform) to animate the text
    4. Render as MP4
    5. Use ffmpeg to convert the MP4 to WEBP or GIF
    6. 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