Skip to content

Instantly share code, notes, and snippets.

@AvinashReddy3108
Created October 13, 2022 04:23
Show Gist options
  • Save AvinashReddy3108/693edaca28f0d979abeeb869cfa7233f to your computer and use it in GitHub Desktop.
Save AvinashReddy3108/693edaca28f0d979abeeb869cfa7233f to your computer and use it in GitHub Desktop.
Simple script to convert some videos for use as a wallpaper in KDE 5.26+
#!/bin/bash
# Simple script to convert some Anime Live Wallpapers for use in KDE 5.26+
# Files
INPUT_FILENAME="$1" # path to the input video.
OUTPUT_FILENAME="${INPUT_FILENAME%.*}.avif"
# Configuration
OUTPUT_WIDTH=1280; OUTPUT_HEIGHT=720 # Output Resolution
# 60 FPS maybe?
# -vf "minterpolate=fps=60:mi_mode=mci:mc_mode=aobmc:me_mode=bidir:vsbmc=1"
# Set Bitrate
# -b:v 4500k
ffmpeg -hwaccel nvdec \
-i "$INPUT_FILENAME" \
-an \
-s ${OUTPUT_WIDTH}x${OUTPUT_HEIGHT} -sws_flags lanczos \
-c:v librav1e -qp 80 -speed 4 -tile-columns 2 -tile-rows 2 -threads $(nproc --all) \
-loop 0 -fps_mode cfr \
"$OUTPUT_FILENAME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment