Skip to content

Instantly share code, notes, and snippets.

@jbuchbinder
Created February 8, 2016 14:19
Show Gist options
  • Select an option

  • Save jbuchbinder/d44f0210ddf66b36ba91 to your computer and use it in GitHub Desktop.

Select an option

Save jbuchbinder/d44f0210ddf66b36ba91 to your computer and use it in GitHub Desktop.

Revisions

  1. jbuchbinder created this gist Feb 8, 2016.
    15 changes: 15 additions & 0 deletions concat-mts-files.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #!/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}"