The windows batch scripts that generate m3u8 playlists from h264 mp4 video for Apple HLS, using ffmpeg.
You can download it from ffmpeg.org, or here is a direct link to the latest release in .7z compressed file.
Just uncompressed the 7z or zip you've got and copy the folder including all files to a clear location like c:\ffmpeg\
Windows 10:
- Just type
advanced system settings
in your task bar search, open it. - Goto tab "Advanced", go straight down to "Environment Variables"
- Find "Path" in the top "User variables for [username]", double click the "Path" line.
- Click "New" and input your ffmpeg path including the bin folder. For example:
C:\ffmpeg\bin
. - Then click OK all the way down to save your change.
Windows 7:
- You can find the "Advanced system settings" by right click "Computer" on your star menu or explorer and click
Properties
. - Goto tab "Advanced", go straight down to "Environment Variables"
- Find "Path" in the top "User variables for [username]", double click the value of "Path" line.
- Move your cursor to the end of the value of "path", Don't delete anything what's already in there.
- Add your ffmpeg path start with a semicolon, like
....xxx;C:\ffmpeg\bin
- Click OK to save your change.
- Open CMD (Commend Prompt)
- Type
ffmpeg
and Enter - If the cmd didn't say it's an unknown command, you are good to go.
- Download and place the script to the same folder as your original video file.
- Drag your video file directly to the batch script.
- The CMD window will show you the progress, wait until it's done.
- If an error occurred, try to encode the video to H264 first.
The script will create a folder named "media" in the very same folder, structured as below
- media
- [the original video file name]
- hls
- [the original video file name].m3u8 The overall playlist
- 1080_out.m3u8 The 1080p video playlist
- 720_out.m3u8 The 720p video playlist
- 480_out.m3u8 The 480p video playlist
- 360_out.m3u8 The 360p video playlist
- 1080_out1.ts The 1080p splitted videos
- 1080_out2.ts
- ..
- 720_out1.ts The 720p splitted videos
- 720_out2.ts
- ..
- 480_out1.ts The 480p splitted videos
- 480_out2.ts
- ..
- 360_out1.ts The 360p splitted videos
- 360_out2.ts
- ..
- cover_h1.jpg The 1080p screenshots from the video
- cover_l1.jpg The 720p-ish screenshots from the video
- preview.gif The animated gif generated from the video
- hls
- [the original video file name]
The machine-generated covers and preview image may not be correct.
There is no term of use for this, you can download, edit, use and distribute this script for personal or commercial purpose freely.