Convert MPG to TS — Free Online Tool
Convert MPG files (MPEG-1/2 video with MP2 audio) to MPEG-2 Transport Stream (.ts) format, re-encoding the video to H.264 with AAC audio — making legacy broadcast and VCD/DVD content fully compatible with modern HLS streaming pipelines, digital broadcast systems, and media servers.
to
FFmpeg Command
Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg
Drop your MPG 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
MPG files typically contain MPEG-1 or MPEG-2 video alongside MP2 audio, packaged in a program stream (PS) structure designed for local playback on VCD and DVD media. Converting to TS involves two re-encoding steps: the MPEG-2 video is transcoded to H.264 (libx264) using a CRF value of 23, which produces significantly smaller files at comparable visual quality, and the MP2 audio is transcoded to AAC at 128k bitrate, which is more efficient and broadly supported than MP2. The output is wrapped in the MPEG-2 Transport Stream container — a packet-based format originally designed for lossy transmission environments like broadcast TV, which is why it is also the container underlying HLS (.m3u8) streaming segments. Unlike the source MPG program stream, the TS container is resilient to data loss and supports multiple audio tracks and subtitles, though those advanced features are only relevant if your source material contains them.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg tool, the open-source multimedia processing engine that handles the MPG decoding, H.264/AAC re-encoding, and TS container packaging in this conversion. |
-i input.mpg
|
Specifies the input MPG file — an MPEG Program Stream container typically holding MPEG-1 or MPEG-2 video and MP2 audio, as produced by VCD authoring, DVD ripping, or broadcast capture hardware. |
-c:v libx264
|
Selects libx264 as the video encoder, transcoding the MPEG-2 video stream from the MPG into H.264 — a vastly more compression-efficient codec that is universally supported by modern streaming infrastructure, browsers, and devices. |
-c:a aac
|
Selects FFmpeg's native AAC encoder to transcode the MP2 audio from the source MPG into AAC, which is the standard audio codec for HLS streaming and has broad native support across all modern platforms, unlike the legacy MP2 format. |
-crf 23
|
Sets the Constant Rate Factor for libx264 to 23, the default quality level, which provides a good balance between visual quality and file size. Lower values (e.g., 18) increase quality and file size; higher values (e.g., 28) reduce file size at the cost of more visible compression artifacts. |
-b:a 128k
|
Sets the AAC audio bitrate to 128 kilobits per second, which is sufficient for clear stereo audio and is the standard bitrate used for AAC in HLS and streaming contexts — a step down from common MP2 broadcast bitrates but perceptually transparent for most content. |
output.ts
|
Defines the output file with a .ts extension, instructing FFmpeg to wrap the encoded H.264 video and AAC audio into an MPEG-2 Transport Stream container — the packetized format used in broadcast television, HLS streaming segments, and IPTV delivery. |
Common Use Cases
- Ingest legacy broadcast recordings or VCD/DVD rips into an HLS streaming workflow, since TS is the native segment container used by Apple HLS and compatible CDNs
- Modernize archived MPEG-2 broadcast footage for upload to streaming platforms that require H.264 video in a transport stream wrapper
- Prepare MPG content captured from older broadcast hardware or satellite receivers for playout on modern digital signage or IPTV systems that expect TS input
- Reduce the file size of large MPEG-2 MPG archives by re-encoding to H.264 inside a TS container, taking advantage of H.264's superior compression efficiency over MPEG-2
- Convert MPG recordings from older DVRs or set-top boxes into a format compatible with FFmpeg-based live streaming pipelines and media servers like Wowza or Nginx-RTMP
- Package VCD or DVD source video into TS format for use as input to video processing tools or transcoders that require transport stream input rather than program stream
Frequently Asked Questions
Yes, there will be some quality loss because both the video and audio are re-encoded — this is not a lossless remux. The MPEG-2 video from the MPG is decoded and re-encoded to H.264 at CRF 23, which is a good general-purpose quality level but does introduce an additional generation of lossy compression on top of the original MPEG-2 encoding. That said, H.264 at CRF 23 is typically visually very close to the source, and the resulting file will usually be noticeably smaller. If preserving the exact original quality is critical, you could lower the CRF value (e.g., to 18) in the FFmpeg command.
While the MPEG-2 Transport Stream container does support MPEG-2 video natively (which is how broadcast DVB and ATSC television works), H.264 is the far more practical choice for modern use cases. H.264 delivers equivalent visual quality at roughly half the bitrate of MPEG-2, making it the standard codec for HLS streaming, online video platforms, and modern media servers. Keeping MPEG-2 video inside a TS wrapper would limit compatibility with web players and streaming infrastructure that expect H.264.
MP2 (MPEG-1 Audio Layer II) is the native audio codec for MPG files used in VCD and broadcast contexts, but it has very limited support in modern web browsers, streaming platforms, and mobile devices. AAC is the standard audio codec for HLS streaming and is natively supported on virtually every modern playback device and browser. Converting to AAC at 128k also typically produces better audio quality than MP2 at equivalent bitrates, making it the right choice for the TS output.
The FFmpeg command displayed on this page — 'ffmpeg -i input.mpg -c:v libx264 -c:a aac -crf 23 -b:a 128k output.ts' — can be run directly in your terminal on Windows, macOS, or Linux if you have FFmpeg installed. This bypasses the 1GB browser limit entirely and will often be faster for large files since it uses your CPU's full native performance rather than the WebAssembly runtime. You can download FFmpeg for free from ffmpeg.org.
The CRF value controls the video quality-to-size tradeoff for H.264 encoding. Lower CRF values produce higher quality and larger files — CRF 18 is considered visually near-lossless — while higher values produce smaller files with more compression artifacts. The range is 0 to 51, with 23 being the default. For example, to get a higher quality output you would use: 'ffmpeg -i input.mpg -c:v libx264 -c:a aac -crf 18 -b:a 128k output.ts'. To reduce file size at the cost of some quality, try CRF 28.
Yes. On Linux or macOS, you can use a shell loop: 'for f in *.mpg; do ffmpeg -i "$f" -c:v libx264 -c:a aac -crf 23 -b:a 128k "${f%.mpg}.ts"; done'. On Windows Command Prompt, use: 'for %f in (*.mpg) do ffmpeg -i "%f" -c:v libx264 -c:a aac -crf 23 -b:a 128k "%~nf.ts"'. This will process every MPG file in the current directory and output a corresponding TS file with the same base filename.
Technical Notes
MPG files use the MPEG Program Stream (PS) container, which is designed for reliable storage media rather than transmission. When converting to MPEG-2 Transport Stream (TS), the container switch itself is significant: TS uses fixed 188-byte packets with synchronization markers, making it resilient to transmission errors and well-suited for network streaming — which is why it underpins HLS. The video transcode from MPEG-2 to H.264 via libx264 with CRF 23 will typically reduce file size by 40–60% compared to the original MPEG-2 bitrate at comparable quality, because H.264 is a far more efficient codec. The MP2-to-AAC audio transcode is lightweight and introduces minimal perceptible quality change at 128k. One limitation to be aware of: MPG files from VCD sources are often interlaced (480i or 576i), and this conversion does not apply deinterlacing by default. If your source MPG is interlaced broadcast content, you may want to add a deinterlace filter to the command, such as '-vf yadif', before the output filename. Metadata preservation is minimal in this conversion — MPG program streams carry very little metadata, and the TS container will not carry chapter or subtitle data from the source since MPG does not support those features.