Answer the question
In order to leave comments, you need to log in
How to encode video in ffmpeg to pass over HLS?
I was inspired by this article: https://playerjs.com/docs/ru=mp4hlsencoding
I have a video in mkv in 2k quality, I want to make the quality 360 480 720 1080 2160 for it, and so that they are transmitted by HLS. There are 8 more audio tracks in this video. I got this command
ffmpeg -y -i 1.mkv -map_metadata -1 -map 0:v:0 -map 0:a:0 -map 0:a:1 -map 0:a:2 -map 0:a:3 -map 0:a:4 -map 0:a:5 -map 0:a:6 -map 0:a:7 -vcodec libx264 -pix_fmt yuv420p -vsync 1 -async 1 -color_primaries 1 -color_trc 1 -colorspace 1 -vf scale="'w=if(gt(a,16/9),640,-2):h=if(gt(a,16/9),-2,360)'" -ab 128k -maxrate 800k -bufsize 1200k -bufsize 4200k -acodec aac -ac 2 -ab 128k -f mp4 -movflags +faststart out1.mp4
Answer the question
In order to leave comments, you need to log in
Well, in general, you should get 5 separate qualities, in each - 8 audio tracks and 1 video track, each of its own size and bitrate. Those. take your command and change the bitrate and frame size in it.
At the same time, your command makes an mp4 file, you can make HLS from it using nginx-vod-module, or remake the ffmpeg command like this (-f hls) to immediately get a set of TS segments plus an index M3U8 file.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question