Skip to content

Instantly share code, notes, and snippets.

@mebaysan
Last active June 6, 2023 06:07
Show Gist options
  • Save mebaysan/b58df7a0c495577902742e29dec9f80f to your computer and use it in GitHub Desktop.
Save mebaysan/b58df7a0c495577902742e29dec9f80f to your computer and use it in GitHub Desktop.
Ubuntu Screen Recorder WEBM to MP4
#! /bin/bash
# sudo apt-get install ffmpeg
# if ffmpeg is not installed, install it
if ! [ -x "$(command -v ffmpeg)" ]; then
sudo apt-get install ffmpeg
fi
# if no arguments are given, print usage
if [ $# -eq 0 ]; then
echo "Usage: convert <input> <output>"
exit 1
fi
INPUT_FILE="$(pwd)/$1"
OUTPUT_FILE="$(pwd)/$2"
ffmpeg -i $INPUT_FILE -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" $OUTPUT_FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment