Unix for Artists: Fun with FFMPEG is a workshop hosted by the Echo Park Film Center.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
unix4artists/ffmpeg/audio/audiovideo.sh

28 lines
603 B

#!/bin/bash -e
#####################################################
#
# This script will combine the audio from one file and the
# video from another file.
#
# Usage: bash ffmpeg/audio/audiovideo.sh <input audio> <input video> <output video>
#
#####################################################
AUDIO="${1}"
VIDEO="${2}"
OUTPUT="${3}"
# Check if output file extension is .mkv
if [[ "${OUTPUT}" != *".mkv" ]]; then
echo "Please use an .mkv extension on your output file argument"
exit 1
fi
ffmpeg -i "${VIDEO}" \
-i "${AUDIO}" \
-c copy \
-map 0:v:0 \
-map 1:a:0 \
-shortest \
"${OUTPUT}"