Convert MKV to TS — Free Online Tool

Convert MKV files to MPEG-2 Transport Stream (TS) format, re-encoding the video with H.264 and audio with AAC — producing a broadcast-ready, HLS-compatible stream file. TS is the standard container for live streaming pipelines, DVB broadcast, and HTTP Live Streaming (HLS) segmentation workflows.

FFmpeg Command

Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg

Free — no uploads, no signups. Your files never leave your browser.

Estimated output:

Conversion Complete!

Download

How It Works

MKV is a flexible container that can hold almost any codec, but its structure is not compatible with broadcast or streaming infrastructure that expects MPEG-2 Transport Stream framing. During this conversion, the video stream is re-encoded to H.264 (libx264) at CRF 23, and the audio is re-encoded to AAC at 128k bitrate — both of which are natively supported by the TS container. Unlike a simple remux, full re-encoding occurs here because TS requires specific packetization (PES packets inside MPEG-2 transport stream structure) and the source MKV may contain codecs or container features (like chapters or complex subtitle tracks) that have no direct equivalent in TS. The output is a continuous .ts bitstream suitable for broadcast playout, HLS chunking with tools like ffmpeg's hls muxer, or direct playback on set-top boxes and broadcast-grade players.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg binary — the underlying engine that powers this browser-based conversion via its WebAssembly build (FFmpeg.wasm). The same binary and command run identically on a desktop installation for files over 1GB.
-i input.mkv Specifies the input Matroska file. FFmpeg reads the MKV container's EBML structure to demux the video, audio, subtitle, and chapter streams for processing.
-c:v libx264 Re-encodes the video stream using the H.264 encoder (libx264), which is the most compatible video codec for MPEG-TS containers and is required for HLS-compliant transport streams.
-c:a aac Re-encodes the audio stream to AAC using FFmpeg's native AAC encoder, replacing whatever audio codec the source MKV contained (which could be Opus, Vorbis, MP3, or FLAC) with the AAC format expected by broadcast TS and HLS pipelines.
-crf 23 Sets the H.264 Constant Rate Factor to 23, which is libx264's default and produces a good balance of visual quality and file size for general-purpose TS output. Lower values (e.g., 18) increase quality and file size; higher values (e.g., 28) reduce both.
-b:a 128k Sets the AAC audio bitrate to 128 kilobits per second, which is adequate for stereo audio in broadcast and streaming contexts. For higher-fidelity audio in a TS file — such as for broadcast master delivery — increase this to 192k or 256k.
output.ts Specifies the output filename with the .ts extension, which tells FFmpeg to use the MPEG-2 Transport Stream muxer. The TS muxer wraps the H.264 video and AAC audio into 188-byte MPEG-TS packets suitable for broadcast playout, HLS segmentation, or streaming ingest.

Common Use Cases

  • Preparing a locally recorded MKV video for ingestion into an HLS packaging workflow, where .ts segment files are required as the base format before .m3u8 playlists are generated
  • Converting an MKV archive of a TV broadcast or recorded stream back into TS format for re-transmission over a DVB or IPTV system
  • Transcoding an MKV file for playback on a set-top box, smart TV, or broadcast monitor that accepts MPEG-TS input but cannot decode MKV containers
  • Creating a TS file from an MKV recording to use as a source in video editing or playout software (such as Blackmagic DaVinci Resolve or broadcast automation systems) that prefers transport stream inputs
  • Converting an MKV game capture or screen recording to TS for upload to a streaming platform's ingest endpoint that requires MPEG-TS wrapped H.264/AAC
  • Stripping MKV-specific features like chapter markers and complex metadata to produce a clean, linear TS file for archival in broadcast-standard storage systems

Frequently Asked Questions

TS does support subtitles, but the subtitle format must be compatible with MPEG-TS encapsulation — typically DVB subtitles or Teletext. Many MKV files carry SRT, ASS, or PGS subtitle tracks, which cannot be directly carried in a TS container without conversion. This tool's default command does not explicitly map subtitle streams, so subtitles from the MKV are likely to be dropped in the output TS file. If you need subtitles, you would need to either burn them into the video with a filter or use a subtitle format compatible with TS muxing.
Chapter metadata stored in the MKV file will be lost in the conversion to TS, because the MPEG-2 Transport Stream format has no equivalent structure for named chapter points. This is one of the key structural differences between the two containers. If chapter information is important to you, consider exporting it separately as an XML or chapter text file before converting.
Because both the video and audio are fully re-encoded (not remuxed), the output file size depends on the CRF value and audio bitrate chosen, not the original file's bitrate. At the default CRF 23 and 128k AAC, the output will often be smaller than a high-bitrate MKV source but could be larger than a heavily compressed one. Additionally, the TS container itself has slightly higher overhead than MKV due to its fixed 188-byte packet structure, which adds a small amount of framing data compared to MKV's variable-length EBML structure.
Yes, this conversion involves lossy re-encoding of both the video and audio streams. The video is encoded with H.264 at CRF 23, which is a visually near-transparent quality level for most content but is not lossless. The audio is encoded to AAC at 128k, which is also lossy. If the source MKV already contains H.264 video and AAC audio, you are performing a generation loss re-encode — quality will be slightly degraded compared to the original. For lossless output, you would need to use CRF 0 with H.264, though this produces very large files.
Yes. On Linux or macOS, you can run a shell loop: `for f in *.mkv; do ffmpeg -i "$f" -c:v libx264 -c:a aac -crf 23 -b:a 128k "${f%.mkv}.ts"; done`. On Windows Command Prompt, use: `for %f in (*.mkv) do ffmpeg -i "%f" -c:v libx264 -c:a aac -crf 23 -b:a 128k "%~nf.ts"`. This is especially useful for the desktop FFmpeg command shown on this page when processing files larger than 1GB that exceed the browser tool's limit.
Yes. To adjust video quality, change the CRF value — lower numbers mean higher quality and larger files (e.g., `-crf 18` for high quality, `-crf 28` for smaller files). To use H.265/HEVC instead of H.264, replace `-c:v libx264` with `-c:v libx265`. Note that H.265 in TS is less universally supported by broadcast and streaming infrastructure than H.264, so compatibility with set-top boxes or HLS players should be verified before switching codecs in a production workflow.

Technical Notes

The MPEG-2 Transport Stream format was designed for lossy transmission environments — its 188-byte fixed-packet structure with built-in error correction overhead makes it robust for broadcast but slightly inefficient for pure file storage compared to MKV's EBML-based variable-length framing. When converting from MKV, one important consideration is that MKV can hold virtually any codec combination, whereas TS has stricter codec support tied to MPEG standards and broadcast specifications. This command uses libx264 and AAC, which are the most universally compatible codec choices for TS and are required for HLS compatibility per Apple's HLS specification. Multiple audio tracks from the source MKV can technically be preserved in TS (the format supports them), but the default command only maps the primary streams — use `-map 0` to include all tracks if needed. The TS format does not support chapters, so any chapter metadata in the MKV is silently discarded. Subtitle support in TS is limited to broadcast-compatible formats and is not handled by this default command. For HLS workflows, the resulting .ts file can be segmented using FFmpeg's `-f hls` muxer as a follow-up step.

Related Tools