Giter VIP home page Giter VIP logo

mp4-to-m3u8-ts-hls-video's Introduction

mp4 to m3u8 ts hls video

The windows batch scripts that generate m3u8 playlists from h264 mp4 video for Apple HLS, using ffmpeg.

Dependency and preparation

ffmpeg

1 Download ffmpeg for windows.

You can download it from ffmpeg.org, or here is a direct link to the latest release in .7z compressed file.

2 Install (copy) the ffmpge to your PC.

Just uncompressed the 7z or zip you've got and copy the folder including all files to a clear location like c:\ffmpeg\

3 Add your ffmpeg path to system environment variables

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.

4 verify ffmpeg works

  • Open CMD (Commend Prompt)
  • Type ffmpeg and Enter
  • If the cmd didn't say it's an unknown command, you are good to go.

How to use

  1. Download and place the script to the same folder as your original video file.
  2. Drag your video file directly to the batch script.
  3. The CMD window will show you the progress, wait until it's done.
  4. If an error occurred, try to encode the video to H264 first.

The result

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

The machine-generated covers and preview image may not be correct.

Term of use

There is no term of use for this, you can download, edit, use and distribute this script for personal or commercial purpose freely.

mp4-to-m3u8-ts-hls-video's People

Contributors

yduke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.