Last active
November 14, 2024 18:59
-
-
Save darko-mesaros/e993ac82999077f962c772025aaa1b60 to your computer and use it in GitHub Desktop.
Use FFMpeg to convert your screen recordings to 24fps
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 | |
set -e | |
if ! command -v ffmpeg 2>&1 >/dev/null | |
then | |
echo "ffmpeg could not be found. Please install it before using this script" | |
echo "Mac users: brew install ffmpeg" | |
echo "Windows users: choco install ffmpeg" | |
echo "Linux: You already know" | |
exit 1 | |
fi | |
# Check if the parameters are passed | |
if [ "$#" -ne 2 ]; then | |
echo "Usage: $0 input_file output_file" | |
exit 1 | |
fi | |
# Check if input file exist | |
if [ ! -f "$1" ]; then | |
echo "Error: Input file '$1' does not exist" | |
exit 1 | |
fi | |
INPUT="$1" | |
OUTPUT="$2" | |
ffmpeg -i "$INPUT" -vf "fps=24" -c:v libx264 -preset veryslow -crf 17 -c:a copy -pix_fmt yuv420p -movflags +faststart "$OUTPUT" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment