ffmpeg提取视频字幕

2020年08月11日

在对一些视频进行编辑的时候,例如mkv格式的视频,我们有时候需要提取它内置的字幕,可以用下面的这个方法,先将字幕提取出来,然后保存为srt或ass文件。

提取字幕流
1)原始文本输出
ffmpeg -i test.mkv -an -vn -bsf:s mov2textsub -scodec copy -f rawvideo sub.txt
ffmpeg -i test.mkv -an -vn -c:s copy -f rawvideo -map 0:s sub2.txt
ffmpeg -i test.mkv -map 0:s:0 sub1.srt
2)ass格式输出
ffmpeg -i test.mkv -an -vn -scodec copy sub3.ass

 


sicnature ---------------------------------------------------------------------
I P 地 址: 3.129.249.105
区 域 位 置: 美国
系 统 信 息: 美国
Original content, please indicate the source:
同福客栈论坛 | 蟒蛇科普海南乡情论坛 | JiaYu Blog
sicnature ---------------------------------------------------------------------
Welcome to reprint. Please indicate the source https://myzhenai.com.cn/post/3546.html

没有评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注