VideoHelp Forum
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. Member
    Join Date
    Jul 2003
    Location
    United States
    Search Comp PM
    I want to rewrap my camera-generated MTS files in MP4 containers, without reencoding (so there is no quality loss) because MP4s can contain metadata (easily edited in Windows & most media players, tag-editors, etc.) and MP4s seem to have more universal support on all types of devices. I've generated about 300 MTS files over the years, mingled-in with my photos in various subfolders of "My Pictures" on my Windows 10 PC. I would love to be able to rewrap in a batch mode with an easy GUI interface, simply dragging files onto a window, or pointing the tool to folders containing MTS files.

    1) Any reason why I shouldn't rewrap from MTS to MP4?

    2) I used AviDemux v2.7 to rewrap a few MTS files to MP4s with Audio & Video set to "Copy". The conversion is VERY fast so I'm pretty confident that it's not reencoding. However, the MP4 file size is always about 6% smaller than its MTS file, so I'm worried about quality-loss. Is that size-difference due to packet-header differences or something? It's not reencoding is it?

    3) Unfortunately, AviDemux v2.7 does not have a GUI batch mode. I'd like to avoid spending hours trying to figure out how to run scripts. And even then it doesn't seem that I could simply point a script at the "My Pictures" folder and have it do all subfolders that might contain MTS files. Right? Is there a free tool that can do batch rewrap through a GUI? (BTW, I have AviSynth+, AvsPmod, & AviSynth Batch Scripter installed, if that helps.)

    Thanks in advance for any help. I Googled around quite a bit but couldn't find answers.
    Quote Quote  
  2. Transport streams have lots of redundant information so you can pick up the stream anywhere during a transmission. So a 6 percent reduction in file size when remuxing to a more efficient container like mp4 is normal.

    It's not difficult to make a batch file that works recursively. You just have to use the /R switch with the FOR command:

    Code:
    for /R %%F in ("*.mts") do (
    ffmpeg -i "%%~dpnxF" -c copy "%%~dpnF.mp4"
    )
    Quote Quote  
  3. Member
    Join Date
    Jul 2003
    Location
    United States
    Search Comp PM
    Thanks jagabo!

    That makes sense about the TS streams needing redundant info throughout.

    Thanks for the recursive command. I'd love find a GUI, but if not, that gets me started. In order to use that command, I'd have to put all of the MTS files in the same directory, not scattered throughout various subdirectories, right?
    Quote Quote  
  4. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    A suitable multithreaded converter may be TEncoder.
    Quote Quote  
  5. Originally Posted by Razz View Post
    Thanks for the recursive command. I'd love find a GUI, but if not, that gets me started. In order to use that command, I'd have to put all of the MTS files in the same directory, not scattered throughout various subdirectories, right?
    No. That batch will process all MTS files in the directory that contains the BAT file, and all sub-directories therein. If you ran in in the root directory all MTS files on the disk would be processed.

    Note that the simple ffmpeg command line will only remux a single video and a single audio stream. You may need a more complex command line if you need multiple audio/video streams, chapter markers, metadata, etc.
    Last edited by jagabo; 11th Mar 2021 at 08:44.
    Quote Quote  
  6. Member
    Join Date
    Jul 2003
    Location
    United States
    Search Comp PM
    Thanks again jagabo. Although I'll use TEncoder, you alerted me to the important (to me) issue that I need to take care to retain metadata in the remux. I really only cared about the "date-recorded" metadata, but I would have lost that important data if not for your reply.
    Quote Quote  
  7. Member
    Join Date
    Jul 2003
    Location
    United States
    Search Comp PM
    Thanks LigH.de! TEncoder does exactly what I wanted!

    Just in case it helps anyone else who has the same question and finds this thread, following is some information about using TEncoder to rewrap/convert containers without reencoding/re-encoding (though you can reencode if you like).

    TEncoder works on Windows 10 and can run multithreaded so it's very fast on multi-core PCs. It can rewrap (with or without transcoding) TS, MTS, M2TS & other file types to MP4, AVI, MPEG, MOV, MKV, FLV, WMV, WEBM, & 3GP containers. Note however that not all audio and video formats can be used inside of all container-types so, you can't necessarily rewrap every file-type or container-type to any other container type without reencoding. (It can rewrap TS, MTS, & M2TS to MP4 without reencoding.)

    TEncoder can rewrap a single file ("Add File"), or a folder ("Add Folder"), or a hierarchical directory ("Add Folder Tree"). Note however that when TEncoder scans a directory or tree, it finds most audio & video file types (like TS, MTS, M2TS, MPG, WMV, FLV, AVI, MKV, 3GP, M4A, MP3, FLAC, WAV, & AC3, but not WMA) and lists those files for your review before encoding. Unfortunately, TEncoder can't be forced to search only for specified file types (like .MTS only). But you can remove any of the listed files that you don't want to convert. (Not a problem for my needs.)

    TEncoder leaves the original MTS files in place, unchanged. You can output the files to the source directory or to a different directory.

    If you want to retain the original recording/creation date, then go to Settings/Encoding and checkmark "Copy date info from source", otherwise it will get changed to the conversion date.

    If you don't want to reencode, then on the main page choose:
    Video Codec: Direct Copy
    Audio Codec: Direct Copy
    Encoder: FFMpeg
    Container: MP4 (Or whatever container type you want).

    Since my personal camera/camcorder videos don't have subtitles, I had to uncheck "Enable Subtitles", otherwise it failed.

    Great tool. Development stopped in 2015, but the developer should at least fix the "Donate" button because I would have donated.
    Quote Quote  
  8. If you want to spend around fifteen euros buy XviD4PSP instead
    it will easily do what you need and much more and....updated
    Quote Quote  



Similar Threads

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