0

Description

I'm using React Native and Expo and trying to convert video from mp4 to vp9 encoded format using ffmpeg-kit-react-native package.

I followed installation steps from documentation https://github.com/tanersener/ffmpeg-kit/tree/main/react-native .

  1. yarn add ffmpeg-kit-react-native
  2. In android/build.gradle
  ext {
      ffmpegKitPackage = "video"
  }
  1. In node_modules/ffmpeg-kit-react-native/android/build.gradle
 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'
  }
  rootProject.ext.ffmpegKitPackage = "video"

Expected behavior

Convert mp4 to vp9 encoded format

Current behavior

Throwing error when calling FFmpegKit.execute(-i ${sourceVideoURI} -c:v libvpx-vp9 ${resultVideoURI})

  • sourceVideoURI is video URI from expo-image-picker
  • resultVideoURI is ${FileSystem.documentDirectory}video/

Environment

  • Expo: 45.0.0
  • ffmpeg-kit-react-native: 4.5.2
  • Platform: Android
juejue
  • 1
  • 1

1 Answers1

0

Did you run the app on Expo Go? The library cannot run on Expo Go since it uses native codes. Build a production version of the app and test.