13

In the last release (v0.31.0) electron comes with a statically linked FFMpeg library (not the command line tool, see #2588)

I am aware of the many nodejs modules for ffmpeg, but they all look like an api to the command line tool, so how can I ideally access the ffmpeg library bundled with electron and encode a stream?

Carlo
  • 1,184
  • 4
  • 15
  • 31
  • 1
    I once wrote a native C++ wrapper around some basic decoding functionality of FFMPEG for node, I could post it and you could try to adapt it to your needs if you'd like. I think that would be the only way to use FFMPEG directly without the command line tool. – peacer212 Mar 02 '16 at 16:26

3 Answers3

12

Disclaimer: This is a shameless plug for ffbinaries Node module and ffbinaries.com API I created.

I was looking for the answer to this a while ago and couldn't find anything useful. I decided to put something together myself and thought I'd come back here in case you still need it.

I created ffbinaries downloader to achieve this. I just started this two nights ago so might be still lacking but give it a try.

Still very much work in progress, currently (at 0.0.12) it doesn't set permissions on the file yet but it downloads the required binaries just fine.

Edit: ffbinaries has reached version 1.0.0 milestone a while back - nice, stable and it does set permissions correctly :)

Community
  • 1
  • 1
Vot
  • 199
  • 2
  • 6
2

This is currently not possible, since there is no decent ffmpeg library for node.js. Meaning, there are only such that abstract the CLI. However it is possible to compile and link ffmpeg as node native addon, which simply no-one seems to have done yet. So the advice, unfortunately, would be to write this kind of abstraction and include the lib into your electron build

eljefedelrodeodeljefe
  • 6,304
  • 7
  • 29
  • 61
  • So, basically, what you're saying is - they bundled ffmpeg with electron, but we can't use it? (not without additional hassle at least) – Milan Krstic Apr 25 '16 at 22:20
1

It's possible to bundle the precompiled static ffmpeg binary with an electron app; of course you'll have to make sure you bundle the correct binary with the correct distro. I have a complete answer here.

Community
  • 1
  • 1
UltrasoundJelly
  • 1,845
  • 2
  • 18
  • 32