What Is a .TS File?

MPEG transport stream

The .ts extension is also used by TypeScript source.Not sure which you have?

📂Video
🏷️.ts
🎯video/mp2t

MPEG Transport Stream (.ts, .m2ts, .mts)

Overview

An MPEG transport stream is a container designed for broadcasting and for media that may be damaged or joined mid-stream. Instead of one header describing the whole file, a transport stream is a sequence of small fixed-size packets, each self-describing, so a receiver can start decoding from any point and tolerate missing packets. It carries the video and audio of digital television (DVB, ATSC, ISDB), Blu-ray discs, camcorder recordings and HLS streaming segments.

The .ts extension collides with TypeScript source files. The two have nothing in common: a transport stream is binary and begins with the byte 0x47 repeated every 188 bytes; a TypeScript file is text. A video player and a code editor each refuse the other's file, which is the kind of ambiguity content-based detection exists to settle.

Technical Specifications

  • MIME Type: video/mp2t
  • File Extensions: .ts (generic), .m2ts and .mts (Blu-ray and AVCHD camcorder variant with 192-byte packets), .m2t, .tsv
  • Category: Video
  • Specification: ISO/IEC 13818-1 (MPEG-2 Part 1, systems)
  • Packet size: 188 bytes; 192 bytes in BDAV (.m2ts) with a 4-byte timestamp prefix
  • Codecs carried: MPEG-2, H.264, HEVC video; MPEG audio, AAC, AC-3, DTS; subtitles and teletext
  • Introduced: 1995
  • Magic bytes: 47 at offset 0, 188, 376, 564 and so on

Identification

00000000  47 40 00 10 00 00 b0 0d  00 01 c1 00 00 00 01 f0  |G@..............|
...
000000bc  47 40 11 10 00 42 f0 25  00 01 c1 00 00 ff 01 ff  |G@...B.%........|

The sync byte 0x47 (ASCII G) opens every packet. Detectors check for it at 188-byte intervals (or 192 for .m2ts, where the first four bytes of each packet are a timestamp and 0x47 sits at offset 4). The first packets usually carry the Program Association Table (PID 0) and Program Map Table, which list the streams inside.

File Structure

Packet (188 bytes)
├── Sync byte         0x47
├── Header            3 bytes: error flag, payload-start flag, PID (13 bits), scrambling, adaptation flags, continuity counter
├── Adaptation field  optional: PCR clock reference, stuffing
└── Payload           up to 184 bytes of a PES packet or a table section
  • PID (packet identifier) says which elementary stream a packet belongs to: one PID for video, one per audio track, reserved PIDs for the tables.
  • PAT and PMT tables map programs to PIDs, so a receiver tuning in mid-stream can find the video within a fraction of a second.
  • PCR timestamps let the decoder reconstruct the broadcaster's clock.

This structure is why transport streams are robust and why they are inefficient: roughly 2 percent of every file is packet headers, and there is no global index for seeking.

History and Development

MPEG-2 Systems (1995) defined two containers: the program stream for reliable media such as DVD, and the transport stream for broadcast, where packets get lost and viewers tune in at random moments. Digital television worldwide standardised on the transport stream, as did Blu-ray (as BDAV, the .m2ts form) and the AVCHD camcorder format Sony and Panasonic introduced in 2006.

Apple's HTTP Live Streaming (2009) chopped transport streams into short .ts segments for adaptive streaming over the web, which made the format ubiquitous in video delivery for a decade. HLS later added fragmented MP4 segments, and most new streaming deployments use those, but a vast amount of HLS content still ships as .ts.

Common Use Cases

  • Digital TV recordings from set-top boxes, HDHomeRun tuners and DVB capture cards
  • Camcorder footage (.mts / .m2ts) from Sony, Panasonic and Canon AVCHD cameras
  • Blu-ray disc content in the BDMV/STREAM folder
  • HLS streaming segments downloaded from a playlist (.m3u8)
  • IPTV and live capture of broadcast streams
  • Security and dashcam recordings, some of which write raw transport streams

How to Open a TS File

Media players

  • VLC plays .ts, .m2ts and .mts on every platform, including streams with multiple audio tracks and DVB subtitles. The first choice.
  • mpv, MPC-HC, PotPlayer, Kodi: all handle transport streams.
  • Windows Media Player and Movies & TV open many .ts files with H.264 or MPEG-2 inside; MPEG-2 may need the free MPEG-2 Video Extension from the Store.
  • QuickTime (macOS) does not open transport streams; use VLC or IINA.
  • iPhone and Android: VLC again; the built-in players generally refuse .ts.

Inspecting the streams

ffprobe -hide_banner recording.ts
# Program 1
#   Stream #0:0[0x100]: Video: h264 (High) ... 1920x1080
#   Stream #0:1[0x101](eng): Audio: aac (LC) ... 48000 Hz, stereo
#   Stream #0:2[0x102](eng): Subtitle: dvb_subtitle

If the file is actually TypeScript

A .ts file that opens as readable code in a text editor is a TypeScript source file. See the TypeScript guide.

How to Convert a TS File

Remux to MP4 or MKV (no quality loss)

Transport streams almost always carry H.264 or MPEG-2 video and AAC or AC-3 audio, which MP4 and MKV accept directly. Remuxing is fast and lossless:

# To MP4 (H.264 + AAC inside)
ffmpeg -i recording.ts -c copy recording.mp4

# MPEG-2 or AC-3 inside? MP4 is awkward; MKV takes anything
ffmpeg -i recording.ts -c copy recording.mkv

# Keep all audio tracks and subtitles
ffmpeg -i recording.ts -map 0 -c copy recording.mkv

Join HLS segments

Downloaded HLS content is often hundreds of numbered .ts files. Concatenate them, then remux:

cat seg*.ts > full.ts
ffmpeg -i full.ts -c copy full.mp4

# Or let ffmpeg read the playlist directly
ffmpeg -i playlist.m3u8 -c copy output.mp4

Re-encode

Only needed to shrink the file or to target a device that lacks the original codec:

ffmpeg -i recording.ts -c:v libx264 -crf 20 -c:a aac -b:a 192k output.mp4

Graphical tools

  • HandBrake opens .ts and .m2ts and exports MP4 or MKV.
  • VLC: Media, Convert / Save.
  • MKVToolNix: remux camcorder .mts to MKV while keeping every track.
  • tsMuxeR: the specialist tool for Blu-ray-compatible .m2ts authoring.

Advantages

  • Resilient: decodable from any packet; errors stay local.
  • Multi-program: one stream can carry several channels with their own audio and subtitle tracks.
  • Universal in broadcast and disc standards.
  • Hardware support in every TV, set-top box and camcorder.

Limitations

  • Overhead: packet headers and stuffing waste a few percent of every file.
  • No index: seeking means scanning, which is slow on large recordings.
  • Weak metadata: no chapters or rich tags.
  • Poor desktop support outside VLC: QuickTime and phone players refuse it.
  • Extension collision with TypeScript.
  • MP4: the usual remux target, and the segment format newer HLS uses.
  • MKV: accepts any codec a transport stream carries.
  • M3U: the playlist format that references HLS .ts segments.
  • TYPESCRIPT: the other .ts.

How to identify .TS files from the bytes

MPEG transport stream files carry a fixed byte pattern, the file signature or magic number, that identifies them regardless of the extension. This is what our detector reads.

OffsetHexASCII
047Sync byte 0x47 at the start of every 188-byte packet: offsets 0, 188, 376 and so on. Blu-ray .m2ts packets are 192 bytes with a 4-byte timestamp first.

Check a file yourself: xxd -l 16 file.ts on macOS and Linux, or Format-Hex file.ts | Select-Object -First 1 in PowerShell.Full MPEGTS signature reference

File Information

File Description

MPEG transport stream

Category

Video

Extensions

.ts, .m2ts, .mts

MIME Type

video/mp2t

Related File Types

Other file types in the Video category you might also need:

Start Analyzing MPEGTS Files Now

Use our free AI-powered tool to detect and analyze MPEG transport stream files instantly with Google's Magika technology.

⚡Try File Detection Tool