Adds scripts/shell/ffmpeg-extract-first-frame-from-video.sh script
This commit is contained in:
19
scripts/shell/ffmpeg-extract-first-frame-from-video.sh
Executable file
19
scripts/shell/ffmpeg-extract-first-frame-from-video.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
filename=$1
|
||||
|
||||
if [ -z "$filename" ]; then
|
||||
echo "You must provide a file for the script."
|
||||
echo "Example:"
|
||||
echo " `basename $0` foo.mp4"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$filename" ]; then
|
||||
echo "The file provided does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
friendly_filename=`sed -E 's/[^[:alnum:][:space:]]+/_/g' <<< "$filename"`
|
||||
|
||||
ffmpeg -i $filename -vframes 1 ${friendly_filename}-image.png
|
||||
Reference in New Issue
Block a user