Convert TS to MKV — Free Online Tool
Convert MPEG-2 Transport Stream (.ts) files to Matroska (.mkv) with full preservation of subtitles, multiple audio tracks, and chapter markers added by the MKV container. The video is re-encoded using H.264 (libx264) with CRF 23, making this ideal for archiving broadcast recordings in a more universally playable, open-standard format.
to
FFmpeg Command
Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg
Drop your TS file here
or click to browse
Free — no uploads, no signups. Your files never leave your browser.
Settings
Note: Browser-based encoding uses approximate quality targets. For precise CRF compression, copy the FFmpeg command above and run it on your desktop.
Estimated output:
Conversion Complete!
DownloadHow It Works
MPEG-2 Transport Stream files are commonly produced by digital TV tuners, set-top boxes, and broadcast capture hardware. During this conversion, the video stream is re-encoded from whatever codec the TS file carries (often MPEG-2 Video or H.264) into H.264 using libx264 at CRF 23, which strikes a balance between file size and visual quality. The audio — frequently AC-3 (Dolby Digital) in broadcast recordings — is transcoded to AAC at 128k. Crucially, any subtitle tracks embedded in the TS stream are carried over into MKV's native subtitle container support, and MKV's chapter system allows you to add navigation markers that TS does not support. The result is a single, self-contained MKV file compatible with virtually every modern media player.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg binary — the open-source multimedia processing engine that powers this conversion. In the browser, this runs as a WebAssembly build (FFmpeg.wasm); on your desktop, this calls your locally installed FFmpeg. |
-i input.ts
|
Specifies the input file as an MPEG-2 Transport Stream. FFmpeg will parse the TS container, identify all program streams (video, audio, subtitles, data), and make them available for mapping and encoding. |
-c:v libx264
|
Re-encodes the video stream using the libx264 encoder, producing H.264 video output. This replaces whatever video codec the source TS carries — commonly MPEG-2 or H.264 — with a fresh H.264 encode that is universally compatible with the MKV container and modern players. |
-c:a aac
|
Transcodes the audio stream to AAC using FFmpeg's native AAC encoder. Broadcast TS files typically carry AC-3 or MPEG Layer 2 audio, neither of which is natively supported by all MKV-playing devices, so this ensures broad compatibility at the cost of one generation of lossy re-encoding. |
-crf 23
|
Sets the H.264 Constant Rate Factor to 23, which is the libx264 default and produces a good balance of visual quality and file size for broadcast content. Lower values (e.g., 18) increase quality and file size; higher values (e.g., 28) reduce both. This applies only to the video stream. |
-b:a 128k
|
Sets the AAC audio bitrate to 128 kilobits per second, which is adequate for stereo dialogue and music in TV content. If your TS source has 5.1 surround audio that you are transcoding to AAC rather than copying, consider raising this to 192k or 256k to better preserve multichannel spatial information. |
output.mkv
|
Defines the output file as a Matroska (.mkv) container. FFmpeg infers the container format from the file extension and writes the re-encoded H.264 video and AAC audio — along with any subtitle streams — into MKV's flexible, open-standard wrapper. |
Common Use Cases
- Archive recorded broadcast TV episodes captured by a DVR or TV tuner card into a cleaner, widely-supported MKV file with subtitle tracks intact
- Convert live-stream recordings saved as .ts files (e.g., from OBS or Streamlink) into MKV for easier editing and playback on desktop players like VLC or mpv
- Preserve multi-language audio tracks from a broadcast TS recording into MKV, which fully supports multiple audio streams with language metadata
- Re-package a transport stream file for long-term media library storage using Plex or Jellyfin, which handle MKV more reliably than raw TS files
- Convert HLS segment files (.ts) that have been downloaded and concatenated into a single TS file into a properly containerized MKV for offline viewing
- Reduce file size of a raw broadcast capture — TS files often carry overhead from transport stream padding — by re-encoding to H.264 in a compact MKV wrapper
Frequently Asked Questions
Yes — subtitle support is one of the primary advantages of this conversion. MKV natively supports a wide range of subtitle formats including SRT, ASS, PGS (Blu-ray bitmap subs), and DVB subtitles commonly found in broadcast TS files. The FFmpeg command as shown re-encodes video and audio but will pass subtitle streams through. If you want to explicitly map all subtitle tracks, you can add '-c:s copy' to the command to ensure they are copied without conversion.
The default command transcodes the audio to AAC at 128k, which means the original AC-3 track will not be preserved as-is. If you need to keep the AC-3 audio untouched — for instance, to maintain 5.1 surround sound for home theater playback — you can modify the command to '-c:a copy' instead of '-c:a aac'. MKV fully supports AC-3 audio, so this substitution is safe and will avoid any audio quality loss from re-encoding.
TS files include significant transport stream overhead — null packets, program tables, and padding used for broadcast multiplexing — that adds bulk without adding quality. Re-encoding to H.264 in MKV typically reduces file size substantially, especially if the source was MPEG-2 Video, which is far less efficient than H.264. However, if your TS file already contained H.264 video, re-encoding at CRF 23 may produce a slightly larger or similar-sized file depending on the original encoding quality. To get a smaller file, raise the CRF value (e.g., 28); for higher quality, lower it (e.g., 18).
Yes, and this is one area where MKV improves on TS. The MPEG-2 Transport Stream format does not support chapters natively, but MKV has a robust chapter system. If you are batch-processing recordings and want to add chapter markers (e.g., to delineate TV segments), you can do so with FFmpeg using the '-metadata_global' options or by providing a chapter metadata file. The MKV container will store these chapters and media players like VLC and mpv will display them as navigation points.
The '-crf 23' flag controls video quality using H.264's Constant Rate Factor scale, where lower values mean higher quality and larger files, and higher values mean lower quality and smaller files. The scale runs from 0 (lossless) to 51 (lowest quality). For archiving broadcast content where visual fidelity matters, try '-crf 18' for near-lossless quality. For streaming or casual storage where file size is a priority, '-crf 28' is a reasonable choice. A change of ±6 in CRF roughly halves or doubles the output file size.
Yes. On Linux or macOS, you can run a simple shell loop: 'for f in *.ts; do ffmpeg -i "$f" -c:v libx264 -c:a aac -crf 23 -b:a 128k "${f%.ts}.mkv"; done'. On Windows Command Prompt, use: 'for %f in (*.ts) do ffmpeg -i "%f" -c:v libx264 -c:a aac -crf 23 -b:a 128k "%~nf.mkv"'. This is especially valuable for converting an entire season of recorded TV episodes, since the browser-based tool processes one file at a time.
Technical Notes
TS files sourced from broadcast capture can vary significantly in their internal codec — older DVB broadcasts use MPEG-2 Video, while newer HD broadcasts and IPTV streams often carry H.264 or even H.265. This tool always re-encodes the video to H.264 (libx264) at CRF 23, so if your source is already H.264, you are performing a generation loss transcode. For source-accurate archiving of H.264 TS files, you might prefer to use '-c:v copy' locally to remux without re-encoding, though this is not available in the browser tool. Audio in broadcast TS is commonly AC-3 (Dolby Digital) or MPEG Layer 2, neither of which is the default AAC output — transcoding to AAC at 128k will lose the multichannel surround information unless you explicitly copy the audio stream. MKV's metadata support is far richer than TS: you can embed title, episode, language tags, and artwork. One known limitation is that some DVB teletext subtitle formats embedded in TS streams require additional FFmpeg flags ('-f lavfi') to extract correctly and may not transfer automatically.