HTML5视频播放器可以使用buildin mov_text
MP4字幕吗?
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.66.102
Duration: 01:28:55.00, start: 0.000000, bitrate: 908 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 704x400 [SAR 1:1 DAR 44:25], 772 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream #0:2(rus): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default)
Metadata:
handler_name : SubtitleHandler
Stream #0:3(eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
Metadata:
handler_name : SubtitleHandler
答案 0 :(得分:3)
将字幕提取为WebVTT:
ffmpeg -i input.mp4 -map 0:s:0 subs_rus.vtt -map 0:s:1 subs_eng.vtt
将字幕添加到HTML5 <video>
元素:
<track src="subs_rus.vtt" kind="subtitles" srclang="ru" label="русский">
<track src="subs_eng.vtt" kind="subtitles" srclang="en" label="English">