How to merge two .MTS files in Linux

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have two video files from a Panasonic camera in .MTS format and I want to merge them into one file and burn that file onto a TV-playable DVD.



I tried importing them into kino and merging them, but the resulting file has somehow a very slow video playback and the audio is way out of sync.



I selected the MPEG tab with file format '8 - DVD' with no deinterlacing.



Can someone point me into the right direction for merging the two files correctly? Since exporting of the file takes around one hour, it's quite impractical to play around with different options :)










share|improve this question























  • Isn't kino for DV only? If ffmpeg can handle it, you could use ffmpeg -i 'concat:1.mts|2.mts' output.mpeg (plus whatever codec/quality options you desire).
    – frostschutz
    Sep 17 '13 at 16:55







  • 1




    Wouldn't this be a better match for SuperUser?
    – darnir
    Sep 17 '13 at 17:52














up vote
0
down vote

favorite












I have two video files from a Panasonic camera in .MTS format and I want to merge them into one file and burn that file onto a TV-playable DVD.



I tried importing them into kino and merging them, but the resulting file has somehow a very slow video playback and the audio is way out of sync.



I selected the MPEG tab with file format '8 - DVD' with no deinterlacing.



Can someone point me into the right direction for merging the two files correctly? Since exporting of the file takes around one hour, it's quite impractical to play around with different options :)










share|improve this question























  • Isn't kino for DV only? If ffmpeg can handle it, you could use ffmpeg -i 'concat:1.mts|2.mts' output.mpeg (plus whatever codec/quality options you desire).
    – frostschutz
    Sep 17 '13 at 16:55







  • 1




    Wouldn't this be a better match for SuperUser?
    – darnir
    Sep 17 '13 at 17:52












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have two video files from a Panasonic camera in .MTS format and I want to merge them into one file and burn that file onto a TV-playable DVD.



I tried importing them into kino and merging them, but the resulting file has somehow a very slow video playback and the audio is way out of sync.



I selected the MPEG tab with file format '8 - DVD' with no deinterlacing.



Can someone point me into the right direction for merging the two files correctly? Since exporting of the file takes around one hour, it's quite impractical to play around with different options :)










share|improve this question















I have two video files from a Panasonic camera in .MTS format and I want to merge them into one file and burn that file onto a TV-playable DVD.



I tried importing them into kino and merging them, but the resulting file has somehow a very slow video playback and the audio is way out of sync.



I selected the MPEG tab with file format '8 - DVD' with no deinterlacing.



Can someone point me into the right direction for merging the two files correctly? Since exporting of the file takes around one hour, it's quite impractical to play around with different options :)







video ffmpeg






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 1 min ago









jasonwryan

47.9k14131181




47.9k14131181










asked Sep 17 '13 at 16:49









Wojciech Morawiec

1013




1013











  • Isn't kino for DV only? If ffmpeg can handle it, you could use ffmpeg -i 'concat:1.mts|2.mts' output.mpeg (plus whatever codec/quality options you desire).
    – frostschutz
    Sep 17 '13 at 16:55







  • 1




    Wouldn't this be a better match for SuperUser?
    – darnir
    Sep 17 '13 at 17:52
















  • Isn't kino for DV only? If ffmpeg can handle it, you could use ffmpeg -i 'concat:1.mts|2.mts' output.mpeg (plus whatever codec/quality options you desire).
    – frostschutz
    Sep 17 '13 at 16:55







  • 1




    Wouldn't this be a better match for SuperUser?
    – darnir
    Sep 17 '13 at 17:52















Isn't kino for DV only? If ffmpeg can handle it, you could use ffmpeg -i 'concat:1.mts|2.mts' output.mpeg (plus whatever codec/quality options you desire).
– frostschutz
Sep 17 '13 at 16:55





Isn't kino for DV only? If ffmpeg can handle it, you could use ffmpeg -i 'concat:1.mts|2.mts' output.mpeg (plus whatever codec/quality options you desire).
– frostschutz
Sep 17 '13 at 16:55





1




1




Wouldn't this be a better match for SuperUser?
– darnir
Sep 17 '13 at 17:52




Wouldn't this be a better match for SuperUser?
– darnir
Sep 17 '13 at 17:52










2 Answers
2






active

oldest

votes

















up vote
0
down vote













 #!/usr/bin/env bash
# Join video clips

video1="$1"
video2="$2"

name="$video%.*"
ext="$video#*."

(( $# != 2)) && printf "%sn" "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:




share



























    up vote
    -3
    down vote













    Join many MTS clips into one MTS file and convert the joined MTS to MP4, WMV, MOV, AVI, FLV, MKV, ASF, etc.with Avdshare Video Converter.






    share|improve this answer








    New contributor




    Tonya Rabish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.

















    • Flagged as spam, cf. unix.stackexchange.com/a/419792 and 70 other posts on the Stack Exchange network (and counting).
      – Glorfindel
      5 mins ago










    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f91083%2fhow-to-merge-two-mts-files-in-linux%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













     #!/usr/bin/env bash
    # Join video clips

    video1="$1"
    video2="$2"

    name="$video%.*"
    ext="$video#*."

    (( $# != 2)) && printf "%sn" "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:




    share
























      up vote
      0
      down vote













       #!/usr/bin/env bash
      # Join video clips

      video1="$1"
      video2="$2"

      name="$video%.*"
      ext="$video#*."

      (( $# != 2)) && printf "%sn" "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:




      share






















        up vote
        0
        down vote










        up vote
        0
        down vote









         #!/usr/bin/env bash
        # Join video clips

        video1="$1"
        video2="$2"

        name="$video%.*"
        ext="$video#*."

        (( $# != 2)) && printf "%sn" "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:




        share












         #!/usr/bin/env bash
        # Join video clips

        video1="$1"
        video2="$2"

        name="$video%.*"
        ext="$video#*."

        (( $# != 2)) && printf "%sn" "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:





        share











        share


        share










        answered 3 mins ago









        jasonwryan

        47.9k14131181




        47.9k14131181






















            up vote
            -3
            down vote













            Join many MTS clips into one MTS file and convert the joined MTS to MP4, WMV, MOV, AVI, FLV, MKV, ASF, etc.with Avdshare Video Converter.






            share|improve this answer








            New contributor




            Tonya Rabish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.

















            • Flagged as spam, cf. unix.stackexchange.com/a/419792 and 70 other posts on the Stack Exchange network (and counting).
              – Glorfindel
              5 mins ago














            up vote
            -3
            down vote













            Join many MTS clips into one MTS file and convert the joined MTS to MP4, WMV, MOV, AVI, FLV, MKV, ASF, etc.with Avdshare Video Converter.






            share|improve this answer








            New contributor




            Tonya Rabish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.

















            • Flagged as spam, cf. unix.stackexchange.com/a/419792 and 70 other posts on the Stack Exchange network (and counting).
              – Glorfindel
              5 mins ago












            up vote
            -3
            down vote










            up vote
            -3
            down vote









            Join many MTS clips into one MTS file and convert the joined MTS to MP4, WMV, MOV, AVI, FLV, MKV, ASF, etc.with Avdshare Video Converter.






            share|improve this answer








            New contributor




            Tonya Rabish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            Join many MTS clips into one MTS file and convert the joined MTS to MP4, WMV, MOV, AVI, FLV, MKV, ASF, etc.with Avdshare Video Converter.







            share|improve this answer








            New contributor




            Tonya Rabish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            share|improve this answer



            share|improve this answer






            New contributor




            Tonya Rabish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            answered 14 mins ago









            Tonya Rabish

            1




            1




            New contributor




            Tonya Rabish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.





            New contributor





            Tonya Rabish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.






            Tonya Rabish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.











            • Flagged as spam, cf. unix.stackexchange.com/a/419792 and 70 other posts on the Stack Exchange network (and counting).
              – Glorfindel
              5 mins ago
















            • Flagged as spam, cf. unix.stackexchange.com/a/419792 and 70 other posts on the Stack Exchange network (and counting).
              – Glorfindel
              5 mins ago















            Flagged as spam, cf. unix.stackexchange.com/a/419792 and 70 other posts on the Stack Exchange network (and counting).
            – Glorfindel
            5 mins ago




            Flagged as spam, cf. unix.stackexchange.com/a/419792 and 70 other posts on the Stack Exchange network (and counting).
            – Glorfindel
            5 mins ago

















             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f91083%2fhow-to-merge-two-mts-files-in-linux%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay