gpt4 book ai didi

linux - ffmpeg 没有这样的过滤器 : 'palettegen' in linux

转载 作者:太空狗 更新时间:2023-10-29 12:42:14 25 4
gpt4 key购买 nike

1.

my system 
uname -a
Linux localhost.localdomain 2.6.32-220.el6.x86_64 #1 SMP Tue Dec 6 19:48:22 GMT 2011 x86_64 x86_64 x86_64 GNU/Linux

2.ffmpeg下载自 http://johnvansickle.com/ffmpeg/

3.我下载了ffmpeg-release-64bit-static.tar.xz,解压这个文件,然后运行:./ffmpeg然后安装了 ffmpeg。我使用以下方法检查它:ffmpeg -version
没问题。

我在我的系统中运行这些命令没有问题:

cd /home/web/tomcat-6.0.29/zhouletest/ffmpeg-3.1.1-64bit-static 

./ffmpeg -y -ss 10 -t 3 -i /home/web/tomcat-6.0.29/zhouletest/videos/6.mp4 -vf fps=10,scale=177:-1:flags=lanczos,palettegen /home/web/tomcat-6.0.29/zhouletest/gif_images/palettegens/6.png

./ffmpeg -y -ss 10 -t 3 -i /home/web/tomcat-6.0.29/zhouletest/videos/6.mp4 -i /home/web/tomcat-6.0.29/zhouletest/gif_images/palettegens/6.png -filter_complex "fps=10,scale=177:-1:flags=lanczos[x];[x][1:v]paletteuse" /home/web/tomcat-6.0.29/zhouletest/gif_images/6.gif

但是当我在 java 中调用这个命令时,发生了错误,为什么?

String cmd1 = "/home/web/tomcat-6.0.29/zhouletest/ffmpeg -y -ss 10 -t 3 -i /home/web/tomcat-6.0.29/zhouletest/videos/6.mp4 -vf fps=10,scale=177:-1:flags=lanczos,palettegen /home/web/tomcat-6.0.29/zhouletest/gif_images/palettegens/6.png";
String cmd2 = "/home/web/tomcat-6.0.29/zhouletest/ffmpeg-3.1.1-64bit-static/ffmpeg -y -ss 10 -t 3 -i /home/web/tomcat-6.0.29/zhouletest/videos/6.mp4 -i /home/web/tomcat-6.0.29/zhouletest/gif_images/palettegens/6.png -filter_complex \"fps=10,scale=177:-1:flags=lanczos[x];[x][1:v]paletteuse\" /home/web/tomcat-6.0.29/zhouletest/gif_images/6.gif";

String result1 = executeCommand(cmd1);
String result2 = executeCommand(cmd2);

private static String executeCommand(String command) {
StringBuffer output = new StringBuffer();
Process p;
try {
p = Runtime.getRuntime().exec(command);
p.waitFor();
BufferedReader reader = new BufferedReader(new InputStreamReader(p.getErrorStream()));

String line = "";
while ((line = reader.readLine())!= null) {
output.append(line + "\n");
}

} catch (Exception e) {
e.printStackTrace();
}
return output.toString();
}

错误:

result1:
result2:ffmpeg version 3.1.1-static http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (Debian 5.4.0-4) 20160609
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --enable-librtmp --enable-libmfx --enable-libzimg --cc=gcc
libavutil 55. 28.100 / 55. 28.100
libavcodec 57. 48.101 / 57. 48.101
libavformat 57. 41.100 / 57. 41.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter
6. 47.100 / 6. 47.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc
54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/web/tomcat-6.0.29/zhouletest/videos/6.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.40.101
Duration: 00:04:36.64, start: -3.338000, bitrate: 1089 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 480x360, 997 kb/s, 15 fps, 15 tbr, 16k tbn, 30 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (Main) (mp4a / 0x6134706D), 22050 Hz, stereo, fltp, 88 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #1, png_pipe, from '/home/web/tomcat-6.0.29/zhouletest/gif_images/palettegens/6.png':
Duration: N/A, bitrate: N/A
Stream #1:0: Video: png, rgba(pc), 16x16 [SAR 1:1 DAR 1:1], 25 tbr, 25 tbn, 25 tbc
[AVFilterGraph @ 0x45c5260] No such filter: '"fps'
Error initializing complex filters.
Invalid argument

最佳答案

与您的 FFmpeg 二进制文件无关,这几乎肯定与运行命令的 shell 环境中的转义字符有关。

检查错误信息:

No such filter: '"fps' 

FFmpeg 认为被调用的过滤器是 "fps

尝试删除 filter_complex 周围的引号,即

-filter_complex fps=10,scale=177:-1:flags=lanczos[x];[x][1:v]paletteuse

或者,如果这不起作用,请用单引号将其括起来。

-filter_complex 'fps=10,scale=177:-1:flags=lanczos[x];[x][1:v]paletteuse'

关于linux - ffmpeg 没有这样的过滤器 : 'palettegen' in linux,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38636256/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com