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/stillaudio.sh

35 lines
796 B

#!/bin/bash -e
#####################################################
#
# This script will take an audio file and an image and
# combine them to create a video.
#
# Usage: bash ffmpeg/audio/stillaudio.sh <input audio> <input image> <output video>
#
#####################################################
AUDIO="${1}"
IMAGE="${2}"
OUTPUT="${3}"
# Check if file extension is .mkv or .MKV
if [[ "${OUTPUT}" != *".mkv" ]]; then
echo "Please use an .mkv extension on your output file argument"
exit 1
fi
ffmpeg -loop 1 \
-framerate 2 \
-i "${IMAGE}" \
-i "${AUDIO}" \
-c:v libx264 \
-preset slow \
-tune stillimage \
-pix_fmt yuv420p \
-crf 12 \
-vf "scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:-1:-1:color=black" \
-c:a aac \
-b:a 192k \
-shortest \
"${OUTPUT}"