#!/usr/bin/env bash
# Join video clips
video1="$1"
video2="$2"
name="${video%.*}"
ext="${video#*.}"
(( $# != 2)) && printf "%s\n" "Pass two videos to convert" && exit 1
read -p "Name of joined file? " jfile
ffmpeg -i "$1" -c copy -bsf:v h264_mp4toannexb -f mpegts int_1.ts
ffmpeg -i "$2" -c copy -bsf:v h264_mp4toannexb -f mpegts int_2.ts
ffmpeg -i "concat:int_1.ts|int_2.ts" -c copy -bsf:a aac_adtstoasc "$jfile"
(( $? == 0 )) && rm int_*
# vim:set ts=2 sts=2 sw=2 et: