Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Does anyone know of an application that allows me to convert an m2ts file to mkv or some other format? Preferably something that allows me to convert it directly, rather than convert the whole Blu-ray disc. hddump didn't work because it doesn't convert only the m2ts file, and the contents are on a .iso that I mounted virtually.

share|improve this question
add comment

3 Answers

up vote 10 down vote accepted

With Handbrake you can convert all kinds of files:

Supported Sources:

  • Any DVD or Bluray-like source: VIDEO_TS folder, DVD image, real DVD or bluray (unencrypted -- removal of copy protection is not supported), and some .VOB, .TS and M2TS files
  • Most any multimedia file it can get libavformat to read and libavcodec to decode.

Outputs:

  • File format: MP4(M4V) and MKV
  • Video: MPEG-4(ffmpeg), H.264(x264), or Theora(libtheora)
  • Audio: AAC, CoreAudio AAC (OS X Only), MP3, or Vorbis. AC-3 pass-through, DTS pass-thorugh (MKV only)"
share|improve this answer
    
Thank you, this will also be nice to have in the future. –  Thomas Boxley Feb 26 '11 at 15:20
    
You can also convert for ipods and similar. It's really great :) –  Alvar Feb 26 '11 at 15:28
    
Note that Handbrake will re-encode the video, whereas ffmpeg will simply copy the internal stream to the new MKV container. This will be much faster and not change the quality. –  Mike Pelley Nov 2 '13 at 18:13
    
Except the PPA doesn't work (404). I had to manually add it to my softare sources. –  Yanick Rochon Dec 14 '13 at 18:02
add comment

ffmpeg Install ffmpeg

I think ffmpeg will do the job it's quite simply copy all the streams and output them in an mkv container. No information is lost/re-encoded.

ffmpeg -i input.mt2s -scodec copy -acodec copy -vcodec copy -f matroska input.mkv
share|improve this answer
add comment

The easiest tool to use is mkvmerge, which is part of the mkvtoolnix package. To convert your file:

sudo apt-get install mkvtoolnix
mkvmerge -o output.mkv input.m2ts

Example output:

mkvmerge v6.1.0 ('Old Devil') built on Mar  4 2013 20:24:55
'input.m2ts': Using the demultiplexer for the format 'MPEG transport stream'.
'input.m2ts' track 0: Using the output module for the format 'AVC/h.264'.
'input.m2ts' track 1: Using the output module for the format 'AC3'.
'input.m2ts' track 2: Using the output module for the format 'PGS'.
The file 'output.mkv' has been opened for writing.
'input.m2ts' track 0: Extracted the aspect ratio information from the MPEG-4
 layer 10 (AVC) video data and set the display dimensions to 1920/1080.
Progress: 100%
The cue entries (the index) are being written...
Muxing took 4 minutes 20 seconds.
share|improve this answer
    
You're right, mosu's tools support this for a while now. I recommend subscribing to the RSS feed of his blog and installing updated versions from his repository, which are updated every one to two months. I recently found that they don't seem to support lpcm though. –  LiveWireBT Mar 5 at 15:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.