Convert AVI to TS
Max file size 100mb.
AVI vs TS Format Comparison
| Aspect | AVI (Source Format) | TS (Target Format) |
|---|---|---|
| Format Overview |
AVI
Audio Video Interleave
Microsoft's pioneering multimedia container introduced with Windows 3.1 in 1992, based on the Resource Interchange File Format (RIFF). AVI stores interleaved audio and video data with support for a wide range of codecs, from uncompressed PCM/RGB to DivX and Xvid. While its simplistic structure makes it reliable for editing and archiving, the lack of modern features like variable frame rate, native streaming, and standardized subtitle support has led to its gradual replacement by MP4 and MKV. Legacy Lossy |
TS
MPEG Transport Stream
A streaming-oriented container format designed for broadcast television, cable systems, and live transmission where data loss is expected. Unlike MPEG Program Stream (MPG), Transport Stream uses fixed-length 188-byte packets with error correction, making it resilient to transmission errors and ideal for IPTV, DVB, ATSC, and Blu-ray disc storage. TS supports multiplexing multiple programs within a single stream and is the foundation of HLS (HTTP Live Streaming). Standard Lossy |
| Technical Specifications |
Container: Microsoft RIFF-based container (AVI 2.0/OpenDML)
Video Codecs: MPEG-4 ASP (DivX, Xvid), H.264, MJPEG, Uncompressed, DV Audio Codecs: MP3, AC-3, PCM, WMA, DTS Max Resolution: No defined limit (codec-dependent) Extensions: .avi |
Container: MPEG-2 Transport Stream (ISO/IEC 13818-1)
Video Codecs: MPEG-2, H.264/AVC, H.265/HEVC Audio Codecs: MPEG-1 Layer II (MP2), AAC, AC-3, DTS Max Resolution: Up to 8K (H.265 in ATSC 3.0) Extensions: .ts, .mts, .m2ts, .tsv |
| Video Features |
|
|
| Processing & Tools |
Decoding and extracting streams from AVI files: # Extract video stream from AVI ffmpeg -i input.avi -c:v copy -an video_only.avi # Analyze AVI codecs ffprobe -v error -show_streams input.avi |
Encoding and packaging MPEG Transport Stream for broadcast and HLS: # Convert AVI to MPEG Transport Stream ffmpeg -i input.avi -c:v libx264 -c:a aac \ -f mpegts output.ts # Create HLS segments from TS ffmpeg -i input.ts -c copy -hls_time 10 \ -hls_list_size 0 output.m3u8 # Blu-ray compatible M2TS ffmpeg -i input.avi -c:v libx264 -level 4.1 \ -c:a ac3 -f mpegts output.m2ts |
| Advantages |
|
|
| Disadvantages |
|
|
| Common Uses |
|
|
| Best For |
|
|
| Version History |
Introduced: 1992 (Microsoft, Windows 3.1)
Current Version: AVI 2.0 / OpenDML (1996) Status: Legacy format, widely supported but rarely used for new content Evolution: AVI 1.0/RIFF (1992) → AVI 2.0/OpenDML (1996) → DivX era (2000s) → largely superseded by MP4/MKV |
Introduced: 1995 (ISO/IEC 13818-1, MPEG-2 Systems)
Current Version: MPEG-2 Systems Amendment 4 (2018) Status: Active standard for broadcast, Blu-ray, and HLS Evolution: MPEG-2 TS (1995) → DVB/ATSC (1998) → Blu-ray/M2TS (2006) → HLS segments (2009) → ATSC 3.0 (2019) |
| Software Support |
Media Players: VLC, Windows Media Player, PotPlayer, KMPlayer
Web Browsers: Not natively supported Video Editors: Adobe Premiere Pro, VirtualDub, Avidemux, DaVinci Resolve Mobile: Android (VLC, MX Player), iOS (VLC) CLI Tools: FFmpeg, AviSynth, VirtualDub, MEncoder |
Media Players: VLC, mpv, PotPlayer, Kodi
Web Browsers: Via HLS.js (as HLS segments) Video Editors: Adobe Premiere Pro, DaVinci Resolve, Kdenlive Mobile: Android/iOS (via HLS streaming players) CLI Tools: FFmpeg, tstools, DVBInspector, MediaInfo |
Why Convert AVI to TS?
Converting AVI to MPEG Transport Stream (TS) unlocks broadcast-grade capabilities that AVI was never designed to provide. The Transport Stream format was engineered from the ground up for reliable video transmission across unreliable networks — using fixed-length 188-byte packets with built-in error correction and synchronization markers. This makes TS the mandatory format for broadcast television (DVB, ATSC), IPTV networks, and the most widely used adaptive streaming protocol on the internet: Apple's HLS (HTTP Live Streaming).
HLS streaming is arguably the most compelling reason to convert AVI to TS today. HLS uses TS segments as its native delivery format — the video is split into small TS chunks (typically 6-10 seconds each) that a player downloads and plays sequentially. Converting your AVI content to TS is the first step toward building an adaptive bitrate streaming service. Major platforms like Twitch, Apple TV+, and many CDN providers use HLS/TS as their primary delivery mechanism.
Blu-ray authoring is another key use case. The Blu-ray disc specification uses M2TS (MPEG-2 Transport Stream variant) as its container format. To create Blu-ray discs from AVI source material, conversion to TS/M2TS with H.264 video and AC-3 or DTS audio is required. The Transport Stream's packet structure provides the error resilience needed for optical disc playback, where read errors from scratches or dust can interrupt the data stream.
For IPTV and cable television operators, TS is the universal interchange format. Converting AVI content to TS with proper PID (Packet Identifier) assignments, PCR (Program Clock Reference) timing, and PAT/PMT tables enables direct injection into broadcast multiplexing equipment. The Transport Stream's ability to carry multiple programs simultaneously allows efficient bandwidth utilization on broadcast channels and cable systems.
Key Benefits of Converting AVI to TS:
- HLS Streaming: TS is the native segment format for HTTP Live Streaming (most-used protocol)
- Broadcast Standard: Required for DVB, ATSC, and IPTV television delivery
- Error Resilience: 188-byte packets with sync markers survive transmission errors
- Blu-ray Authoring: M2TS variant is the Blu-ray disc container format
- Modern Codecs: Supports H.264 and H.265 for efficient compression
- Multi-Program: Carry multiple video/audio programs in a single transport stream
- Live Streaming: Designed for real-time continuous transmission without file boundaries
Practical Examples
Example 1: Setting Up HLS Streaming from AVI Library
Scenario: A small video-on-demand platform wants to stream their AVI movie library via HLS to support adaptive bitrate playback on iPhones, iPads, and Apple TVs.
Source: documentary_ep01.avi (1.4 GB, 1280x720, Xvid, MP3) Conversion: AVI → TS → HLS segments (multi-bitrate) Result: documentary_ep01/ containing 720p, 480p, and 360p TS segments + master.m3u8 HLS streaming workflow: 1. Convert AVI to H.264 TS at multiple bitrates (720p, 480p, 360p) 2. Segment each bitrate into 10-second TS chunks 3. Generate M3U8 playlist files for each quality level 4. Create master M3U8 with all quality variants 5. Upload segments and playlists to CDN (CloudFront, Fastly) ✓ Adaptive bitrate — quality adjusts to viewer's bandwidth ✓ Native iOS/tvOS/macOS playback via Safari and Apple TV app ✓ Android support via ExoPlayer and HLS.js in browsers ✓ CDN-friendly — each segment is a cacheable static file
Example 2: Creating Blu-ray Disc from HD AVI Footage
Scenario: A wedding videographer delivers final edits as AVI files and the couple wants a professional Blu-ray disc as a keepsake with chapter markers for ceremony, reception, and speeches.
Source: wedding_full_edit.avi (22 GB, 1920x1080, MJPEG, PCM 48kHz) Conversion: AVI → M2TS (Blu-ray compliant H.264 + AC-3) Result: wedding_full_edit.m2ts (8.5 GB, 1920x1080, H.264 [email protected], AC-3 640kbps) Blu-ray authoring workflow: 1. Encode MJPEG to H.264 High Profile Level 4.1 (Blu-ray spec) 2. Convert PCM audio to AC-3 at 640 kbps (5.1 surround or stereo) 3. Mux into M2TS transport stream container 4. Import M2TS into Blu-ray authoring tool (tsMuxeR, multiAVCHD) 5. Add chapter markers: Ceremony (0:00), Vows (0:22), Reception (1:05), Speeches (1:45) ✓ Plays on any Blu-ray player worldwide ✓ Chapter markers for easy navigation to key moments ✓ H.264 High Profile delivers excellent quality at reasonable size ✓ Professional Blu-ray disc as a lasting keepsake
Example 3: IPTV Channel Playout from AVI Content Library
Scenario: A regional IPTV provider needs to convert their programming library from AVI files to MPEG Transport Stream for injection into their multicast IPTV delivery network serving 50,000 subscribers.
Source: local_news_2024-03-15.avi (2.8 GB, 1920x1080, H.264, MP3) Conversion: AVI → TS (broadcast-compliant MPEG-TS with proper PID/PCR) Result: local_news_2024-03-15.ts (2.9 GB, 1920x1080, H.264, AAC) IPTV playout workflow: 1. Re-mux or re-encode AVI to MPEG Transport Stream 2. Assign proper PID values for video (0x100) and audio (0x101) 3. Insert PAT/PMT tables for program identification 4. Set constant bitrate (CBR) for reliable multicast delivery 5. Feed TS into playout server for scheduled multicast streaming ✓ Proper TS structure ensures compatibility with IPTV middleware ✓ CBR encoding prevents multicast buffer overflow issues ✓ PAT/PMT tables allow set-top boxes to identify programs ✓ Error-resilient packets survive UDP multicast packet loss
Frequently Asked Questions (FAQ)
Q: Can I convert AVI to TS without re-encoding?
A: If your AVI contains H.264 video and AAC or AC-3 audio, you can remux to TS losslessly: ffmpeg -i input.avi -c copy -f mpegts output.ts. For DivX/Xvid AVI files, re-encoding is necessary because MPEG Transport Stream does not support MPEG-4 ASP video in standard broadcast profiles. H.264 re-encoding is recommended for all broadcast and HLS use cases regardless.
Q: What is the difference between TS, MTS, and M2TS?
A: All three use the MPEG Transport Stream container. .ts is the generic extension. .mts is used by AVCHD camcorders (Sony, Panasonic) for H.264 video captures. .m2ts is the Blu-ray disc variant with a 4-byte timestamp prefix on each packet (192 bytes total vs 188 for standard TS). For HLS streaming, use .ts. For Blu-ray authoring, use .m2ts. The codecs and transport stream structure are otherwise identical.
Q: How do I create HLS segments from my converted TS file?
A: You can convert AVI directly to HLS segments in one step: ffmpeg -i input.avi -c:v libx264 -crf 23 -c:a aac -f hls -hls_time 10 -hls_list_size 0 output.m3u8. This creates numbered .ts segment files and a .m3u8 playlist. For adaptive bitrate, run this command multiple times at different resolutions/bitrates, then create a master playlist referencing all variant playlists.
Q: Why is my TS file slightly larger than expected?
A: Transport Stream adds approximately 5-10% overhead compared to MP4 due to its 188-byte packet structure, synchronization markers, PAT/PMT tables, and PCR (Program Clock Reference) insertion. This overhead is the trade-off for error resilience — each packet can be independently decoded even if surrounding packets are lost. For file storage, MP4 is more efficient; TS is designed for streaming reliability, not storage efficiency.
Q: Can I use TS files for regular local video playback?
A: Yes, VLC, mpv, PotPlayer, and most modern media players handle TS files correctly. However, seeking (jumping to specific timestamps) may be slightly less accurate than MP4 because TS lacks the moov atom index that MP4 uses for precise seek. For local file playback, MP4 or MKV are generally better choices. Use TS specifically for streaming, broadcast, or Blu-ray workflows where its error resilience provides a tangible benefit.
Q: Is TS the same format used for DVR recordings?
A: Yes. Most DVR (Digital Video Recorder) devices — TiVo, HDHomeRun, Windows Media Center, MythTV — record broadcast television as MPEG Transport Stream files. The DVR captures the TS broadcast signal directly, preserving the original video, audio, and metadata. Converting your AVI files to TS produces files compatible with the same playback infrastructure used for DVR recordings.
Q: How do I make a Blu-ray compliant M2TS from AVI?
A: Blu-ray specification requires H.264 High Profile Level 4.1, AC-3 or DTS audio, and M2TS container. Use: ffmpeg -i input.avi -c:v libx264 -profile:v high -level 4.1 -b:v 20M -c:a ac3 -b:a 640k -f mpegts output.m2ts. Then import the M2TS file into a Blu-ray authoring tool like tsMuxeR or multiAVCHD to create the BDMV directory structure required for disc burning.
Q: Can I concatenate multiple AVI files into a single continuous TS stream?
A: Yes. First convert each AVI to TS with identical encoding settings, then concatenate: ffmpeg -i "concat:part1.ts|part2.ts|part3.ts" -c copy output.ts. TS concatenation is seamless because Transport Stream has no file-level header/trailer structure — packets can be joined directly. This is more reliable than concatenating MP4 files, which requires complex moov atom merging.