# 各个容器可以容纳的字幕格式不同:
text:
mkv: copy, srt, ssa, ass
mp4/mov: copy, mov_text
bitmap:
ts: dvb_subtitle
vob: dvd_subtitle (closed caption)
# ffplay 显示字幕
-sst 只能显示bitmap类;
使用filter来显示text类[gcw]:
#检查是否配置了--enable-libass --enable-libfreetype
如果不是UTF-8,还要加上 --enable-iconv
#使用独立的字幕文件
export FONTCONFIG_FILE=/usr/local/etc/fonts/fonts.conf
ffplay -vf subtitles=sub.srt:1x1 infile
其他关于字体属性的应该可以参考doc/filters.texi:drawtext,没试过。
#使用自带的第0个字幕流
#ffprobe infile -print_format ini -show_streams 2>/dev/null |grep "streams.stream\|codec_type\|codec_name"
ffplay -vf subtitles=infile:si=0 infile
# ffmpeg 转换
ffmpg只能把同一类的相互转换;
bitmap to text: ccextractor infile [ccextractor]依赖tesseract-ocr /leptonica
# 测试文件
取
text:
mkv: copy, srt, ssa, ass
mp4/mov: copy, mov_text
bitmap:
ts: dvb_subtitle
vob: dvd_subtitle (closed caption)
# ffplay 显示字幕
-sst 只能显示bitmap类;
使用filter来显示text类[gcw]:
#检查是否配置了--enable-libass --enable-libfreetype
如果不是UTF-8,还要加上 --enable-iconv
#使用独立的字幕文件
export FONTCONFIG_FILE=/usr/local/etc/fonts/fonts.conf
ffplay -vf subtitles=sub.srt:1x1 infile
其他关于字体属性的应该可以参考doc/filters.texi:drawtext,没试过。
#使用自带的第0个字幕流
#ffprobe infile -print_format ini -show_streams 2>/dev/null |grep "streams.stream\|codec_type\|codec_name"
ffplay -vf subtitles=infile:si=0 infile
# ffmpeg 转换
ffmpg只能把同一类的相互转换;
bitmap to text: ccextractor infile [ccextractor]依赖tesseract-ocr /leptonica
# 测试文件
取