Skip to content

Instantly share code, notes, and snippets.

@stvoidit
stvoidit / ffmpeg_thumbnails.sh
Created June 1, 2024 07:14
important! I am using my ffmpeg compilation from master, so this should work for ffmpeg versions => 6. The current fastest way to create a screencast for videos of any length. A 2.5-hour video in 1080p quality is processed in about 18 seconds. Please note, I use -hwaccel auto which speeds up decoding.
#!/bin/bash
if [ -z "$1" ]; then
echo "usage: ffmpeg_thumbnails.sh PATH_TO_VIDEOFILE"
exit
fi
MOVIE=$1
MOVIE_NAME=$(basename "$MOVIE")
OUT_FILENAME="${MOVIE_NAME%.*}_preview.jpeg"
OUT_DIR=$(pwd)
@stvoidit
stvoidit / imv-folder
Created July 8, 2024 22:38
imv-folder with sorting by mtime
#!/bin/bash
image="$1"
declare -a ARGS order
readarray -t order < <(find "$(dirname "$image")"/* -maxdepth 2 -printf "%T+\t%p\n" | sort -r | sed 's/^.*\t//')
for a in "${order[@]}"; do
if [ -f "$a" ]; then
# echo $a
ARGS+=("$a")
fi
done