Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FFMPEG] command optimization #540

Open
gbrn opened this issue Sep 5, 2024 · 0 comments
Open

[FFMPEG] command optimization #540

gbrn opened this issue Sep 5, 2024 · 0 comments

Comments

@gbrn
Copy link

gbrn commented Sep 5, 2024

@DanielnetoDotCom Danny, analyzing the ffmpeg HLS command in the encoder, I found that some commands can be inserted to optimize. I ask that you take into consideration and test the following commands:

[30] Dynamic HLS:
-c:v h264 -vf scale=-2:{$resolution} -r 24 -g 48 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -minrate {$minrate}k -crf 23 -maxrate {$maxrate}k -bufsize {$bufsize}k -c:a aac -b:a {$audioBitrate}k -f hls -hls_time 6 -hls_list_size 0 -hls_key_info_file {$destinationFile}keyinfo {$destinationFile}res{$resolution}/index.m3u8

.
Use -movflags +faststart (If HLS is for VOD)
If you are creating HLS files for video on demand (VOD), it may be useful to enable +faststart. This moves the video file's metadata to the beginning, which speeds up the start of playback when the file is progressively downloaded.

-movflags +faststart

.
Improve HLS Segmentation
The current segmentation value (-hls_time 6) is set to 6 seconds, which is a good practice in terms of latency for live streaming. However, depending on the network or target device, adjustments can be made:
Add -hls_playlist_type vod: Specify vod (Video on Demand), which can improve how players process the playlist:
-hls_playlist_type vod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant