react-native-ffmpeg 无法识别的选项 'preset'

标签 react-native ffmpeg

下面是我的 ffmpeg 命令:
-y -i vidInput.mp4 -vcodec mpeg4 -b:v 1000k -b:a 48000 -preset ultrafast vidOutput.mp4
结果是:

[Mon Jul 06 2020 20:42:08.171]  LOG      Unrecognized option 'preset'.
[Mon Jul 06 2020 20:42:08.172]  LOG      Error splitting the argument list:
[Mon Jul 06 2020 20:42:08.174]  LOG      Option not found
需要建议...

最佳答案

您应该安装 的所有依赖项ffmpeg , 为此您可以在 android/build.gradle 中执行以下操作:

buildscript {
ext {
    buildToolsVersion = "29.0.2"
    minSdkVersion = 24
    compileSdkVersion = 29
    targetSdkVersion = 29
  ++  reactNativeFFmpegPackage = "full-gpl"  //add this line
}
...


}
您也应该在 android/app/build.gradle 中执行此操作在 android 对象下:
android{
    packagingOptions {
    pickFirst 'lib/x86/libc++_shared.so'
    pickFirst 'lib/x86_64/libc++_shared.so'
    pickFirst 'lib/armeabi-v7a/libc++_shared.so'
    pickFirst 'lib/arm64-v8a/libc++_shared.so'       
    }
  }

关于react-native-ffmpeg 无法识别的选项 'preset',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62757600/

相关文章:

react-native - 我正在使用 cmd sudo expo init my-app 在 Linux 中创建新的示例项目。获取git权限错误

react-native - native react - 具有百分比值的 paddingTop 不起作用

c++ - 使 Qt Player 编解码器独立

windows - 为什么PowerShell在执行我的命令之前关闭ff-prompt.bat

python-3.x - 使用 ffmpeg-python 创建隔行扫描视频

exception - FFMPeg 异常 setDataSource 失败 : status = 0xFFFFFFFF

python - ffmpeg 结果到临时文件

ios - requiresMainQueueSetup 和 dispatch_get_main_queue 的区别?

json - React-Native:在 ListView 中显示 JSON 数据

javascript - Reactjs:如何从 child 更新 parent 的状态