Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Convert m2ts to mkv but preserve quality

markmcrobiemarkmcrobie Posts: 476Members, Plex Pass Plex Pass
Most 1080p movies I get are compressed using x264 in an mkv container.

I have some m2ts files I'd like to compress myself into mkv, but I want to maintain a decent quality. What settings in Handbrake should I use? Or should I be using a different software tool?

Comments

  • sleakesleake Posts: 201Members, Plex Pass Plex Pass
    edited May 2009
    Mark McRobie wrote on May 9 2009, 06:10 PM:
    Most 1080p movies I get are compressed using x264 in an mkv container.

    I have some m2ts files I'd like to compress myself into mkv, but I want to maintain a decent quality. What settings in Handbrake should I use? Or should I be using a different software tool?

    M2TS and MKV are just the container. Both can contain x264 compression internally. For the M2TS files, are they compressed with something else and you want to change it, is that what you are asking? I don't think the container is the question/issue, but someone else could correct me on this.

    poofyhairguy has made it clear he doesn't like MPEG2 stuff, so he uses Handbrake to reencode a movie to x264 and he has posted his settings (and many others have commented) in this thread:

    http://forums.plexapp.com/index.php?showtopic=5176

    That might give you more info about how to do what you are asking.
  • poofyhairguypoofyhairguy Posts: 912Members
    Mark McRobie wrote on May 9 2009, 10:10 PM:
    Most 1080p movies I get are compressed using x264 in an mkv container.

    I have some m2ts files I'd like to compress myself into mkv, but I want to maintain a decent quality. What settings in Handbrake should I use? Or should I be using a different software tool?



    You need the newer than release handbrake- SVN- for x264 to x264 conversion. Use the constant quality over 50% and you will be fine.
  • windbellwindbell Posts: 3Members
    Mark McRobie wrote on May 9 2009, 11:10 PM:
    Most 1080p movies I get are compressed using x264 in an mkv container.

    I have some m2ts files I'd like to compress myself into mkv, but I want to maintain a decent quality. What settings in Handbrake should I use? Or should I be using a different software tool?


    I only use iSkysoft Video Converter, it can easily convert M2TS to MKV and have had no issues
  • sleakesleake Posts: 201Members, Plex Pass Plex Pass
    edited October 2010
    maccolar wrote on May 14 2009, 12:03 PM:
    I'd like to recommend this video converter to you, I always use it to convert m2ts video to mkv video, it works pretty well for me, and the conversion quality is good.

    So what is the difference in the two containers? Obviously I was wrong in my statement above (par for the course for me!!). Help me understand please.
  • BlackstarBlackstar Posts: 275Members, Plex Pass Plex Pass
    sleake wrote on May 14 2009, 07:12 PM:
    So what is the difference in the two containers? Obviously I was wrong in my statement above (par for the course for me!!). Help me understand please.



    MKV - The Matroska Multimedia Container is an open standard free container format, a file format that can hold an unlimited number of video, audio, picture or subtitle tracks inside a single file.[1] It is intended to serve as a universal format for storing common multimedia content, like movies or TV shows. Matroska is similar in conception to other containers like AVI, MP4 or ASF, but is entirely open in specification, with implementations consisting mostly of open source software. Matroska file types are .MKV for video (with subtitles and audio), .MKA for audio-only files and .MKS for subtitles only. The most common use of .MKV files is to store HD video files.
    Matroska is an English word derived from the Russian word matryoshka (Russian: матрёшка, IPA: [mɐˈtrʲoʂkə]), which means nesting doll (the common Russian egg-shaped doll within a doll). This is a play on the container (media within a form of media/doll within a doll) aspect of the matryoshka as it is a container for visual and audio data. The transliteration may be confusing for Russian speakers, as the Russian word matroska (матроска) actually refers to a sailor suit.


    m2ts - The .m2ts file format is given to video/audio files created by certain Sony Camcorder models. The .M2TS files contain a BDAV MPEG-2 transport stream. Each stream has its own file and their names are of the form #####.M2TS (a five-digit number followed by .M2TS).

    Video Compression MPEG-4 AVC/H.264 (Main Profile Level-4.0 or High Profile Level-4.1, depending on vendor)
    Audio Compression Dolby Digital (AC-3) Linear PCM
    File extension (generally) mts (on camcorder), m2ts (after import to computer)

    Video signal
    1080/60i
    1080/50i
    1080/24p
    720/60p
    720/50p
    720/24p
    480/60i
    576/50i


    Frame size in pixels
    1920×1080
    1440×1080
    1280 x 720
    720×480
    720×576

    - http://en.wikipedia.org/wiki/.m2ts#Video_formats


    The quality depends on the video codec and if you reconvert and not the video container. You can keep same video quality in mkv as in the original m2ts. He would just have to demux the files into the xh264 video and the audio streams, then re-mux them into an mkv container. It's much faster than re-rendering.
  • sleakesleake Posts: 201Members, Plex Pass Plex Pass
    edited May 2009
    Blackstar BSP wrote on May 14 2009, 10:38 PM:
    m2ts - The .m2ts file format is given to video/audio files created by certain Sony Camcorder models. The .M2TS files contain a BDAV MPEG-2 transport stream. Each stream has its own file and their names are of the form #####.M2TS (a five-digit number followed by .M2TS).

    Not sure this is true. I have M2TS files/containers with x264 in them, and they were that way straight from the BR rip, no encoding/changing done. But I have seen MPEG-2 in them as well (boo, hiss).

    So if you had a movie that was in x264 and was stored in MKV and the same in M2TS, is there any difference in the playing, or is it more about compatibility and what you can do to extend things (MKV would allow you to do more than M2TS based on what you wrote above). All of that said, if you have an M2TS with MPEG-2 in it, would make sense to reencode to x264 and at that point put it in an MKV container. But couldn't you just as easily put it right back in an M2TS container?

    I have movies in both formats and can't tell a difference when they play, but I haven't really sat down to A-B test to see.

    Sorry, not trying to sidetrack this thread, just trying to better understand the nuts and bolts here.
  • BlackstarBlackstar Posts: 275Members, Plex Pass Plex Pass
    edited May 2009
    sleake wrote on May 14 2009, 11:42 PM:
    Not sure this is true. I have M2TS files/containers with x264 in them, and they were that way straight from the BR rip, no encoding/changing done. But I have seen MPEG-2 in them as well (boo, hiss).

    So if you had a movie that was in x264 and was stored in MKV and the same in M2TS, is there any difference in the playing, or is it more about compatibility and what you can do to extend things (MKV would allow you to do more than M2TS based on what you wrote above). All of that said, if you have an M2TS with MPEG-2 in it, would make sense to reencode to x264 and at that point put it in an MKV container. But couldn't you just as easily put it right back in an M2TS container?

    I have movies in both formats and can't tell a difference when they play, but I haven't really sat down to A-B test to see.

    Sorry, not trying to sidetrack this thread, just trying to better understand the nuts and bolts here.



    Oh it's true. See, the thing is as an example, you can have an MPEG-2 file that has been compressed with an h264 codec. A perfect example is what Sony camcorders use, AVCHD.


    http://en.wikipedia.org/wiki/AVCHD -

    "AVCHD (AVC-HD, AVC HD) video is recorded using the MPEG-4 AVC/H.264 video compression codec. Audio is stored in compressed form (Dolby AC-3). Uncompressed linear PCM audio is not supported in any consumer devices. Aside from recorded audio and video, AVCHD includes features to improve media presentation: menu navigation, slide shows and subtitles. The menu navigation system is similar to DVD-video, allowing access to individual videos from a common intro screen. Slide shows are prepared from a sequence of AVC still frames, and can be accompanied by a background audio track. Subtitles are used in some camcorders to timestamp the recordings.
    Audio, video, subtitle, and ancillary streams are multiplexed into an MPEG-2 Transport stream. The MPEG-2 transport stream is stored on random-access media as binary files. (In general, the FAT32 filesystem is used for memory cards and HDDs, ISO9660 is used on optical-disc.)"

    "At the file system level, the structure of AVCHD is derived from the Blu-ray Disc specification, but is not identical to it. In particular, known Canon and Panasonic implementations use legacy "8.3" file naming convention, while Blu-ray discs utilize long filenames. Another difference is location of the BDMV folder, which contains media files. On a DVD-based camcorder the BDMV folder is placed at the root level, just like on a Blu-ray disc."

    "Just as HDV-editing once demanded an expensive high-end PC, the system requirements for AVCHD editing software currently limits it to powerful machines. Compared to HDV, AVCHD video compression requires 2-4x the processing power, placing a greater burden on the computer memory and CPU. Older computers, even those that are capable of handling HDV, are often unacceptably slow for editing AVCHD, and can even struggle with smooth playback of AVCHD recordings. Improvements in multi-core computing and graphics processor acceleration is bringing AVCHD playback to mainstream desktops and laptops."



    So you see, you're still dealing with MPEG-2's in one form or another, no matter what. ;) So the codec compressing the video information is done via an H264 process, but it is being muxed (assembled into a container file) into an m2ts (mpeg-2 transport stream).

    Thing is, some Blu-Ray's and HD-DVD's were encoded with MPEG-2 and muxed into an mpeg transport stream because at certain bit-rates MPEG-2 looks better than H264. ;) H264 also needs a lot of horsepower to run and many HD disk makers/editor chose to use their existing equipment to make them.

    Since the making of optimized and specialized H246 chips to take the work of encoding and decoding off computer CPU's, this is slowly becoming less of an issue for professional markets.
  • poofyhairguypoofyhairguy Posts: 912Members
    sleake wrote on May 15 2009, 03:42 AM:
    Not sure this is true. I have M2TS files/containers with x264 in them, and they were that way straight from the BR rip, no encoding/changing done. But I have seen MPEG-2 in them as well (boo, hiss).

    So if you had a movie that was in x264 and was stored in MKV and the same in M2TS, is there any difference in the playing, or is it more about compatibility and what you can do to extend things (MKV would allow you to do more than M2TS based on what you wrote above).


    Shouldn't play any better. Might take up less space for same quality though, and you can add subtitles and chapters to a mkv file. Also I a mkv file can have more different types of video (beyond the VC1, MPEG2, and x264 trifecta of m2ts). I have seen mkvs with divx and real media inside.

    All of that said, if you have an M2TS with MPEG-2 in it, would make sense to reencode to x264 and at that point put it in an MKV container. But couldn't you just as easily put it right back in an M2TS container?


    Yeah, but its better to go mkv when you do that if nothing else for compatibility with other stuff. Only thing that really plays m2ts files outside of Plax (and VLC poorly) is a PS3, but its picky about them. Mkvs play on many thing like popcorn hours. And with the Divx company picking up mkv officially, it like three year many cheap Blu Ray players should take moderate mkv files just like cheap dvd players play avis now.

    M2ts is like the commercial container- like VOB for DVDs. Mkv honestly came about for pirate media mostly.

    But again, no quality difference or playback difference between the two.
  • sleakesleake Posts: 201Members, Plex Pass Plex Pass
    poofyhairguy wrote on May 15 2009, 05:10 AM:
    Shouldn't play any better. Might take up less space for same quality though, and you can add subtitles and chapters to a mkv file. Also I a mkv file can have more different types of video (beyond the VC1, MPEG2, and x264 trifecta of m2ts). I have seen mkvs with divx and real media inside.



    Yeah, but its better to go mkv when you do that if nothing else for compatibility with other stuff. Only thing that really plays m2ts files outside of Plax (and VLC poorly) is a PS3, but its picky about them. Mkvs play on many thing like popcorn hours. And with the Divx company picking up mkv officially, it like three year many cheap Blu Ray players should take moderate mkv files just like cheap dvd players play avis now.

    M2ts is like the commercial container- like VOB for DVDs. Mkv honestly came about for pirate media mostly.

    But again, no quality difference or playback difference between the two.

    Good info, thanks.
  • Aargh-a-KnotAargh-a-Knot Posts: 454Members
    edited October 2010
    maccolar wrote on May 14 2009, 11:03 AM:
    I'd like to recommend this video converter to you, I always use it to convert m2ts video to mkv video, it works pretty well for me, and the conversion quality is good.



    Spam?
  • SmithcraftSmithcraft Posts: 351Members ✭✭
    edited July 2011
    Frofessional?

    Perhaps tsmuxer to demux the streams and then mkvtoolnix to remux them into a mkv?

    SC
  • kriebekriebe Posts: 217Members, Plex Pass Plex Pass
    cold wrote:

    why not try final mate to help you? it's a frofessional software which can convert the MTS files to MKV without lossless. if you just want to change the format.thousands of softwares will be helpful, but if you want to keep the high quality of the video, a frofessional software is necessary. just try final mate, everything is perfect.


    Thanks for the advertisement and necro post.
  • tobeswsutobeswsu Posts: 2,878Members, Plex Pass Plex Pass

    What I am using is another M2TS Converter: Brorsoft M2TS Converter.

    It's specially designed for Sony, Canon, JVC and Panasonic AVCHD Camcorder/camera owners to convert MTS/M2TS to AVI, convert M2TS to WMV, convert MTS to MP4, etc.
    Besides, it also support converting the M2TS streams from blu-ray discs. And the ouput video resolusion is up to 1080p.

    If you would like to convert M2TS to MKV preserving the original quality, I suggest you choose "MKV HD Video(*.mkv)" in the format template as output video format, and set the video size as "1920*1080", audio codec as "ac3", and audio channel as "5.1".

    The best important factor appropriates me to choose it is its large variety of video formats. I feel it is very dependable and does exactly what I need it to do. Overall I am very happy with it and feel it was a good investment of my money. So I thinks it's worth to try and you can have a free trial at first.

    For more information please refer to: Brorsoft M2TS Converter


    Wow, what's with this topic that it attracts all these advertisements? :P
  • jelockwoodjelockwood Posts: 447Members

    Most 1080p movies I get are compressed using x264 in an mkv container.

    I have some m2ts files I'd like to compress myself into mkv, but I want to maintain a decent quality. What settings in Handbrake should I use? Or should I be using a different software tool?

    tsMuxeR can convert .m2ts files to .MKV files without losing any quality. It is available for Mac and Windows. See http://smlabs.net/en/products/tsmuxer/ and download it from http://www.videohelp.com/tools/tsMuxeR
  • IitiillyIitiilly Posts: 1Members
    windbell wrote on May 13 2009, 10:15 AM: »

    I only use 

    Most 1080p movies I get are compressed using x264 in an mkv container. HD Video Converter to convert hd video files, m2ts to mkv

    I have some m2ts files I'd like to compress myself into mkv, but I want to maintain a decent quality. What settings in Handbrake should I use? Or should I be using a different software tool?

    Hi,
    I own a Panasonic GF1 camera and record AVCHD lite movies with it. They use an MTS format/container. I want to be able to play them with my Samsung TV using Samsung's streaming software, but that software doesn't accept .mts files. It does accept .mkv though, and I know that the movie format (AVC and AC3) can be played on my TV.

    So all that's left is to convert the MTS to MKV without re-encoding (e.g. keeping AVC video and AC3 audio). I've tried searching for a tool to do this. Does anyone know of a solution?

    Thanks!!
Sign In or Register to comment.