https://github.com/vincentbernat/video2hls
Prepare a video to be streamed with HLS
https://github.com/vincentbernat/video2hls
hls transcoding video
Last synced: 9 months ago
JSON representation
Prepare a video to be streamed with HLS
- Host: GitHub
- URL: https://github.com/vincentbernat/video2hls
- Owner: vincentbernat
- License: isc
- Created: 2018-01-22T20:39:39.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2025-02-14T03:46:36.000Z (11 months ago)
- Last Synced: 2025-04-09T18:17:17.535Z (9 months ago)
- Topics: hls, transcoding, video
- Language: Python
- Size: 107 KB
- Stars: 196
- Watchers: 6
- Forks: 28
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# video2hls
A simple tool to convert a video to a set of files to play it using
HLS. HLS is an adaptive bitrate streaming protocol: the video is
sliced in small chunks and made available at a variety of different
bit rates. Depending on current network conditions, the player
automatically selects the appropriate bitrate to download the next
segment.
The script needs Python 3.6 and you can run it with `--help` to get
more information about it.
Some browsers may not support natively HLS. In this case, one can use
[hls.js][] to get appropriate support. Many video players also support
this format. See this [blog post][] for more information.
[hls.js]: https://github.com/video-dev/hls.js/
[blog post]: https://vincent.bernat.ch/en/blog/2018-self-hosted-videos
## Examples
Convert using default parameters (MPEG2-TS with many resolutions):
./video2hls TearsOfSteel.mp4
Add an overlay to distinguish the different resolutions:
./video2hls --mp4-overlay '{resolution}p, progressive' --video-overlay '{resolution}p, HLS' \
TearsOfSteel.mp4
Use fragmented MP4:
./video2hls --hls-type fmp4 TearsOfSteel.mp4
Specify more bitrates:
./video2hls --video-bitrates 8000 4000 2000 1000 \
--video-widths 1920 1920 1280 854 \
--video-names '1080p high' '1080p low'
TearsOfSteel.mp4
When using `--debug`, you'll get a detailed explanation of the
executed commands (and you can copy/paste them):
./video2hls --debug TearsOfSteel.mp4