How to use Docker FFMPEG and HLS on my website

Koloss42

Dabbler
Joined
Aug 21, 2023
Messages
21
I want to use a Docker container to convert an mkv video to an HLS "video". This is my command for it:

docker run --rm \
-v /mnt:/config \
linuxserver/ffmpeg \
-i "/config/test.mkv" \
-c:v copy \
-c:a copy \
-sn \
-f hls \
-hls_list_size 0 \
/config/hls/output.m3u8

when i run this command everything is created correctly, with VLC i can use the m3u8 file only Video.js says "The media could not be loaded, either because the server or network failed or because the format is not supported". I have also set the audio codec and video codec to AAC and 264 for testing but it didn't work any better. Ich nutze Video.js und wenn ich auf einem anderen Rechner wo ich kein docker nutzen muss geht m3u8 im web aber nicht bei vlc mit diesem befehl.

ffmpeg -i input.mkv -c:v h264 -master_pl_name master.m3u8 -hls_time 10 -hls_list_size 0 -f hls -map 0 -c:a aac -b:a 128k -strict -2 -vf "subtitles=input.mkv" -map a -map v -map s -var_stream_map "a:0,v:0,s:0 a:1,v:1 s:1" test/stream_%v.m3u8

you do not need to take into account the directories that I have changed.
 
Top