没有这样的过滤器:"drawtext" [英] No such filter: 'drawtext'
问题描述
我的主要目标是收集用户输入并将其转换为具有黑色背景的视频,然后在视频在后台播放音频的同时,输入文本将从左向右移动.
My main objective is to collect user inputs and convert it to a video with black background, then the input text will be moving from left to right while the video is playing with audio in the background.
目前建议我使用"drawtext",但我发现它不起作用.
Currently I was suggested to use "drawtext" but i have not find it working.
我的命令:
ffmpeg -i test.mp4 -vf "drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf:textfile=text.txt:reload=1:y=h-line_h-10:x=(W/tw)*n" textover7.mpg -report
ffmpeg version git-2017-12-28-be4dfbf Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-18)
configuration: --prefix=/usr/local/ffmpeg --extra-cflags=-I/usr/local/ffmpeg/include --extra-ldflags=-L/usr/local/ffmpeg/lib --bindir=/usr/local/bin --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libx264 --enable-libtheora --enable-filter=drawtext
libavutil 56. 7.100 / 56. 7.100
libavcodec 58. 9.100 / 58. 9.100
libavformat 58. 3.100 / 58. 3.100
libavdevice 58. 0.100 / 58. 0.100
libavfilter 7. 8.100 / 7. 8.100
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2014-01-19T03:12:30.000000Z
Duration: 00:07:15.00, start: 0.000000, bitrate: 201 kb/s
Stream #0:0(und), 8, 1/30: Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360, 103 kb/s, 15 fps, 15 tbr, 30 tbn, 30 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und), 1, 1/44100: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 96 kb/s (default)
Metadata:
creation_time : 2014-01-19T03:12:31.000000Z
handler_name : IsoMedia File Produced by Google, 5-11-2011
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mpeg1video (native))
Stream #0:1 -> #0:1 (aac (native) -> mp2 (native))
Press [q] to stop, [?] for help
[AVFilterGraph @ 0x466e4c0] No such filter: 'drawtext'
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!
推荐答案
Your ffmpeg
does not support the drawtext filter. It is missing the configure option --enable-libfreetype
which is required for this filter.
使用此选项或者编译ffmpeg
,或者仅
Either compile ffmpeg
with this option, or just download an already compiled ffmpeg
build. Of course you will then have to ensure that your script is executing your new ffmpeg
.
这篇关于没有这样的过滤器:"drawtext"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!