FFMPEG:初始化复杂过滤器时出错。无效的论点

时间:2016-05-20 06:56:32

标签: android ffmpeg

我运行以下命令来创建动画幻灯片,但我收到了错误

String path = Environment.getExternalStorageDirectory() + "/";

-framerate 60 -loop 1 -t 1 -i "+path+"images_001.jpg -framerate 60 -loop 1 -t 1 -i "+path+"images_002.jpg -framerate 60 -loop 1 -t 1 -i "+path+"images_003.jpg -framerate 60 -loop 1 -t 1 -i "+path+"images_004.jpg -framerate 60 -loop 1 -t 1 -i "+path+"images_005.jpg -filter_complex [1:v][0:v]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b1v]; [2:v][1:v]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b2v]; [3:v][2:v]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b3v]; [4:v][3:v]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b4v]; [0:v][b1v][1:v][b2v][2:v][b3v][3:v][b4v][4:v]concat=n=9:v=1:a=0;format=yuv420p;scale=480:270[vx] -map [vx] -vsync 0 -c:v libx264 -crf 35 "+path+"preview_270p.mp4

输出:

FAILED with output : ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8 (GCC)
  configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
  libavutil      55. 17.103 / 55. 17.103
  libavcodec     57. 24.102 / 57. 24.102
  libavformat    57. 25.100 / 57. 25.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 31.100 /  6. 31.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[mjpeg @ 0xb86fe040] Changing bps to 8
Input #0, image2, from '/storage/emulated/0/images_001.jpg':
  Duration: 00:00:00.02, start: 0.000000, bitrate: 542987 kb/s
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1440x2560, 60 fps, 60 tbr, 60 tbn, 60 tbc
[mjpeg @ 0xb8708360] Changing bps to 8
Input #1, image2, from '/storage/emulated/0/images_002.jpg':
  Duration: 00:00:00.02, start: 0.000000, bitrate: 1011478 kb/s
    Stream #1:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 2340x4160, 60 fps, 60 tbr, 60 tbn, 60 tbc
[mjpeg @ 0xb870de00] Changing bps to 8
Input #2, image2, from '/storage/emulated/0/images_003.jpg':
  Duration: 00:00:00.02, start: 0.000000, bitrate: 1022909 kb/s
    Stream #2:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 2340x4160, 60 fps, 60 tbr, 60 tbn, 60 tbc
[mjpeg @ 0xb870a170] Changing bps to 8
Input #3, image2, from '/storage/emulated/0/images_004.jpg':
  Duration: 00:00:00.02, start: 0.000000, bitrate: 601309 kb/s
    Stream #3:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1440x2560, 60 fps, 60 tbr, 60 tbn, 60 tbc
[mjpeg @ 0xb86ff290] Changing bps to 8
Input #4, image2, from '/storage/emulated/0/images_005.jpg':
  Duration: 00:00:00.02, start: 0.000000, bitrate: 950450 kb/s
    Stream #4:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 2340x4160, 60 fps, 60 tbr, 60 tbn, 60 tbc
[AVFilterGraph @ 0xb8708bc0] No such filter: ''
Error initializing complex filters.
Invalid argument

1 个答案:

答案 0 :(得分:0)

先保存此文件

file.txt
ffconcat version 1.0 
  file sample.jpg
  duration 8
  file sample.jpg
  .
  .
  .

然后在以下命令中运行

ffmpeg -safe 0 -i file.txt -i song.mp3 -filter_complex -c:a copy -vf fps=25 newfile.mp4