Reputation: 11
I'm trying to crop a video with Flutter_ffmpeg package using this -i $inputPath -filter:v "crop=80:60:200:100" -c $outputPath
, but I'm having this error message
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
I've been cracking my head with this for the past two days, kindly share your thoughts on what might wrong.
Upvotes: 0
Views: 1411
Reputation: 134063
The -c
option requires a value, but yours has none.
Also, you should use a stream specifier with the -c
option, such as -c:v
for video, and -c:a
for the audio. The exception is when you want to stream copy all stream types, but since you're filtering you can't do that (filtering requires encoding).
Omit it and rely on the default selection:
-i $inputPath -filter:v "crop=80:60:200:100" $outputPath
Or manually add values:
-i $inputPath -filter:v "crop=80:60:200:100" -c:v libx264 -c:a copy $outputPath
Upvotes: 2