Convert M3U8 to MP4: FFmpeg, VLC and common errors
Save an M3U8 file or URL as MP4. Try FFmpeg stream copy, H.264/AAC re-encoding or VLC, then check access errors, missing audio and playback.
An M3U8 file will not open in your editor, even after renaming it MP4? First check whether the media segments it references are available. These steps use a finished HLS source that you own or have permission to save, and explain how to turn it into a playable file.
Separate the playlist from the media it points to
An M3U8 is usually a text playlist of HLS media segments, not the video itself. It may point to other quality variants or a separate audio playlist. Renaming .m3u8 to .mp4 does not create the missing media data.
For a URL, the playlist and its referenced resources must all be accessible. A local copy also needs its .ts or .m4s segments and initialization files. Keep the folder structure when relative paths are used. This guide uses finished media rather than recording an ongoing live stream.
Try FFmpeg stream copy first
First run ffmpeg -version in a new terminal. If the command is not found, check the installation and executable path. The example selects the first video and first audio, not necessarily the highest quality or preferred language. A video with no audio becomes a silent MP4. Audio-only playlists need a different command; subtitles and remaining tracks are not included.
The -c copy option remuxes without re-encoding. It avoids quality loss from another encode but cannot restore missing segments or make an incompatible codec work in MP4. Replace the input with the actual file path or M3U8 URL. Keep paths containing spaces or query parameters quoted. +faststart moves MP4 metadata to the front to help playback begin. It does not increase the network download speed.
- Open a terminal in the folder where you want to save the output. For a local playlist, prepare a copy with its segments and original folder structure.
- Replace the input with the actual playlist path or URL and choose a new output filename.
- Run the copy command and check that it finishes without errors. A created file still needs a playback check.
ffmpeg -i "input.m3u8" -map 0:v:0 -map "0:a:0?" -c copy -movflags +faststart "output.mp4"Re-encode for compatibility, or use VLC
If the copied MP4 does not play on the intended device, try re-encoding to H.264 video and AAC audio. The command requires FFmpeg with libx264 and AAC encoders. Re-encoding takes time and can change quality and size; write a separate output. This is an ordinary SDR example; HDR-to-SDR tone mapping requires separate settings.
ffmpeg -i "input.m3u8" -map 0:v:0 -map "0:a:0?" -c:v libx264 -crf 20 -preset medium -pix_fmt yuv420p -c:a aac -b:a 128k -movflags +faststart "output-compatible.mp4"VLC offers a graphical alternative. On Windows, the usual route starts at Media → Convert/Save, uses a Network input, then a conversion profile and destination. A profile may be named H.264 + MP3 (MP4); AAC profiles and labels depend on the version. macOS menus differ.
- In VLC, find Media → Convert/Save and its Network tab or network input.
- Enter the M3U8 URL, then choose Convert.
- Check an MP4 conversion profile and set a new .mp4 destination.
- Choose Start, wait for completion and reopen the file. Consult your version’s official help if its interface differs.
Separate access errors, missing segments and missing audio
For 403, check permission and expiry; for 404, check whether the address changed or disappeared. If the playlist opens but a .ts or .m4s fails, inspect that resource and any initialization file. Moving a local folder or saving only the playlist can break these references. Encoder settings cannot replace unavailable media.
If the result is silent, check for an audio stream, a separate audio playlist and the selected track. The first track may not be your preferred language. Use an authorized current address or the official download and respect rights and service terms. Use the service’s supported saving method for DRM or restricted content.
Check mobile options, uploads and the finished file
On a phone, look for an official download or offline feature first. Before using an online converter, check whether it needs the segments as well as the playlist, and whether it sends files or URLs to an external server. Read its handling and retention terms before supplying private footage or authenticated links.
Play the beginning, middle and end of the MP4 in the intended player; compare sound and duration. An ongoing live playlist may not finish automatically without an end marker, and earlier removed segments cannot be recovered by this command. Prefer a finished VOD or official saved file. The demonstration below uses our own short, finished HLS example.
ffprobe -v error -show_entries format=duration:stream=codec_type,codec_name,width,height -of json "output.mp4"After creating the MP4, compare its duration with the source and play the beginning, middle and end with sound. Share the checked output, and keep the original playlist and segments until you have finished checking it.
Tools
Sources
Based on public documentation; not a full functional or security audit.