question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Executing a binary (ffmpeg) from a build

See original GitHub issue

Is your feature request related to a problem? Please describe. I’m trying to use a ffmpeg binary in the build. It works by placing the binaries in the publicfolder and then referencing them through __static. However, in the build, it doesn’t work. Maybe because of permission, as in, the macOS app isn’t allowed to execute the binaries?

Describe the solution you’d like child_process.execFile( path.join(__static, “ffmpeg”)) should work in the build app.

Describe alternatives you’ve considered Tried referencing the binaries outside of the public folder (for example app.getPath("exe")) but with no success so far.

Additional context This might not be related to this vue-cli plugin at all, but I still felt this might be a reasonable place to ask, because it works in dev, just not in the build 😃

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
nklaymancommented, Jul 8, 2020

I think I found a solution, try this:

In vue.config.js:

module.exports = {
  pluginOptions: {
    electronBuilder: {
      builderOptions: {
        extraResources: ['./ffmpeg']
      }
    }
  }
}

In app.vue (or wherever you are spawning from):

import { spawn } from "child_process";
import path from "path";
spawn(path.join(__static, "../ffmpeg"));

This assumes ffmpeg is in the root dir of your project, but you can have it in a subfolder if you like, just update all the path references.

1reaction
getflourishcommented, Jul 9, 2020

🥳 It works exactly like that! Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run FFmpeg executable binary in Android - Stack Overflow
I am trying to execute a command based on an example extracted from the FFmpeg site. This is the command-line I'm typing: ./ffmpeg...
Read more >
Can build a ffmpeg bin executable file for android? #30 - GitHub
Hi, I just built ffmpeg binaries for all five android architectures from ... I tried to run ffmpeg executable file , failed.
Read more >
CompilationGuide/Ubuntu - FFmpeg Wiki
Reverting Changes made by this Guide. Remove the build and source files as well as the binaries: rm -rf ~/ffmpeg_build ~/ffmpeg_sources ~/bin/{ ...
Read more >
Building FFmpeg on Windows 10 The Easy Way With All of ...
In this video I am showing how to build a static binary of FFmpeg on Windows 10, that contains all of the codecs...
Read more >
How to execute ffmpeg binary file within Application ...
In my script, I use UnityWebRequest to request ffmpeg (which is stored within "StreamingAssets" folder before building) and store it in the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found