Created
August 6, 2020 19:49
-
-
Save gargolito/d83456f251ede82b0189830086fbff45 to your computer and use it in GitHub Desktop.
convert input video to jpeg frames per second
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function vid2jpg () { | |
name="$(basename $@)" | |
name="${name/.*}" | |
tgtdir="${HOME}/pics/extracted/$name" | |
test -n "$@" && mkdir -p "$tgtdir" | |
if test -d "$tgtdir"; then | |
touch "$tgtdir/.nomedia" | |
ffmpeg -stats -loglevel panic -i "$@" -vsync -1 "$tgtdir/$name%04d.jpg" | |
else | |
echo "$@" is either empty or an invalid path | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment