I have a video (video.mp4) and a subtitle file (subtitle.srt).
I'm trying to use FFmpeg to generate a VoD HLS playlist with 3 different resolutions for the video; and I also want the subtitle file to turn into segmented .vtt files.
I've tried the following command, but it doesn't work, it gives me a "Conversion failed!" message without any further information:
ffmpeg -i video.mp4 -i subtitle.srt \
-preset slow -g 60 -sc_threshold 0 \
-map 0 -map 0 -map 0 -map 1 \
-s:v:0 640x360 -c:v:0 h264 -b:v:0 500k \
-s:v:1 854x480 -c:v:1 h264 -b:v:1 1000k \
-s:v:2 1280x720 -c:v:2 h264 -b:v:2 2000K \
-c:a copy -c:s webvtt \
-f hls -hls_playlist_type vod -var_stream_map "v:0,a:0 v:1,a:1 v:2,a:2" \
-master_pl_name master.m3u8 -hls_time 6 -hls_list_size 0 -hls_allow_cache 1 -start_number 1 \
-hls_segment_filename "output/hls/%v/seg-%d.ts" output/hls/%v/index.m3u8
I'm struggling to find any useful information in FFmpeg docs or anywhere else regarding how subtitles can be added to an HLS playlist. What should the command be like exactly? What am I missing in mine?