ffmpeg 烧写 字幕到视频中命令
来源:互联网 发布:源代码如何变成软件 编辑:程序博客网 时间:2024/04/29 00:57
You can burn text subtitles (hardsubs) with one of two filters: subtitles or ass.
subtitles filter
Draw subtitles on top of input video using the libass library. This filter requires ffmpeg to be compiled with --enable-libass. See the subtitles video filter documentation for more details.
If the subtitle is a separate file called subtitle.srt, you can use this command:
ffmpeg -i video.avi -vf subtitles=subtitle.srt out.avi
If the subtitle is embedded in the container video.mkv, you can do this:
ffmpeg -i video.mkv -vf subtitles=video.mkv out.avi
ass filter
Same as the subtitles filter, except that it doesn’t require libavcodec and libavformat to work. This filter requires ffmpeg to be compiled with --enable-libass. On the other hand, it is limited to ASS (Advanced Substation Alpha) subtitles files. See the ass video filter documentation for more details.
ffmpeg -i video.avi -vf "ass=subtitle.ass" out.avi
If your subtitle is in SubRip, MicroDVD or any other supported text subtitles, you have to convert it to ASS before using this filter:
ffmpeg -i subtitle.srt subtitle.ass
Windows users will have to setup font paths to get libass to work
Picture-based subtitles
You can burn "picture-based" subtitles into a movie as well, by using the overlay video filter to overlay the images. For instance, dvdsub is a type of picture-based overlay subtitles. Example of an MKV with dvdsub subtitles in a separate stream:
ffmpeg -i input.mkv -filter_complex "[0:v][0:s]overlay[v]" -map "[v]" -map 0:a <output options> output.mkv
If you have multiple subtitle streams, you can select which one to use by replacing [0:s] with [0:s:0] to select the first subtitle stream or [0:s:1] to select the second subtitle stream, and so on. See also the official documentation; search for "hardcode".
Sometimes adding this filter have a side effect of breaking encoding when input file has multiple audio streams and some of those may have problems; in this case selecting one (or more) of the audio streams should fix the problem:
ffmpeg -i input.ts -filter_complex "[0:v][0:s]overlay[v]" -map "[v]" -map 0:a:0 <output options> output.mkv
- ffmpeg 烧写 字幕到视频中命令
- ffmpeg视频字幕乱码
- php使用ffmpeg向视频中添加文字字幕
- 通过 FFMPEG,将字幕“烧进”MP4视频中
- 使用ffmpeg生成硬字幕视频
- ffmpeg 提取 视频,音频,字幕 方法
- iOS ffmpeg视频合并加字幕
- [FFmpeg] Windows下使用ffmpeg为视频添加字幕
- ffmpeg字幕
- Ffmpeg 处理视频命令
- Ffmpeg 处理视频命令
- ffmpeg命令裁剪视频
- 如何使用 FFmpeg 进行视频转码:字幕
- 使用FFmpeg从视频中截图的命令
- ffmpeg命令: 删除视频中不需要的音频流
- FFmpeg水印和字幕同时一个命令搞定
- ffmpeg音视频分离命令
- FFmpeg静图加视频水印命令
- 高质量CSS
- 【转】Qt5.2.1移植新唐n32905测试 转的一位朋友的过程,基本能够通过。
- Android底部导航中间突起
- 彻底理解webservice SOAP WSDL
- CSS3圆圈旋转的样式
- ffmpeg 烧写 字幕到视频中命令
- SQL Sever MD5加密。
- 【Lua】【1】Lua游戏脚本语言入门之杂码
- iPhone开发入门系列1(iOS8+Swift版)天天打靶APP学习03-06
- iOS应用启动时不占满全屏上下有黑边问题的解决方案
- 视图UIView的frame、bounds与center属性
- 史上最复杂的验证邮件地址的正则表达式
- 二叉树最大深度和最小深度
- hdoj.1288 Hat's Tea【暴力+水题】 2015/08/05