title: sandboxed electron app cant use ffmpeg (mac apple store)
body: <p>I am trying to build an electron application for the mac apple store that uses ffmpeg.</p>
  <p>I can use fluent-ffmpeg locally fine and It continues to work when I  build my app for windows/mac/linux, but when I build a sandoxed Mac Apple Store (MAS) .app file and sign the .app file, fluent-ffmpeg does not work anymore, and throws an <code>ffmpeg was killed with signal SIGILL</code> error in console:</p>
  <p><a href="https://i.stack.imgur.com/EFroH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EFroH.png" alt="enter image description here" /></a></p>
  <p>Fluent-ffmpeg gets setup with this javscript code:</p>
  <pre><code>        //begin get ffmpeg info
          const ffmpeg = require('fluent-ffmpeg');
          //Get the paths to the packaged versions of the binaries we want to use
          var ffmpegPath = require('ffmpeg-static-electron').path;
          ffmpegPath = ffmpegPath.replace('app.asar', 'app.asar.unpacked')
          var ffprobePath = require('ffprobe-static-electron').path;
          ffprobePath = ffprobePath.replace('app.asar', 'app.asar.unpacked')
          //tell the ffmpeg package where it can find the needed binaries.
          
          ffmpeg.setFfmpegPath(ffmpegPath)//(&quot;./src/ffmpeg/ffmpeg&quot;);
          ffmpeg.setFfprobePath(ffprobePath)//(&quot;./src/ffmpeg/ffprobe&quot;);
          
          //end set ffmpeg info
  </code></pre>
  <p>I have looked into this issue some and found similar questions, like this stackoverflow answer <a href="https://stackoverflow.com/questions/47629110/ffmpeg-gets-aborted-in-an-electron-sandboxed-application">(link here)</a> which says to compile a static ffmpeg executable and use that.</p>
  <p>So I learned how to compile ffmpeg from the command line using these commands on my mac terminal:</p>
  <pre><code>git clone https://git.ffmpeg.org/ffmpeg.git 
  
  ./configure --pkg-config-flags=&quot;--static&quot; --libdir=/usr/local/lib --extra-version=ntd_20150128 --disable-shared --enable-static --enable-gpl --enable-pthreads --enable-nonfree  --enable-libass --enable-libfdk-aac  --enable-libmp3lame  --enable-libx264 --enable-filters --enable-runtime-cpudetect
  
  make
  
  </code></pre>
  <p>After a while, I get an ffmpeg folder, which I move to my electron project's src folder <code>/src/</code></p>
  <p>I place this ffmpeg folder inside my electron /src folder and change my ffmpeg setup code to use my statically built folder like so:</p>
  <pre><code>        //begin get ffmpeg info
          const ffmpeg = require('fluent-ffmpeg');
          //Get the paths to the packaged versions of the binaries we want to use
          var ffmpegPath = require('ffmpeg-static-electron').path;
          ffmpegPath = ffmpegPath.replace('app.asar', 'app.asar.unpacked')
          var ffprobePath = require('ffprobe-static-electron').path;
          ffprobePath = ffprobePath.replace('app.asar', 'app.asar.unpacked')
          //tell the ffmpeg package where it can find the needed binaries.
          
          ffmpeg.setFfmpegPath(ffmpegPath)//(&quot;./src/ffmpeg/ffmpeg&quot;);
          ffmpeg.setFfprobePath(ffprobePath)//(&quot;./src/ffmpeg/ffprobe&quot;);
          
          //end set ffmpeg info
  </code></pre>
  <p>And then build / sign my app with these commands:</p>
  <pre><code>$ electron-builder build --mac
  
  $ sudo codesign --deep --force --verbose --sign '##(my dev id)####' dist/mas/Digify-mac.app
  </code></pre>
  <p>But the final built .app file has the same error when trying to launch ffmpeg:</p>
  <pre><code>ffmpeg was killed with signal SIGILL
  </code></pre>
  <p>I've been trying to solve this issue myself but with no luck, there have been some recent posts about this on the apple developer forums:
  <a href="https://developer.apple.com/forums/thread/87849" rel="nofollow noreferrer">https://developer.apple.com/forums/thread/87849</a></p>
  <p>but most of the other guides online are outdated.</p>
  <p>Can anyone please help me get ffmpeg working in an sandboxed electron app for the Mac Apple Store? Any help would be much appreciated</p>