VideoHelp Forum
+ Reply to Thread
Results 1 to 15 of 15
Thread
  1. **Sorry for the spellcheck in the title. Obviously should have been MTS, not it's**
    Hello, we have someone volunteering to film our soccer games. They bought a nice camera and the quality is excellent. They like to stop and start a lot though. The last game is made up of 42 MTS files. I need to merge them all into a single file. No transcoding or any editing needed. Every post I find on this topic refers to software that no longer exists or is 10 years old. Is there a relatively easy way to do this? Windows is the preferred platform. Thank you!
    Last edited by mkitchin; 25th Aug 2020 at 10:22. Reason: typo
    Quote Quote  
  2. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Videoredo. Payware. Works well (doesn't do titles).
    Quote Quote  
  3. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    Depending on what you want to with the file you can add and append each file into mkvmerge and output as mkv,it doesn't convert or alter the files and it's free.
    I think,therefore i am a hamster.
    Quote Quote  
  4. Try the followig commandline: ffmpeg.exe -i "concat:01.MTS|02.MTS|03.MTS|04.MTS" -c copy output.mkv
    (concat:01.MTS|02.MTS|03.MTS|04.MTS an so on with all 42 files).
    Quote Quote  
  5. Thank you all! Sorry for the spellcheck in the title. Obviously should have been MTS, not it's
    Quote Quote  
  6. Mkvmerge is a great tool, and I didn't think about that. I tried it, and it didn't work so well. It created a file that was the correct size (10 GB), but it definitely showed the wrong duration in windows. It shoul dhave been about 1.5 hours. It showed it at 7 + minutes, and it exactly matched the duration of the last file that was being merged. For the output file, windows media player had no sound, the screen went blank a few minutes in, and it showed the video being 7+ minutes long. VLC had sound, but had same other issues that I experienced in WMP. I tried ffmpeg, and it failed with "No wav codec tag found for codec pcm_bluray". Searching that pointed me to https://forum.doom9.org/showthread.php?t=174718 which possibly made it sound like I would have to re-encode. I definitely don't want to that. Various replies to this issue then pointed me to tsMuxer. It looks promising. The output file is the correct size at least. It shows no duration in Windows, and WMP and VLC both fail to play it. They give no error, just eventually go to a paused state instead of playing. The eventual destination for this is YouTube. I'm trying to upload the tsMuxer created file now, and hope that YouTube will have some magic that can handle it properly. I'm open to any other recommendations. Video editing/combining/muxing is clearly not my strong area.
    Last edited by mkitchin; 25th Aug 2020 at 11:48.
    Quote Quote  
  7. Well, that failed. It was only 1 minute and 11 seconds on YouTube. I will keep trying....
    Quote Quote  
  8. This looks promising:
    Code:
    ffmpeg.exe -i "concat:00047.MTS|00048.MTS|...|00088.MTS" -vcodec copy -acodec pcm_s24le output.mkv
    The output video looks good in VLC. I got some errors regarding corrupt packets, but things seem okay.

    Code:
    Z:\Shared\2020-8-23 NUSA 03 Navy>c:\ffmpeg\bin\ffmpeg.exe -i "concat:00047.MTS|00048.MTS|00049.MTS|00050.MTS|00051.MTS|00052.MTS|00053.MTS|00054.MTS|00055.MTS|00056.MTS|00057.MTS|00058.MTS|00059.MTS|00060.MTS|00061.MTS|00062.MTS|00063.MTS|00064.MTS|00065.MTS|00066.MTS|00067.MTS|00068.MTS|00069.MTS|00070.MTS|00071.MTS|00072.MTS|00073.MTS|00074.MTS|00075.MTS|00076.MTS|00077.MTS|00078.MTS|00079.MTS|00080.MTS|00081.MTS|00082.MTS|00083.MTS|00084.MTS|00085.MTS|00086.MTS|00087.MTS|00088.MTS" -vcodec copy -acodec pcm_s24le output.mkv
    ffmpeg version git-2020-08-24-3477feb Copyright (c) 2000-2020 the FFmpeg developers
      built with gcc 10.2.1 (GCC) 20200805
      configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --enable-librav1e --enable-libsvtav1 --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
      libavutil      56. 58.100 / 56. 58.100
      libavcodec     58.101.100 / 58.101.100
      libavformat    58. 51.100 / 58. 51.100
      libavdevice    58. 11.101 / 58. 11.101
      libavfilter     7. 87.100 /  7. 87.100
      libswscale      5.  8.100 /  5.  8.100
      libswresample   3.  8.100 /  3.  8.100
      libpostproc    55.  8.100 / 55.  8.100
    Input #0, mpegts, from 'concat:00047.MTS|00048.MTS|00049.MTS|00050.MTS|00051.MTS|00052.MTS|00053.MTS|00054.MTS|00055.MTS|00056.MTS|00057.MTS|00058.MTS|00059.MTS|00060.MTS|00061.MTS|00062.MTS|00063.MTS|00064.MTS|00065.MTS|00066.MTS|00067.MTS|00068.MTS|00069.MTS|00070.MTS|00071.MTS|00072.MTS|00073.MTS|00074.MTS|00075.MTS|00076.MTS|00077.MTS|00078.MTS|00079.MTS|00080.MTS|00081.MTS|00082.MTS|00083.MTS|00084.MTS|00085.MTS|00086.MTS|00087.MTS|00088.MTS':
      Duration: 00:07:17.94, start: 1.033367, bitrate: 196805 kb/s
      Program 1
        Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p(top first), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 59.94 tbr, 90k tbn, 59.94 tbc
        Stream #0:1[0x1100]: Audio: pcm_bluray (HDMV / 0x564D4448), 48000 Hz, stereo, s16, 1536 kb/s
        Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080
    Stream mapping:
      Stream #0:0 -> #0:0 (copy)
      Stream #0:1 -> #0:1 (pcm_bluray (native) -> pcm_s24le (native))
    Press [q] to stop, [?] for help
    Output #0, matroska, to 'output.mkv':
      Metadata:
        encoder         : Lavf58.51.100
        Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p(top first), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 29.97 fps, 59.94 tbr, 1k tbn, 90k tbc
        Stream #0:1: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s32, 2304 kb/s
        Metadata:
          encoder         : Lavc58.101.100 pcm_s24le
    [mpegts @ 000002c2b2d6d8c0] Packet corrupt (stream = 0, dts = 1123032).375.7kbits/s speed=31.5x
    [mpegts @ 000002c2b2d6d8c0] Packet corrupt (stream = 0, dts = 2339247).358.0kbits/s speed=31.6x
    [mpegts @ 000002c2b2d6d8c0] Packet corrupt (stream = 0, dts = 5852757).356.2kbits/s speed=32.3x
    [mpegts @ 000002c2b2d6d8c0] Packet corrupt (stream = 0, dts = 3059967).373.7kbits/s speed=32.9x
    [mpegts @ 000002c2b2d6d8c0] Packet corrupt (stream = 0, dts = 6933837).376.5kbits/s speed=33.1x
    [mpegts @ 000002c2b2d6d8c0] Packet corrupt (stream = 0, dts = 9546447).383.0kbits/s speed=32.3x
    [mpegts @ 000002c2b2d6d8c0] Packet corrupt (stream = 0, dts = 1348257).379.0kbits/s speed=32.1x
    [mpegts @ 000002c2b2d6d8c0] Packet corrupt (stream = 0, dts = 6258162).388.3kbits/s speed=31.7x
    [mpegts @ 000002c2b2d6d8c0] Packet corrupt (stream = 0, dts = 33465342).384.6kbits/s speed=30.1x
    frame=214860 fps=1641 q=-1.0 Lsize=10238365kB time=00:59:44.68 bitrate=23397.5kbits/s speed=27.4x
    video:9223312kB audio:1008191kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.067065%
    Last edited by mkitchin; 25th Aug 2020 at 15:08.
    Quote Quote  
  9. Maybe generating new time codes with ffmpeg will help:

    Code:
    ffmpeg -fflags +genpts -f concat -i list.txt -c copy -fflags +genpts output.mts
    The list file should be a text file with the names of all the individual files, like:

    Code:
    file 'file001.mts'
    file 'file002.mts'
    file 'file003.mts'
    ...
    file 'file042.mts'
    That will copy the contents (no reencoding) to the output file.

    Oops, I just saw the post before this one. It looks like the simple concat is working for you.
    Quote Quote  
  10. Thanks! I will try that. The file that was created in my last try looked great in VLC, but is shortened to 1:11 in YouTube, again. Maybe this will help.
    Quote Quote  
  11. Code:
    ffmpeg.exe -fflags +genpts -f concat -i list.txt -c copy -fflags +genpts output.mts
    produced a full length file with no sound. I tried the change below, but same result.
    Code:
    ffmpeg -fflags +genpts -f concat -i list.txt -vcodec copy -acodec pcm_s24le -fflags +genpts output.mts
    Changing the output to MKV produced a file with audio that looks correct in VLC. Trying again, to upload the 10 GB file to YouTube. Glad I'm at work with no data cap....

    Update: YouTube is taking a lot longer to process, so I am hopeful. Others were done in a few minutes. This one has been going for over 30 minutes.

    Update:
    Code:
    ffmpeg -fflags +genpts -f concat -i list.txt -vcodec copy -acodec pcm_s24le -fflags +genpts output.mkv
    looks like it is probably going to work. Duration is correct in YouTube. Only SD is ready right now, and it looks awful, but I'm hoping the HD Quality will be relatively good. Thank you for all the help!!
    Last edited by mkitchin; 25th Aug 2020 at 15:06.
    Quote Quote  
  12. I don't understand why my original command gave a file without audio. Does MediaInfo show an audio track?

    I'm no sure if "-fflags +gentpts" is necessary both before and after opening the input file. I used both, just in case. You might play around with that using a few files rather than all 42.
    Quote Quote  
  13. I'm not sure. It seems when I output it as an MTS, there is no audio. I am an absolute novice at this. For now, I'm just going to go with what works. If you are interested in troubleshooting further for knowledge on your end, I'm happy to assist.
    Last edited by mkitchin; 25th Aug 2020 at 16:39.
    Quote Quote  
  14. I verified my original command worked properly with some MTS files (AVC+AC3) I dug up here. Can you post a MediaInfo report (text mode) for one of your source videos?

    Code:
    General
    ID                                       : 0 (0x0)
    Complete name                            : E:\VCR\Misc\00009.MTS
    Format                                   : BDAV
    Format/Info                              : Blu-ray Video
    File size                                : 30.0 MiB
    Duration                                 : 36 s 720 ms
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 6 851 kb/s
    Maximum Overall bit rate                 : 18.0 Mb/s
    Recorded date                            : 2007-08-08 15:57:05-05:00
    Writing application                      : Canon
    
    Video
    ID                                       : 4113 (0x1011)
    Menu ID                                  : 1 (0x1)
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4
    Format settings                          : CABAC / 2 Ref Frames
    Format settings, CABAC                   : Yes
    Format settings, Reference frames        : 2 frames
    Format settings, GOP                     : M=3, N=15
    Codec ID                                 : 27
    Duration                                 : 36 s 470 ms
    Bit rate mode                            : Variable
    Bit rate                                 : 6 315 kb/s
    Maximum bit rate                         : 16.0 Mb/s
    Width                                    : 1 440 pixels
    Height                                   : 1 080 pixels
    Display aspect ratio                     : 16:9
    Frame rate                               : 29.970 (30000/1001) FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Interlaced
    Scan type, store method                  : Separated fields
    Scan order                               : Top Field First
    Bits/(Pixel*Frame)                       : 0.135
    Stream size                              : 27.5 MiB (92%)
    
    Audio
    ID                                       : 4352 (0x1100)
    Menu ID                                  : 1 (0x1)
    Format                                   : AC-3
    Format/Info                              : Audio Coding 3
    Commercial name                          : Dolby Digital
    Codec ID                                 : 129
    Duration                                 : 36 s 544 ms
    Bit rate mode                            : Constant
    Bit rate                                 : 256 kb/s
    Channel(s)                               : 2 channels
    Channel layout                           : L R
    Sampling rate                            : 48.0 kHz
    Frame rate                               : 31.250 FPS (1536 SPF)
    Bit depth                                : 16 bits
    Compression mode                         : Lossy
    Delay relative to video                  : -67 ms
    Stream size                              : 1.12 MiB (4%)
    Service kind                             : Complete Main
    Quote Quote  
  15. Sure. See below.
    Code:
    General
    ID                                       : 0 (0x0)
    Complete name                            : Z:\Shared\2020-8-23 NUSA 03 Navy\00047.MTS
    Format                                   : BDAV
    Format/Info                              : Blu-ray Video
    File size                                : 515 MiB
    Duration                                 : 2 min 59 s
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 24.0 Mb/s
    Maximum Overall bit rate                 : 24.0 Mb/s
    Recorded date                            : 2020-08-23 13:29:58-05:00
    Writing application                      : Sony HXR-NX30U
    
    Video
    ID                                       : 4113 (0x1011)
    Menu ID                                  : 1 (0x1)
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4
    Format settings                          : CABAC / 2 Ref Frames
    Format settings, CABAC                   : Yes
    Format settings, Reference frames        : 2 frames
    Format settings, GOP                     : M=2, N=15
    Codec ID                                 : 27
    Duration                                 : 2 min 59 s
    Bit rate mode                            : Variable
    Bit rate                                 : 21.5 Mb/s
    Maximum bit rate                         : 22.0 Mb/s
    Width                                    : 1 920 pixels
    Height                                   : 1 080 pixels
    Display aspect ratio                     : 16:9
    Frame rate                               : 29.970 (30000/1001) FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Interlaced
    Scan type, store method                  : Separated fields
    Scan order                               : Top Field First
    Bits/(Pixel*Frame)                       : 0.347
    Stream size                              : 461 MiB (90%)
    IrisFNumber                              : 4.000000
    
    Audio
    ID                                       : 4352 (0x1100)
    Menu ID                                  : 1 (0x1)
    Format                                   : PCM
    Format settings                          : Big / Signed
    Muxing mode                              : Blu-ray
    Codec ID                                 : 128
    Duration                                 : 2 min 59 s
    Bit rate mode                            : Constant
    Bit rate                                 : 1 536 kb/s
    Channel(s)                               : 2 channels
    Channel layout                           : L R
    Sampling rate                            : 48.0 kHz
    Bit depth                                : 16 bits
    Delay relative to video                  : -67 ms
    Stream size                              : 32.9 MiB (6%)
    
    Text
    ID                                       : 4608 (0x1200)
    Menu ID                                  : 1 (0x1)
    Format                                   : PGS
    Codec ID                                 : 144
    Duration                                 : 2 min 59 s
    Delay relative to video                  : -67 ms
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!