Skip to content

Instantly share code, notes, and snippets.

@zoharbabin
Forked from jbuchbinder/concat-mts-files.sh
Created May 7, 2017 05:03
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 zoharbabin/1eda672db7030b30b575b6526f1a1091 to your computer and use it in GitHub Desktop.
Save zoharbabin/1eda672db7030b30b575b6526f1a1091 to your computer and use it in GitHub Desktop.
Concatenate MTS AVCHD files under Linux
#!/bin/bash
## Solution from: http://stackoverflow.com/questions/26150533/join-avchd-mts-files-on-linux
## ffmpeg -i "concat:00000.MTS|00001.MTS|00002.MTS" -c copy output.m2ts
## File with .m2ts extension, etc
OUT="$1"; shift
## Format : "concat:00000.MTS|00001.MTS|00002.MTS"
IN="concat:$1"; shift
for I in "$*"; do
IN="${IN}|${I}"
done
ffmpeg -i "${IN}" -c copy "${OUT}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment