Open daominhsangvn opened 6 years ago
Did you try to pass the subtitle as an input?
ffmpeg -i video.mp4 -i subtitle.srt -c copy -c:s webvtt -start_number 0 -hls_time 10 -hls_list_size 0 -f hls out/index.m3u8
@xedsvg your cmd works in cmd but how to pass vtt file to this package? any example
@karimkhamwani what do you mean? It should be the same example as above. You just replace subtitle.srt with your subtitle.vtt. Can you post your code so we can understand what do you mean?
@karimkhamwani can you tell us if this solution works? and put some final example.
Did you try to pass the subtitle as an input?
ffmpeg -i video.mp4 -i subtitle.srt -c copy -c:s webvtt -start_number 0 -hls_time 10 -hls_list_size 0 -f hls out/index.m3u8
it does not work for me
command:
ffmpeg -i sample_video_transcript.srt -i sample_video.mp4 \
-c:v copy -c:a copy -c:s webvtt \
-f hls \
-hls_time 6 -hls_list_size 0 -hls_allow_cache 1 -start_number 1 \
-master_pl_name master.m3u8 output/index.m3u8
output master.m3u8
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=1217707,RESOLUTION=720x1280
index.m3u8
missing line in master.m3u8
...
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English",DEFAULT=YES,AUTOSELECT=YES,FORCED=NO,LANGUAGE="en",URI="0/index_vtt.m3u8"
...
Version information
Example Code
Above code is working good, it generated various
ts
files for streaming. But i dont know how to add WebVTT subtitle into them3u8
playlist. Something like this in theplaylist.m3u8
: