Skip to content

Instantly share code, notes, and snippets.

@janbaer
Created December 31, 2021 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janbaer/a768d9c21c2f716fc34d0936d2cb3705 to your computer and use it in GitHub Desktop.
Save janbaer/a768d9c21c2f716fc34d0936d2cb3705 to your computer and use it in GitHub Desktop.
for f in $(ls *.mp4); do
ffmpeg -i $f -c copy -bsf:v h264_mp4toannexb -f mpegts $f.ts
done
CONCAT=$(echo $(ls *.ts) | sed -e "s/ /|/g")
ffmpeg -i "concat:$CONCAT" -c copy -bsf:a aac_adtstoasc output.mp4
rm *.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment