ffmpeg No such filter: 'palettegen' in linux -
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 download http://johnvansickle.com/ffmpeg/
3.i had download ffmpeg-release-64bit-static.tar.xz
,unpackage file, , run : ./ffmpeg
ffmpeg
has installed. check using : ffmpeg -version
no problems.
i run command in system no problem:
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
but when invoke command in java, errors happend, why?
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(); }
errors:
result1:
result2:ffmpeg version 3.1.1-static http://johnvansickle.com/ffmpeg/ copyright (c) 2000-2016 ffmpeg developers
built 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, '/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, '/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
nothing ffmpeg binary, related escaping characters in shell environment commands run in.
examine error message:
no such filter: '"fps'
ffmpeg thinks filter being called "fps
.
try removing quotes around filter_complex i.e.
-filter_complex fps=10,scale=177:-1:flags=lanczos[x];[x][1:v]paletteuse
or if doesn't work, enclose in single quotes.
-filter_complex 'fps=10,scale=177:-1:flags=lanczos[x];[x][1:v]paletteuse'
Comments
Post a Comment