我正在使用ffmpeg_kit_flutter并在视频上应用drawtext过滤器,但我收到错误No such filter: 'drawtext'
输入视频链路为input.mp4
这个命令有效吗
ffmpeg -y -i input.mp4 -filter_complex '[0]scale=540:-1[s];[s]drawtext=text='your_text_here':fontsize=24:fontcolor=white:x=(w-text_w)/2:y=(h-text_h)/2' output.mp4
字符串
代码示例如下
/// Create Video With Text
Future<void> createVideoWithText() async {
final file = File('${(await getTemporaryDirectory()).path}/output.mp4');
String outPut = file.path;
String command = "-y -i $inputFilePath -filter_complex '[0]scale=540:-1[s];[s]drawtext=text='MY_TEXT':fontsize=24:fontcolor=white:x=(w-text_w)/2:y=(h-text_h)/2' $outPut";
FFmpegKit.executeAsync(
command,
(session) async {
final returnCode = await session.getReturnCode();
if (ReturnCode.isSuccess(returnCode)) {
print('Success full add text on video');
}else{print('Error to adding text on video');}
},
);
}
型
1条答案
按热度按时间z0qdvdin1#
我用the full version解决了这个问题
字符串
而不是
ffmpeg_kit_flutter
另外,我认为你不需要引用你的文字:
型
=>
型