gpt4 book ai didi

flutter FFMPEG : Error setting profile baseline

转载 作者:行者123 更新时间:2023-12-04 23:01:38 28 4
gpt4 key购买 nike

Flutter-ffmpeg无法设置配置文件参数。 (我需要使用配置文件,以便可以在 WhatsApp 上播放渲染的视频)。
我正在将.bmp 图像转换为 mp4 视频。其他我已经测试了其他参数并且工作很好,它只是 -profile:v 似乎有一些问题。
除非我使用 -profile:v baseline,否则一切正常.

void _runFFmpeg() async {
var dir = await getApplicationDocumentsDirectory();
var output = await getExternalStorageDirectory();
String videoSize = '${ImageWidth}x$ImageSize';
print("${ImageWidth}x$ImageSize");
var arguments = [
"-y", // replace output file if it already exists
"-framerate", "30", // framrate
"-video_size", videoSize,
"-pixel_format", "yuv420p",
"-i", "${output.path}/frame_%d.bmp",
"-profile:v", "baseline",
"-level", "3.0",
"${output.path}/test.mp4"
];

_flutterFFmpeg
.executeWithArguments(arguments)
.then((rc) => print("FFmpeg process exited with rc $rc"));


print("Done Rendering");
}
日志
D/flutter-ffmpeg(26672): Running FFmpeg with arguments: [-y, -framerate, 30, -video_size, 720x600, -pixel_format, yuv420p, -i, /storage/emulated/0/Android/data/com.example.test/files/frame_%d.bmp, -profile:v, baseline, -level, 3.0, /storage/emulated/0/Android/data/com.example.test/files/test.mp4].
I/mobile-ffmpeg(26672): ffmpeg version v4.4-dev-416
I/mobile-ffmpeg(26672): Copyright (c) 2000-2020 the FFmpeg developers
I/mobile-ffmpeg(26672):
I/mobile-ffmpeg(26672): built with Android (6454773 based on r365631c2) clang version 9.0.8 (https://android.googlesource.com/toolchain/llvm-project 98c855489587874b2a325e7a516b99d838599c6f) (based on LLVM 9.0.8svn)
I/mobile-ffmpeg(26672): configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk/21.3.6528147/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++ --extra-libs='-L/home/taner/Projects/mobile-ffmpeg/prebuilt/android-arm64/cpu-features/lib -lndk_compat' --target-os=android --enable-neon --enable-asm --enable-inline-asm --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --enable-shared --enable-v4l2-m2m --disable-outdev=fbdev --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 --disable-nvenc --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-audiotoolbox --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gmp --enable-gnutls --enable-libmp3lame --enable-libass --enable-iconv --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libopencore-amrnb --enable-libshine --enable-libspeex --enable-libwavpack --enable-libkvazaar --enable-libx264 --enable-gpl --enable-libxvid --enable-gpl --enable-libx265 --enable-gpl --enable-libvidstab --enable-gpl --enable-libilbc --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libaom --enable-libtwolame --disable-sdl2 --enable-libvo-amrwbenc --enable-zlib --enable-mediacodec
I/mobile-ffmpeg(26672): libavutil 56. 55.100 / 56. 55.100
I/mobile-ffmpeg(26672): libavcodec 58. 96.100 / 58. 96.100
I/mobile-ffmpeg(26672): libavformat 58. 48.100 / 58. 48.100
I/mobile-ffmpeg(26672): libavdevice 58. 11.101 / 58. 11.101
I/mobile-ffmpeg(26672): libavfilter 7. 87.100 / 7. 87.100
I/mobile-ffmpeg(26672): libswscale 5. 8.100 / 5. 8.100
I/mobile-ffmpeg(26672): libswresample 3. 8.100 / 3. 8.100
I/mobile-ffmpeg(26672): Input #0, image2, from '/storage/emulated/0/Android/data/com.example.test/files/frame_%d.bmp':
I/mobile-ffmpeg(26672): Duration:
I/mobile-ffmpeg(26672): 00:00:06.03
I/mobile-ffmpeg(26672): , start:
I/mobile-ffmpeg(26672): 0.000000
I/mobile-ffmpeg(26672): , bitrate:
I/mobile-ffmpeg(26672): N/A
I/mobile-ffmpeg(26672):
I/mobile-ffmpeg(26672): Stream #0:0
I/mobile-ffmpeg(26672): : Video: bmp, yuv420p, 720x600
I/mobile-ffmpeg(26672): ,
I/mobile-ffmpeg(26672): 30 fps,
I/mobile-ffmpeg(26672): 30 tbr,
I/mobile-ffmpeg(26672): 30 tbn,
I/mobile-ffmpeg(26672): 30 tbc
I/mobile-ffmpeg(26672):
I/mobile-ffmpeg(26672): Stream mapping:
I/mobile-ffmpeg(26672): Stream #0:0 -> #0:0
I/mobile-ffmpeg(26672): (bmp (native) -> h264 (libx264))
I/mobile-ffmpeg(26672):
I/mobile-ffmpeg(26672): Press [q] to stop, [?] for help
W/mobile-ffmpeg(26672): [graph 0 input from stream 0:0 @ 0x7280948480] sws_param option is deprecated and ignored
E/mobile-ffmpeg(26672): [libx264 @ 0x7291ba8100] Error setting profile baseline.
I/mobile-ffmpeg(26672): [libx264 @ 0x7291ba8100] Possible profiles:
I/mobile-ffmpeg(26672): [libx264 @ 0x7291ba8100] baseline
I/mobile-ffmpeg(26672): [libx264 @ 0x7291ba8100] main
I/mobile-ffmpeg(26672): [libx264 @ 0x7291ba8100] high
I/mobile-ffmpeg(26672): [libx264 @ 0x7291ba8100] high10
I/mobile-ffmpeg(26672): [libx264 @ 0x7291ba8100] high422
I/mobile-ffmpeg(26672): [libx264 @ 0x7291ba8100] high444
I/mobile-ffmpeg(26672): [libx264 @ 0x7291ba8100]
E/mobile-ffmpeg(26672): Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
I/mobile-ffmpeg(26672): Conversion failed!
D/flutter-ffmpeg(26672): FFmpeg exited with rc: 1
E/UIFirst (26672): failed to open /proc/26672/stuck_info, No such file or directory
I/chatty (26672): uid=12724(com.example.test) identical 2 lines
3
E/UIFirst (26672): failed to open /proc/26672/stuck_info, No such file or directory
I/chatty (26672): uid=12724(com.example.test) identical 1 line
E/UIFirst (26672): failed to open /proc/26672/stuck_info, No such file or directory
flutter 医生-v
[√] Flutter (Channel stable, 2.0.1, on Microsoft Windows [Version 10.0.18362.836], locale en-US)
• Flutter version 2.0.1 at C:\Users\Dell\flutter
• Framework revision c5a4b4029c (5 weeks ago), 2021-03-04 09:47:48 -0800
• Engine revision 40441def69
• Dart version 2.12.0
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at C:\Users\Dell\AppData\Local\Android\sdk
• Platform android-30, build-tools 29.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[√] Android Studio (version 3.6)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 45.1.1
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
[√] VS Code (version 1.55.0)
• VS Code at C:\Users\Dell\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.21.0
[√] Connected device (2 available)
• RMX1801 (mobile) • 8843cc23 • android-arm64 • Android 10 (API 29)
• Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.114
• No issues found!
我也尝试将包更改为 min-gpl、https-gpl 和视频,但没有任何变化。

最佳答案

我只熟悉 FFmpeg,不熟悉 Flutter 的插件,所以无法轻松测试。
但我怀疑您使用缩放作为输入选项。
要将缩放应用到输出,请移动 "-i", "${output.path}/frame_%d.bmp",-y 之后.
如果您的日志仍然显示 [graph 0 input from stream 0:0 @ 0x7280948480] sws_param option is deprecated and ignored ,使用不同的缩放选项:
而不是 "-video_size", videoSize,我会使用 "-vf", "scale=720:600", .
如果这没有帮助,请尝试替换 -profile:v对于 -vprofile-profile .

关于 flutter FFMPEG : Error setting profile baseline,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66980430/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com