android - Flutter_ffmpeg : At least one output file must be specified

标签 android flutter ffmpeg video-processing

我正在尝试使用 Flutter_ffmpeg 裁剪视频使用此包 -i $inputPath -filter:v "crop=80:60:200:100" -c $outputPath ,但我收到此错误消息

Running FFmpeg with arguments: [-i, /data/user/0/com.timz/app_flutter/Movies/flutter_test/1584827688309.mp4, -filter:v, crop=80:60:200:100, -c, /data/user/0/com.timz/cache/output.mp4].
I/flutter (20728): ffmpeg version git-2020-01-25-fd11dd500
I/flutter (20728):  Copyright (c) 2000-2020 the FFmpeg developers
I/flutter (20728): 
I/flutter (20728):   built with Android (5220042 based on r346389c) clang version 8.0.7 (https://android.googlesource.com/toolchain/clang b55f2d4ebfd35bf643d27dbca1bb228957008617) (https://android.googlesource.com/toolchain/llvm 3c393fe7a7e13b0fba4ac75a01aa683d7a5b11cd) (based on LLVM 8.0.7svn)
I/flutter (20728):   configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/home/taner/Projects/mobile-ffmpeg/prebuilt/android-arm64/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang++ --target-os=android --enable-neon --enable-asm --enable-inline-asm --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --enable-shared --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --enable-small --disable-openssl --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disa
I/flutter (20728):   libavutil      56. 38.100 / 56. 38.100
I/flutter (20728):   libavcodec     58. 65.102 / 58. 65.102
I/flutter (20728):   libavformat    58. 35.101 / 58. 35.101
I/flutter (20728):   libavdevice    58.  9.103 / 58.  9.103
I/flutter (20728):   libavfilter     7. 70.101 /  7. 70.101
I/flutter (20728):   libswscale      5.  6.100 /  5.  6.100
I/flutter (20728):   libswresample   3.  6.100 /  3.  6.100
I/flutter (20728): Trailing option(s) found in the command: may be ignored.
D/flutter-ffmpeg(20728): FFmpeg exited with rc: 1
I/flutter (20728): Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.timz/app_flutter/Movies/flutter_test/1584827688309.mp4':
I/flutter (20728):   Metadata:
I/flutter (20728):     major_brand     : 
I/flutter (20728): mp42
I/flutter (20728): 
I/flutter (20728):     minor_version   : 
I/flutter (20728): 0
I/flutter (20728): 
I/flutter (20728):     compatible_brands: 
I/flutter (20728): isommp42
I/flutter (20728): 
I/flutter (20728):     creation_time   : 
I/flutter (20728): 2020-03-21T21:54:56.000000Z
I/flutter (20728): 
I/flutter (20728):     com.android.version: 
I/flutter (20728): 9
I/flutter (20728): 
I/flutter (20728):   Duration: 
I/flutter (20728): 00:00:07.17
I/flutter (20728): , start: 
I/flutter (20728): 0.000000
I/flutter (20728): , bitrate: 
I/flutter (20728): 3870 kb/s
I/flutter (20728): 
I/flutter (20728):     Stream #0:0
I/flutter (20728): (eng)
I/flutter (20728): : Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709), 720x480, 3854 kb/s
I/flutter (20728): , SAR 1:1 DAR 3:2
I/flutter (20728): , 
I/flutter (20728): 29.44 fps, 
I/flutter (20728): 29.83 tbr, 
I/flutter (20728): 90k tbn, 
I/flutter (20728): 180k tbc
I/flutter (20728):  (default)
I/flutter (20728): 
I/flutter (20728):     Metadata:
I/flutter (20728):       rotate          : 
I/flutter (20728): 270
I/flutter (20728): 
I/flutter (20728):       creation_time   : 
I/flutter (20728): 2020-03-21T21:54:56.000000Z
I/flutter (20728): 
I/flutter (20728):       handler_name    : 
I/flutter (20728): VideoHandle
I/flutter (20728): 
I/flutter (20728):     Side data:
I/flutter (20728):       
I/flutter (20728): displaymatrix: rotation of 90.00 degrees
I/flutter (20728): 
I/flutter (20728):     Stream #0:1
I/flutter (20728): (eng)
I/flutter (20728): : Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 12 kb/s
I/flutter (20728):  (default)
I/flutter (20728): 
I/flutter (20728):     Metadata:
I/flutter (20728):       creation_time   : 
I/flutter (20728): 2020-03-21T21:54:56.000000Z
I/flutter (20728): 
I/flutter (20728):       handler_name    : 
I/flutter (20728): SoundHandle
I/flutter (20728): 
I/flutter (20728): At least one output file must be specified

在过去的两天里,我一直在为此烦恼,请分享您对可能出了什么问题的想法。

最佳答案

-c选项需要一个值,但你的没有。

此外,您应该使用 stream specifier-c选项,例如 -c:v用于视频和 -c:a为音频。异常(exception)情况是当您想要 stream copy所有流类型,但由于您要过滤,所以不能这样做(过滤需要编码)。

省略它并依赖默认选择:

-i $inputPath -filter:v "crop=80:60:200:100" $outputPath

或手动添加值:
-i $inputPath -filter:v "crop=80:60:200:100" -c:v libx264 -c:a copy $outputPath

关于android - Flutter_ffmpeg : At least one output file must be specified,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60793792/

相关文章:

android - 如何处理未捕获的异常,然后将处理委托(delegate)回系统?

java - 将变量发送到 Fragment 类中?

android - “SystemChrome”未在 Flutter 中定义

ffmpeg - 忽略错误 "Invalid UTF-8 in decoded subtitles text; maybe missing -sub_charenc option Error while decoding stream"是否安全?

java - Android,ListView 显示与 ArrayList 相同的数据?

java - 亚洲语言中带年份的日期格式

flutter - "Offstage"widget 在 Flutter 中有什么作用?

flutter - 如何防止整数值变为负数

ffmpeg filter_complex concat 永远不会完成

ios - 初始化 FlutterFFmpegConfig() 时,Flutter 应用程序在 Release模式下崩溃;