Skip to content

Instantly share code, notes, and snippets.

@Shujito
Created March 4, 2020 19:47
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 Shujito/6e7e911ed21c100bcb37cc2e71846b14 to your computer and use it in GitHub Desktop.
Save Shujito/6e7e911ed21c100bcb37cc2e71846b14 to your computer and use it in GitHub Desktop.
convert videos to h264 baseline profile level 3.0
#/bin/sh
if ! [ "$1" ];
then
echo "where file"
exit
fi
filename="${1%.*}"
extension="${1##*.}"
for size in 360 480 640 720 1080; do
# echo $size
ffmpeg -y -i "$1" \
-acodec aac -ar 32k -aq 0 \
-vcodec libx264 \
-profile:v baseline \
-level 3.0 \
-r 30 -aspect 1:1 \
-vf "scale=-1:$size" \
-map_metadata -1 \
"$filename-$size.$extension"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment