-
-
Save masayukig/cd59f3b24a7aca4851f60a0c68c942af to your computer and use it in GitHub Desktop.
Concatenate MTS AVCHD files under Linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
## Usage: concat-mts-files.sh OUTFILE.m2ts 0000[0-2].MTS | |
if [ $# -le 1 ]; then | |
echo "Usage: concat-mts-files.sh OUTFILE.m2ts 0000[0-2].MTS" 1>&2 | |
exit 1 | |
fi | |
## 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