Skip to content
Permalink
master
Go to file
 
 
Cannot retrieve contributors at this time
executable file 27 lines (20 sloc) 630 Bytes
#!/usr/bin/env bash
# ffsbs: Place two videos side-by-side.
set -eo pipefail
function help {
echo "Usage: ffsbs <left> <right> <output>"
exit
}
function installed {
cmd=$(command -v "${1}")
[[ -n "${cmd}" ]] && [[ -f "${cmd}" ]]
return ${?}
}
[[ $# -eq 3 && -f $1 && -f $2 && ! -f $3 ]] || help
installed ffmpeg || { >&2 echo "Missing ffmpeg."; exit 1; }
# https://unix.stackexchange.com/a/233833
# you can change/remove the audio mapping if desired
ffmpeg -i "${1}" -i "${2}" -filter_complex \
"[0:v] pad=iw*2:ih[int];
[int][1:v]overlay=W/2:0[vid]" \
-map "[vid]" -map 1:a -c:a copy "${3}"
You can’t perform that action at this time.