-
Notifications
You must be signed in to change notification settings - Fork 988
VideoHLS Plugin
HTTP Live Streaming (also known as HLS) is an HTTP-based adaptive bitrate streaming communications protocol implemented by Apple Inc. as part of its QuickTime, Safari, OS X, and iOS software. Client implementations are also available in Microsoft Edge, Firefox and some versions of Google Chrome. Support is widespread in streaming media servers.
Got it from https://en.wikipedia.org/wiki/HTTP_Live_Streaming
- This plugin will unlock the HLS option on the encoder.
- The resolution switch plugin is useless, this format will automatically switch resolution based on your current connection/bandwidth.
- The files are encrypted
- This format is a lot harder do download (not impossible but a lot harder), so you will not be able to use the download button anymore.
- You will not be able to use this format with AWS_S3 plugin or BlackBlaze_B2 plugin or FTP_Storage, but the good news is, you can use the plugin YPTStorage so save your files and expand your drives
We have 2 ways to encode HLS videos:
- using the predefined FFMPEG command
- using the automatic encoding process
The command predefined is pasted below, it encodes any type of video in 3 resolutions: 360, 540, and 720.
ffmpeg -re -i {$pathFileName} -c:a aac -b:a 128k -c:v libx264 -vf scale=-2:360 -g 48 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 800k -maxrate 856k -bufsize 1200k -b:a 96k -f hls -hls_time 15 -hls_list_size 0 -hls_key_info_file {$destinationFile}keyinfo {$destinationFile}low/index.m3u8 -c:a aac -b:a 128k -c:v libx264 -vf scale=-2:540 -g 48 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 1400k -maxrate 1498k -bufsize 2100k -b:a 128k -f hls -hls_time 15 -hls_list_size 0 -hls_key_info_file {$destinationFile}keyinfo {$destinationFile}sd/index.m3u8 -c:a aac -b:a 128k -c:v libx264 -vf scale=-2:720 -g 48 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 2800k -maxrate 2996k -bufsize 4200k -b:a 128k -f hls -hls_time 15 -hls_list_size 0 -hls_key_info_file {$destinationFile}keyinfo {$destinationFile}hd/index.m3u8
To activate the automatic encode process you need to delete the predefined FFMPEG command. you can find this command on the Encoder configurations.
With the automatic HLS encoding activated, we will automatically convert the video to the following resolutions.
- 2160p
- 1440p
- 1080p
- 720p
- 480p
- 360p
- 240p
But, to make sure we will not waste disk space and bandwidth we will examine the file source, before encoding, and we will not upconvert the video.
for example, if you upload a 720p video, we will only convert it into 720p, 480p, 360p, and 240p so it will guarantee the best experience for your users. even a slower connection will be able to play a 240p video and also we will not waste your resources.