CGJU
CGJU
July 3, 2026 · 4 min read

Introduction: What is M3U8?

M3U8 is the core file format of the HLS (HTTP Live Streaming) streaming media protocol. It is essentially a UTF-8 encoded playlist file used to describe video segmentation information. A complete HLS video typically consists of one M3U8 playlist file and multiple TS segment files.

In practice, we often need to convert M3U8 videos to the more universal MP4 format for playback, storage, or editing on various devices. This article will detail several common methods for M3U8 to MP4 conversion to help you choose the approach that best suits your needs.

Method 1: Online Tool Conversion (Recommended for Beginners)

If you only need occasional conversions and don't want to download or install any software, using an online conversion tool is the best choice.

Advantages of Online Tools

  • No installation required: Works directly in your browser, takes up no local storage
  • Easy to use: Usually just enter the M3U8 link and click convert
  • Cross-platform: Works on Windows, Mac, Linux, and mobile devices
  • Free: Most online tools are free to use

Steps for Using Online Conversion Tools

  1. Open the M3U8 to MP4 Online Tool
  2. Paste your M3U8 link into the input field
  3. Click the "Start Conversion" button and wait for processing to complete
  4. After conversion, click the download button to save the MP4 file
💡 Tip: We recommend choosing online tools that process files locally in the browser — this way your video files are never uploaded to a server, ensuring greater security and privacy.

Method 2: Using FFmpeg Command Line (Suitable for Developers)

FFmpeg is a powerful open-source audio and video processing tool that supports nearly all audio and video format conversions, and is also a great tool for handling M3U8. If you are familiar with command-line operations, this is the most flexible and efficient method.

Basic Conversion Command

The simplest M3U8 to MP4 command:

ffmpeg -i "https://example.com/stream.m3u8" -c copy output.mp4

This command uses the -c copy parameter for lossless remuxing — it directly copies the audio and video data from the TS segments into the MP4 container, making it very fast with no quality loss.

Processing Local M3U8 Files

If both the M3U8 file and TS segments are stored locally, you can process them like this:

ffmpeg -i "local/playlist.m3u8" -c copy output.mp4

Processing Encrypted M3U8

If the M3U8 uses AES-128 encryption, you need to provide the decryption key:

ffmpeg -i "https://example.com/encrypted.m3u8" \
  -decryption_key "your_key_here" \
  -c copy output.mp4

Common Parameter Reference

  • -c copy: Lossless remuxing, no re-encoding
  • -c:v libx264: Re-encode video using H.264
  • -c:a aac: Re-encode audio using AAC
  • -b:v 2M: Set video bitrate to 2Mbps
  • -s 1280x720: Set output resolution to 720p

Method 3: Local TS Segment Merging

If you have already downloaded all TS segment files to your local machine, you can merge these files directly.

Using TS File Merger Tool

Our TS File Batch Merger Tool can help you quickly merge local TS files:

  1. Open the TS merger tool page
  2. Select all TS files you want to merge (supports batch selection)
  3. The tool automatically sorts by filename
  4. Click the "Start Merge" button
  5. Download the MP4 file after merging is complete

Using Command Line to Merge

On Windows, you can use the copy command:

copy /b *.ts output.ts

On Mac/Linux, you can use the cat command:

cat *.ts > output.ts

After merging, use FFmpeg to remux to MP4:

ffmpeg -i output.ts -c copy output.mp4

Method 4: Using Player Recording

Some video players themselves support recording and saving streaming media being played as local files.

VLC Media Player

VLC is a powerful open-source player that also supports M3U8 playback and recording:

  1. Open VLC Player
  2. Click "Media" → "Open Network Stream"
  3. Enter the M3U8 link and click Play
  4. After playback starts, click "Playback" → "Record"
  5. After finishing the video, click Record again to stop
  6. The recorded file will be saved in the default video directory

Common Issues and Solutions

1. Black or Garbled Screen After Conversion

Cause: The video codec format may be incompatible, or segment files may be corrupted.

Solutions:

  • Try re-encoding instead of direct copy: ffmpeg -i input.m3u8 -c:v libx264 -c:a aac output.mp4
  • Check whether TS segment files are complete
  • Try using a different conversion tool

2. Conversion Speed is Too Slow

Cause: If using re-encoding, speed will inevitably be slower; poor network conditions can also affect download speed.

Solutions:

  • Prefer lossless remuxing (-c copy) for the fastest speed
  • Ensure a stable network connection
  • Choose a lower quality version for conversion

3. Only Audio, No Video

Cause: The video codec format is not supported by the MP4 container, or the player doesn't support that codec.

Solutions:

  • Re-encode the video using H.264: ffmpeg -i input.m3u8 -c:v libx264 -c:a copy output.mp4
  • Try playing with a different player

4. M3U8 Link is Inaccessible

Cause: The link may have expired, requires login authentication, or has CORS restrictions.

Solutions:

  • Verify whether the M3U8 link is valid
  • Check if cookies or Referer are required
  • Download M3U8 and TS files locally first, then convert

How to Choose the Right Method?

Choose by Use Case

  • Casual users / occasional use: Recommended to use the online conversion tool, simple and convenient
  • Some technical background: Recommended to use FFmpeg command line, powerful features
  • Already have local TS files: Use the TS merger tool directly
  • Need to watch and record simultaneously: Use VLC Player's recording feature

Conversion Quality Comparison

No matter which method you use, as long as you employ lossless remuxing (no re-encoding), there will be no loss of video quality. If re-encoding is necessary, we recommend setting an appropriate bitrate to maintain video quality.

Legal Considerations

When converting M3U8 to MP4, please note the following:

  • Ensure you have the right to use and convert the video content
  • Do not use for commercial purposes
  • Respect copyright — do not distribute copyrighted content
  • For personal learning and research purposes only

Summary

M3U8 to MP4 conversion is a common requirement that can be achieved through various methods. For most users, using an online conversion tool is the most convenient and quick choice; for developers or users with batch processing needs, FFmpeg is a more flexible and powerful tool.

If you want to quickly try M3U8 to MP4 conversion, try our free online M3U8 to MP4 tool — browser-local processing, safe and fast!

Related Recommendations

More great articles and useful tools

Convert Your M3U8 Videos Now

Free online M3U8 to MP4 tool — browser-local processing, safe and fast, no registration required

Convert Now ➡