tanersener / react-native-ffmpeg

FFmpeg for react-native. Not maintained anymore. Superseded by FFmpegKit.
GNU General Public License v3.0
401 stars 51 forks source link

Taking a screenshot causes SEGFAULT sporadically #146

Closed agentlogic closed 4 years ago

agentlogic commented 4 years ago

Description I've run into a weird and extremely hard to debug issue in my iOS app. The crash happens when trying to take a screenshot/thumbnail image from a recorded video from the device's camera. It works fine most of the time, but on some occasions (this is impossible to reproduce consistently) the app crashes with a segmentation fault.

I'm using the full-gpl package. The ffmpeg command used for taking a screenshot is: RNFFmpeg.execute(``-y -ss 00:00:03 -i ${inputUri} -frames:v 1 q:v 4 ${outputUri}``)

The only thing consistent about this sporadic app crash is that every crash log (posted below) is pretty much identical. So either there is an issue with my command above, or it's an issue with MobileFFmpeg/FFmpeg.

Expected behavior There should be no segmentation fault

Current behavior The app crashes sporadically with a segmentation fault.

Screenshots N/A

Logs Crash log posted on Ghostbin.

Environment

info Fetching system and libraries information...
System:
    OS: macOS 10.15.3
    CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
    Memory: 189.09 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 8.11.4 - ~/.nvm/versions/node/v8.11.4/bin/node
    Yarn: 1.21.1 - /usr/local/bin/yarn
    npm: 6.14.3 - ~/.nvm/versions/node/v8.11.4/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 23, 25, 26, 27, 28, 29
      Build Tools: 28.0.3, 29.0.2
      System Images: android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6241897
    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.12.0 => 16.12.0 
    react-native: 0.61.5 => 0.61.5

Other Add any other context about the problem here.

tanersener commented 4 years ago

A similar issue was resolved recently. Did you see #132?

agentlogic commented 4 years ago

@tanersener Thank you for the quick response! That issue does look very similar to what I'm experiencing. I'll clear my pods cache, reinstall, rebuild and confirm if it works. Thanks for the heads up on #132!

agentlogic commented 4 years ago

So sorry for the delay in confirming this. I haven't been able to upgrade the pod and rebuild yet as I haven't been able to get to work due to the lockdown put in place because of COVID-19 :(

I should be able to get a build out tomorrow and be able to confirm if this is resolved or not. Thank you for your patience!

tanersener commented 4 years ago

No worries. Stay safe !

agentlogic commented 4 years ago

No worries. Stay safe !

Thanks @tanersener, you too!

I can confirm that cleaning my pods cache and reinstalling (which upgraded mobile-ffmpeg-full-gpl to version 4.3.1) resolves this issue.

Specifically, I did the following (for anyone landing here with the same issue):

  1. cd ios
  2. pod cache clean react-native-ffmpeg && pod cache clean mobile-ffmpeg-<package>
  3. pod install
  4. Rebuild app

Thank you so much for your awesome work!