Skip to content

Instantly share code, notes, and snippets.

@vincent-zurczak
Created March 16, 2015 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vincent-zurczak/7647e60f63dd134d2172 to your computer and use it in GitHub Desktop.
Save vincent-zurczak/7647e60f63dd134d2172 to your computer and use it in GitHub Desktop.
Create video snapshots with VLC in batch mode
#!/bin/bash
ROOT=/data/test
for f in $ROOT/my_dir/*.mkv
do
# Display progress information
echo "Processing $f..."
date
# Remove the file extension (here, .mkv)
DIR="$(basename -s .mkv $f)"
# Create the target directory
echo "Creating $DIR..."
mkdir -p ./previews/$DIR
# Create the previews
# (cvlc is the command-line interface of VLC)
cvlc $f --video-filter=scene --vout=dummy --scene-ratio=10 --scene-prefix=$DIR --scene-path=$ROOT/previews/$DIR/ vlc://quit
# Line break for readability
echo ""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment