25

Can an M3U8 video file be converted to MP4? I have had no luck finding a file converter that can do this since the M3U8 file is really an Audio playlist with many smaller files in a folder.

8 Answers8

33

You can use ffmpeg to do this.

Here is an example:

ffmpeg -i "http://host/folder/file.m3u8" -bsf:a aac_adtstoasc -c copy file.mp4
John E
  • 431
5

M3U is a playlist file as previously mentioned. Use VLC player to open them and then use the wizard (File → Streaming/Transcoding Wizard) to convert/transcode.

If you open the M3U in Notepad you will see the URL of where the file is actually stored.

3

You can also use youtube-dl to download your video from a m3u8 url, example :

$ youtube-dl --hls-prefer-native "http://host/folder/file.m3u8"
[generic] playlist: Requesting header
[generic] playlist: Downloading m3u8 information
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 275
[download] Destination: file-file.mp4
[download] 100% of 123.19MiB in 01:02
[ffmpeg] Fixing malformed AAC bitstream in "file-file.mp4"

To install/update youtube-dl, you need to type :

$ sudo -H $(which pip3) install -U youtube-dl
[sudo] password for xyztabcd:              
Requirement already up-to-date: youtube-dl in /usr/local/miniconda3/lib/python3.6/site-packages (2019.4.7)
SebMa
  • 2,035
1

As @Daniel B pointed out, M3U is a playlist format. It is a very small file that contains links to the actual media. M3U8 is the Unicode version of it, which means that it supports links with letters and symbols from any language.

Since it is a plain text file, you can open it with Notepad or other simple text editor and try to copy the links from it, and then download each video manually with your browser.

If it isn't a direct HTTP(S) link to the video, but a streaming technology like RTMP, you may need to download a special program to record it. For example, this is used to save RTMP streams.

1

I downloaded video file xxxx-ad .m3u8 recently and I tried to solved the same problem (downloaded with Apowersoft from online stream). The file was only 201b big and it needed internet connection to play.

I used formatfactory. I was unable to open this file with FF at first. You can not use open button.

But if you point and click on file and move it to FF window, it allows you to add it, choose format and rip it. Result is classical video file that can be played offline. Same works if you want only audio file like mp3.

enjoy

0

At least in recent versions of Internet Download Manager, you should get a .ts file rather than .m3u8 (unless you copy an .m3u8 link and try adding that as a download manually, as it supports downloading HLS (.m3u8) streams properly. You can play that file directly in some players. If you want an .mp4 file, you can use a tool like MyMP4BoxGUI, or FFmpeg:

ffmpeg -i "file.ts" -c copy -bsf:a aac_adtstoasc "file.mp4"
0

Rename m3u8 to .txt, look at the filename/path the playlist points to. Find the file on your system, download it to your system if it's a network. Open this file in iTunes, iCloud and transfer the file to iPhone using iTunes/iCloud.

If it doesn't convert the file, download AnyVideo converter or use ffmpeg/vlc or another program of your choice on the file then try transferring that file.

-2

Changing the extension worked for me.
I downloaded a movie using internet download manager in .m3u8 format changed the extension to .mp4
POOF computer science at work - I was able to play the file.

Journeyman Geek
  • 133,878