简体   繁体   English

ffmpeg 刻录中文字幕(srt)出现错误

[英]ffmpeg burn chinese subtitle(srt) with error

I use ffmpeg to add Chinese subtitles to the video.我用ffmpeg给视频加中文字幕。 and the libass library has been installed.并且已经安装了 libass 库。

I execute the following command and error messages will appear我执行以下命令会出现错误信息

ffmpeg -i video.mp4 -vf "ass=subtitle.srt" -y out.mp4

error message:错误信息:

在此处输入图像描述

And the Chinese subtitles of the output video are unreadable.而且output视频的中文字幕不可读。

在此处输入图像描述

So the question I want to ask is:所以我想问的问题是:

  1. What caused this?这是什么原因造成的?

  2. how to fix?怎么修?

Solved!解决了! Need to install fonts需要安装fonts

Problem finding step:问题发现步骤:

a) find ffmpeg fontconfig a) 找到 ffmpeg 字体配置

cat /opt/ffmpeg/lib/pkgconfig/fontconfig.pc

在此处输入图像描述

b) find fontconfig config file according to the path obtained above b) 根据上面得到的路径找到fontconfig配置文件

cat /opt/ffmpeg/etc/fonts/fonts.conf

在此处输入图像描述

c) Put the required fonts into this folder /usr/share/fonts/truetype c) 把需要的fonts放到这个文件夹/usr/share/fonts/truetype

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM