Last active
September 21, 2020 23:21
-
-
Save nothub/c8dd5d0a3af559ed4131abd9d2b67da7 to your computer and use it in GitHub Desktop.
ffmpeg
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 | |
EXAMPLE_USAGE="$(basename $0) video.mp4 audio.mp3 merged.mp4" | |
if [ -z "$1" ]; then | |
echo "please specify input video file" | |
echo "$EXAMPLE_USAGE" | |
exit 1 | |
fi | |
if [ -z "$2" ]; then | |
echo "please specify input audio file" | |
echo "$EXAMPLE_USAGE" | |
exit 1 | |
fi | |
if [ -z "$3" ]; then | |
echo "please specify output file" | |
echo "$EXAMPLE_USAGE" | |
exit 1 | |
fi | |
ffmpeg -i "$1" -i "$2" -map 0:v -map 1:a -c:v copy -shortest "$3" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment