Created
September 1, 2023 08:11
-
-
Save cubuspl42/7892d47b8153e9f40ab522ecce06fef8 to your computer and use it in GitHub Desktop.
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 | |
# Check if ffmpeg is installed | |
if ! command -v ffmpeg &> /dev/null | |
then | |
echo "ffmpeg could not be found. Please install it and try again." | |
exit 1 | |
fi | |
# Check if a file path was provided | |
if [ -z "$1" ] | |
then | |
echo "Please provide a file path." | |
exit 1 | |
fi | |
# Get the input file path and remove the extension to get the base name | |
input_file="$1" | |
base_name="${input_file%.*}" | |
# Run the ffmpeg command with the input file and output file | |
ffmpeg -i "$input_file" -q:v 0 -an "${base_name}.mp4" | |
echo "Conversion complete: ${base_name}.mp4" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment