Convert MPEG to TS — Free Online Tool

Convert MPEG files (MPEG-1/MPEG-2 video with MP2 audio) to MPEG-2 Transport Stream (.ts) format, re-encoding the video with H.264 (libx264) and audio with AAC — producing a modern, broadcast-ready stream container compatible with HLS and live streaming pipelines.

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

MPEG files typically carry MPEG-1 or MPEG-2 video streams alongside MP2 audio in a program stream (PS) container. Because TS requires a different multiplexing structure (fixed-size 188-byte packets for reliable broadcast transmission), and because the output is targeted at H.264 rather than MPEG-2 video, the entire video stream must be fully re-encoded — not simply remuxed. FFmpeg decodes the MPEG-2 video frames and re-encodes them using libx264 at CRF 23, which typically produces significantly smaller files at equal or better perceptual quality. The MP2 audio is simultaneously transcoded to AAC at 128k, which is far more efficient than MP2 and natively supported by modern browsers, mobile devices, and HLS players. The output .ts file uses MPEG-2 Transport Stream packetization, making it directly usable in broadcast chains, HLS segment workflows, and streaming servers.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg media processing tool. In this browser-based tool, FFmpeg runs locally via WebAssembly (ffmpeg.wasm) — no data is sent to a server.
-i input.mpeg Specifies the input MPEG file, which may contain MPEG-1 or MPEG-2 video and MP2, MP3, or AAC audio in a program stream container. FFmpeg auto-detects the stream types from the container.
-c:v libx264 Re-encodes the MPEG-1/MPEG-2 video stream using the H.264 encoder (libx264). This is a full transcode — not a copy — because the MPEG video codec is incompatible with the modern H.264 baseline expected in TS streaming workflows.
-c:a aac Transcodes the audio (typically MP2 in MPEG files) to AAC using FFmpeg's built-in AAC encoder. AAC is the standard audio codec for HLS and Transport Stream delivery, replacing the legacy MP2 format which has poor support on modern browsers and devices.
-crf 23 Sets the Constant Rate Factor for the libx264 encoder to 23, which is the default quality level representing a good balance between file size and visual quality. Lower values (e.g., 18) produce higher quality at larger file sizes; higher values (e.g., 28) reduce file size with some quality loss.
-b:a 128k Sets the AAC audio bitrate to 128 kilobits per second. This is a standard target for AAC audio that delivers good perceptual quality — notably, AAC at 128k is generally considered equivalent to or better than the MP2 audio commonly found in MPEG files at 192k.
output.ts Specifies the output filename with the .ts extension, which tells FFmpeg to wrap the H.264 video and AAC audio into an MPEG-2 Transport Stream container — the format required for HLS segments, broadcast ingest, and streaming server compatibility.

Common Use Cases

  • Preparing legacy MPEG recordings from DVD authoring tools or capture cards for ingest into an HLS streaming server that requires .ts segments with H.264 and AAC.
  • Modernizing archived MPEG-2 broadcast recordings for upload to platforms like YouTube or Vimeo, which prefer H.264 in a streamable container over raw MPEG program streams.
  • Converting MPEG files captured from older set-top boxes or DVRs into .ts format for compatibility with modern media servers like Jellyfin, Plex, or Emby without re-containerization issues.
  • Producing .ts output from MPEG source footage for use as input segments in FFmpeg-based live streaming pipelines or video-on-demand packaging workflows.
  • Reducing storage size of large MPEG-2 video archives — H.264 at CRF 23 typically achieves 40–60% smaller files than MPEG-2 at equivalent visual quality.
  • Converting legacy MPEG training or instructional videos into a .ts container for playback on digital signage systems and broadcast monitors that require Transport Stream input.

Frequently Asked Questions

There will be some generation loss since the MPEG-2 video must be fully decoded and re-encoded to H.264 — this is not a lossless remux. However, H.264 at CRF 23 (the default used here) is generally considered visually transparent for most content, and in many cases the H.264 output will look equal to or better than the source MPEG-2 at a fraction of the file size. The MP2 audio is transcoded to AAC at 128k, which is also a lossy step, but AAC at 128k is widely considered to match or exceed MP2 at 192k in perceptual quality.
H.264 video and AAC audio can be placed in several containers — MP4, MKV, and TS are all valid options. The MPEG-2 Transport Stream (.ts) container was specifically designed for broadcast and streaming reliability, using fixed 188-byte packets that allow decoders to resync after transmission errors. This makes .ts the standard segment format for HLS (HTTP Live Streaming) and traditional broadcast workflows, even though the underlying codecs (H.264 + AAC) are identical to what you'd find in an .mp4 file.
Yes — the -crf flag controls video quality for the libx264 encoder, where lower values mean higher quality and larger files. The default is 23 (a good general-purpose balance). For higher quality, try -crf 18; for smaller files with acceptable quality, try -crf 28. For audio, replace -b:a 128k with -b:a 192k or -b:a 96k to increase or decrease AAC audio bitrate respectively. For example: ffmpeg -i input.mpeg -c:v libx264 -c:a aac -crf 18 -b:a 192k output.ts
MPEG-2 video is significantly less efficient than H.264, so the .ts output is almost always smaller than the source MPEG — often 40–70% smaller for typical video content. However, the Transport Stream container itself adds a small overhead compared to MP4 due to its packetized structure. If your source MPEG was encoded at a very low bitrate already, the size reduction will be less dramatic, and there is a floor below which further compression hurts quality noticeably.
The MPEG-2 Transport Stream format does support subtitles and multiple audio tracks, unlike the MPEG program stream format. However, since the source MPEG format itself does not carry embedded subtitle streams or multiple audio tracks, there is no subtitle or secondary audio data to transfer. If you want to add subtitles to the .ts output, you would need to supply a separate subtitle file and add flags like -i subtitles.srt -c:s copy to the FFmpeg command.
Yes — on Linux or macOS you can use a shell loop: for f in *.mpeg; do ffmpeg -i "$f" -c:v libx264 -c:a aac -crf 23 -b:a 128k "${f%.mpeg}.ts"; done. On Windows Command Prompt, use: for %f in (*.mpeg) do ffmpeg -i "%f" -c:v libx264 -c:a aac -crf 23 -b:a 128k "%~nf.ts". The browser-based tool processes one file at a time, so the FFmpeg command approach is recommended for batch jobs or files over 1GB.

Technical Notes

MPEG program streams (.mpeg/.mpg) use variable-length packets and are designed for relatively error-free environments like disc playback, whereas the MPEG-2 Transport Stream (.ts) uses fixed 188-byte packets with built-in error correction signaling — a fundamental structural difference that requires full remultiplexing, not just a container swap. The video re-encoding from MPEG-2 to H.264 via libx264 uses CRF (Constant Rate Factor) mode rather than the MPEG-style quantizer scale (-q:v) used by the source format. CRF is a quality-based variable bitrate mode that adapts per-scene, generally outperforming fixed-quantizer MPEG-2 encoding at any given file size. MP2 audio (common in MPEG-2 broadcast streams) is replaced by AAC, which is supported natively by all modern browsers, iOS, Android, and HLS players — MP2 has very limited support outside legacy broadcast contexts. Note that MPEG files occasionally carry MPEG-1 video (used in VCD-era content) rather than MPEG-2; libx264 handles decoding both transparently. Metadata such as creation timestamps embedded in MPEG program streams is generally not preserved in the TS output, as the Transport Stream format uses a different metadata model (PAT/PMT tables) and FFmpeg does not automatically map MPEG PS metadata to TS program tables.

Related Tools