Compress TS Online — Free File Size Reducer

Compress a TS (MPEG-2 Transport Stream) file into a smaller TS file by re-encoding its video stream with H.264 (libx264) at CRF 23 and its audio with AAC at 128k. This is ideal for reducing the file size of broadcast recordings, live stream captures, or HLS segments while preserving the transport stream container structure for continued broadcast compatibility.

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

Unlike a simple remux, this tool fully re-encodes both the video and audio streams inside the TS container. The incoming TS file — which may carry H.264, H.265, VP9, or other video codecs alongside AC3, MP3, or AAC audio — is decoded and then re-encoded: video is compressed using the H.264 codec via libx264 at CRF 23, and audio is re-encoded to AAC at 128k bitrate. The output remains a valid MPEG-2 Transport Stream (.ts), meaning it retains the packetized elementary stream (PES) structure required for broadcast pipelines, HLS delivery, and set-top box compatibility. Because this is a full transcode rather than a stream copy, the encoder can apply new compression decisions that significantly reduce file size, especially when the source was captured at high bitrates from a broadcast tuner or live encoder. Subtitle tracks embedded in the stream are preserved where possible, and if the source contains multiple audio tracks, the default track is re-encoded.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg command-line tool, which is the engine running inside your browser via WebAssembly (FFmpeg.wasm) to perform this compression without uploading your file to any server.
-i input.ts Specifies the input MPEG-2 Transport Stream file. FFmpeg reads the TS container, identifies its packetized elementary streams (video, audio, and any subtitle PIDs), and makes them available for decoding and re-encoding.
-c:v libx264 Sets the video encoder to libx264, the industry-standard H.264 encoder. This re-encodes whatever video codec the source TS contains (H.264, H.265, MPEG-2, etc.) into H.264, which is universally compatible with broadcast players, HLS delivery systems, and set-top boxes.
-crf 23 Sets the Constant Rate Factor to 23, which is the libx264 default and represents a balanced midpoint between file size and visual quality. A lower CRF (e.g., 18) yields a higher-quality, larger file; a higher CRF (e.g., 28–35) yields a smaller file with more visible compression, useful for aggressively shrinking large broadcast recordings.
-c:a aac Re-encodes the audio stream to AAC using FFmpeg's native AAC encoder. This replaces common broadcast audio formats like AC3 (Dolby Digital) or MP3 found in source TS files with AAC, which is widely supported in HLS streaming and modern broadcast ingest workflows.
-b:a 128k Sets the AAC audio output bitrate to 128 kilobits per second. This is a standard quality level suitable for stereo speech and music in compressed broadcast content. For higher fidelity — especially if the source was AC3 at 192k or 384k — increasing this to 192k or 256k will better preserve audio quality.
output.ts Specifies the output file as an MPEG-2 Transport Stream. FFmpeg uses the .ts extension to determine the output container, ensuring the re-encoded H.264 video and AAC audio are wrapped back into a valid TS container with proper PES packetization for broadcast and HLS compatibility.

Common Use Cases

  • Reducing the storage footprint of broadcast TV recordings captured by a DVR or tuner card, which often produce large TS files at high broadcast bitrates
  • Shrinking live stream recordings from platforms or encoders that output raw TS files before they are packaged into HLS or DASH segments
  • Preparing a TS file for upload to a video-on-demand platform that has strict file size or bitrate limits while keeping the transport stream format for ingest compatibility
  • Archiving sports or news broadcast recordings at a lower bitrate after the original high-quality version is no longer needed
  • Re-compressing HLS-compatible TS segments from a high-bitrate capture to a bitrate suitable for low-bandwidth distribution
  • Cleaning up and downsizing TS files from IP camera recordings or IPTV streams that were saved at unnecessarily high bitrates

Frequently Asked Questions

Yes, because this process fully re-encodes the video and audio streams. Every generation of lossy re-encoding introduces some quality degradation, even if it is subtle at CRF 23. If your source TS was already encoded with lossy compression (as broadcast TS files typically are), you are decoding and re-encoding a lossy signal, which compounds artifacts. For archival purposes, use the lowest CRF value you can afford in terms of file size, such as CRF 18, to minimize generational loss.
The tool is specifically designed to compress while preserving the MPEG-2 Transport Stream container format. TS is required for broadcast pipelines, HLS streaming, set-top boxes, and certain ingest systems that expect packetized elementary streams. If your workflow depends on TS — for example, feeding segments into an HLS packager or a broadcast playout system — keeping the container as TS avoids any re-packaging step. If you need MP4 or MKV output, a separate conversion tool would be more appropriate.
The tool re-encodes the default audio track to AAC at 128k, regardless of whether the source audio is AC3 (common in ATSC broadcast), MP3, or another format. AC3 5.1 surround audio will be downmixed and transcoded to AAC stereo at 128k, which means surround sound information is lost. If preserving AC3 or multi-channel audio is important, you would need to modify the FFmpeg command to use '-c:a copy' or '-c:a ac3' instead of the default AAC encoding.
The '-crf 23' flag controls video quality and compression. Lower values (e.g., CRF 18) produce higher quality and larger files, while higher values (e.g., CRF 28 or 35) produce smaller files with more compression artifacts. For broadcast-origin material that was already compressed, staying between CRF 18 and CRF 28 is a reasonable range. You can also adjust audio bitrate by changing '-b:a 128k' to values like '192k' for better audio fidelity or '96k' for a smaller file.
Yes. On Linux or macOS, you can use a shell loop: 'for f in *.ts; do ffmpeg -i "$f" -c:v libx264 -crf 23 -c:a aac -b:a 128k "compressed_$f"; done'. On Windows Command Prompt, use: 'for %f in (*.ts) do ffmpeg -i "%f" -c:v libx264 -crf 23 -c:a aac -b:a 128k "compressed_%f"'. This applies the same compression settings to every TS file in the current directory, which is useful for processing a large archive of broadcast recordings.
Subtitle tracks in a TS file — such as DVB subtitles or SCTE-35 data — may or may not be carried through depending on how FFmpeg maps streams during the transcode. By default, the command targets video and audio streams. To explicitly preserve subtitles, you can add '-c:s copy' to the command, but note that some subtitle types embedded in broadcast TS files (like DVB teletext) are not always cleanly remuxed. Testing with your specific source file is recommended if subtitle preservation is critical.

Technical Notes

MPEG-2 Transport Streams use fixed 188-byte packets and are designed for error-resilient transmission over noisy channels such as over-the-air broadcast or satellite links. When compressing TS-to-TS, FFmpeg re-encodes the elementary streams and wraps them back into the TS container with a new program map table (PMT). The libx264 encoder at CRF 23 targets a visually consistent quality level rather than a fixed bitrate, so actual file size reduction depends heavily on the complexity and original bitrate of the source — a broadcast TS at 15–20 Mbps can often be reduced to 2–4 Mbps at CRF 23 with minimal perceptual loss. The output TS file remains HLS-compatible and can be used directly as media segments. Note that TS does not support chapter markers, so no chapter metadata is carried into the output. Multiple audio tracks in the source are not automatically mapped; only the default audio track is re-encoded unless you explicitly add '-map' flags to the command. Transparency is not supported by the TS container or by H.264 video, so any alpha channel data in the source is discarded.

Related Tools