Skip to content

Instantly share code, notes, and snippets.

@leonidlezner
Created February 16, 2020 16:22
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 leonidlezner/5d6dbc4f34fc6b0a491d9f219a674ba0 to your computer and use it in GitHub Desktop.
Save leonidlezner/5d6dbc4f34fc6b0a491d9f219a674ba0 to your computer and use it in GitHub Desktop.
#!/bin/bash
basename=$1
cover=$2
if [ -z $basename ]; then
echo "Input file not set!"
exit 1
fi
if [ -z $cover ]; then
echo "Cover file not set!"
exit 1
fi
filename_without_ext=`echo "${basename}"|sed "s/\(.*\)\.\(.*\)/\1/"`
output_name="${filename_without_ext}.mp4"
ffmpeg -loop 1 -r 1 -i "$cover" -i "$basename" -c:a copy -vcodec h264 -shortest "$output_name"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment