【发布时间】:2017-12-13 07:39:21
【问题描述】:
我正在尝试在视频上添加文本和时间戳,但无法在其上打印简单的文本。
String[] complexCommand = {"-f", "3gp", "-i", videoPath, "-s", height + "x" + width, "-r",
"17", "drawtext=fontfile='file://android_asset/font_eight.ttf':fontsize=20:text='test':x=10:y=100",
"-vcodec", "libx264", "-vb", "2000k", "-preset", "fast", "-f", "3gp", dir.getAbsolutePath() + "/out.3gp"};
ffmpeg -f 3gp -i /storage/emulated/0/DCIM/Camera/VID_20171211_105946.3gp -s 1920x1080
-r 17 drawtext='fontfile=file://android_asset/font_eight.ttf:fontsize=20:text=test:x=10:y=100
-vcodec libx264 -vb 2000k -preset fast -f 3gp /storage/emulated/0/Pictures/Video/out.3gp
-- 已编辑的问题 ---
错误:
Fontconfig 错误:无法加载默认配置文件
[Parsed_drawtext_0 @ 0xf5ba0730] 无法初始化字体配置
[AVFilterGraph @ 0xf5b89040] 使用参数“fontfile=file://android_asset/font_eight.ttf:fontsize=32:text=test:fontcolor=white:x=0:y=0”初始化过滤器“drawtext”时出错
打开过滤器时出错!
相同的命令在 Windows 上运行没有错误,但是当我将它转换为移动设备并测试得到字体路径错误时。
【问题讨论】:
标签: android video ffmpeg video-processing