我已经使用普通的Android相机成功捕获了视频。现在我想使用ffmpeg libray命令以1:1的比例裁剪视频。但它给了我以下错误。
使用的版本FFMPEG:编译' com.writingminds:FFmpegAndroid:0.3.2'
命令:
- y, -i, /storage/emulated/0/DCIM/ZyfVideo/VID_20170916_093512.mp4, -vf, scale=720:ih*720/iw, crop=720:720,setdar=1:1,setsar=1:1, -threads, 5, -preset, ultrafast, -strict, experimental, -vcodec, libx264, -preset, ultrafast, /storage/emulated/0/DCIM/ZyfVideo/VID_20170916_093521.mp4
记录错误:
09-16 09:35:22.184 32149-32226/com.spoof.app D/FFmpeg: Running publishing updates method
09-16 09:35:22.451 32149-32149/com.spoof.app D/NormalSquareFragment: Progress Video :ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
09-16 09:35:22.451 32149-32149/com.spoof.app D/NormalSquareFragment: Progress Video : built with gcc 4.8 (GCC)
09-16 09:35:22.465 32149-32149/com.spoof.app D/NormalSquareFragment: Progress Video : 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=
09-16 09:35:22.487 32149-32149/com.spoof.app D/NormalSquareFragment: Progress Video : libavutil 55. 17.103 / 55. 17.103
09-16 09:35:22.490 32149-32149/com.spoof.app D/NormalSquareFragment: Progress Video : libavcodec 57. 24.102 / 57. 24.102
09-16 09:35:22.491 32149-32149/com.spoof.app D/NormalSquareFragment: Progress Video : libavformat 57. 25.100 / 57. 25.100
09-16 09:35:22.493 32149-32149/com.spoof.app D/NormalSquareFragment: Progress Video : libavdevice 57. 0.101 / 57. 0.101
09-16 09:35:22.494 32149-32149/com.spoof.app D/NormalSquareFragment: Progress Video : libavfilter 6. 31.100 / 6. 31.100
09-16 09:35:22.497 32149-32149/com.spoof.app D/NormalSquareFragment: Progress Video : libswscale 4. 0.100 / 4. 0.100
09-16 09:35:22.498 32149-32149/com.spoof.app D/NormalSquareFragment: Progress Video : libswresample 2. 0.101 / 2. 0.101
09-16 09:35:22.499 32149-32149/com.spoof.app D/NormalSquareFragment: Progress Video : libpostproc 54. 0.100 / 54. 0.100
09-16 09:35:22.549 32149-32149/com.spoof.app D/NormalSquareFragment: Progress Video :Unrecognized option 'preset'.
09-16 09:35:22.553 32149-32149/com.spoof.app D/NormalSquareFragment: Progress Video :Error splitting the argument list: Option not found
09-16 09:35:22.574 32149-32149/com.spoof.app D/NormalSquareFragment: Failure Video :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
Unrecognized option 'preset'.
Error splitting the argument list: Option not found
09-
答案 0 :(得分:0)
重复的-preset, ultrafast,
中的“r”编码方式与其他字符的编码方式不同,导致无法识别的选项。
删除第二个-preset, ultrafast,
并删除缩放过滤后的额外空格。