Giter Site home page Giter Site logo

kribblo / node-ffmpeg-installer Goto Github PK

View Code? Open in Web Editor NEW
413.0 6.0 69.0 354.36 MB

Platform independent binary installer of FFmpeg for node projects

Home Page: https://www.npmjs.com/package/@ffmpeg-installer/ffmpeg

JavaScript 92.98% TypeScript 7.02%
ffmpeg ffmpeg-prebuilt nodejs linux darwin windows

node-ffmpeg-installer's Introduction

node-ffmpeg-installer

Platform independent binary installer of FFmpeg for node projects. Useful for tools that should "just work" on multiple environments.

Installs a binary of ffmpeg for the current platform and provides a path and version. Supports Linux, Windows and Mac OS/X.

A combination of package.json fields optionalDependencies, cpu, and os let's the installer only download the binary for the current platform. See also "Warnings during install", below.

Install

npm install --save @ffmpeg-installer/ffmpeg

Usage examples

const ffmpeg = require('@ffmpeg-installer/ffmpeg');
console.log(ffmpeg.path, ffmpeg.version);
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const spawn = require('child_process').spawn;
const ffmpeg = spawn(ffmpegPath, args);
ffmpeg.on('exit', onExit);
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const ffmpeg = require('fluent-ffmpeg');
ffmpeg.setFfmpegPath(ffmpegPath);

Known issues

Warnings during install

To automatically choose the binary to install, optionalDependencies are used. This currently outputs warnings in the console, an issue that is tracked by the npm team here.

AWS and/or Elastic Beanstalk

If you get permissions issues, try adding a .npmrc file with the following:

unsafe-perm=true

See issue #21

Wrong path under Electron with Asar enabled

It's a known issue that Asar breaks native paths. As a workaround, if you use Asar, you can do something like this:

const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path.replace('app.asar', 'app.asar.unpacked');

Compiling ffmpeg for platforms other than your own

If you need to install a version of ffmpeg that differs than your current platform (e.g. compiling a Linux version to upload to AWS Lambda from MacOS), you can use npm install @ffmpeg-installer/linux-x64 --force (substituting linux-x64 with whatever platform you need). Note that if you are compressing your project into a .zip for Lambda, you will need to exclude the other platforms' builds from your archive.

The binaries

Downloaded from the sources listed at ffmpeg.org:

For version updates, submit issue or pull request.

Upload new versions

In every updated platforms/* directory:

npm run upload

See also

node-ffmpeg-installer's People

Contributors

aquark avatar deevus avatar dependabot[bot] avatar isaacpearl avatar kribblo avatar luisangonzalez avatar sebakerckhof avatar tolumide-ng avatar v-jiepeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

node-ffmpeg-installer's Issues

Wrong path for linux-ia32

Hi @kribblo,

First of all, thanks a lot for your great package. It is a really useful idea.

Today I've tried the package and encountered one problem: the path is incorrect.
My situation:

  • Linux 32 bit (LinuxMint 17.3 / Ubuntu 14.04)
  • latest version of npm
  • node 4.5.0

After executing the command npm install --save @ffmpeg-installer/ffmpeg I had the following file structure:

[ my_project_root ]
    /node_modules
        /@ffmpeg-installer
            /ffmpeg
                /node_modules
                    /@ffmpeg-installer
                        /linux-ia32
                            /ffmpeg

But the package gave me another result for the path:
'[ my_project_root ]/node_modules/@ffmpeg-installer/linux-ia32/ffmpeg'

The package returned a correct version - "3.1.3".

I checked the test and the index.js files, and yep, their code produced '[ my_project_root ]/node_modules/@ffmpeg-installer/linux-ia32/ffmpeg', not '`[ my_project_root ]/node_modules/@ffmpeg-installer/ffmpeg/node_modules/@ffmpeg-installer/linux-ia32/ffmpeg``. I repeated the installation in another directory - the same result.

Could you help with this? What is wrong in my actions?

Have a nice day.

How do you recommend adding additional platforms like Linux even though working from Win or Mac?

I am developing on Windows, AWS lambda function for video processing. The thing is when deploying to lambda only the installed platform with for the current developer will be uploaded. How can I specify a certain platform that needs to be always present there? ex. Linux 64 in case of AWS lambda

The thing is I have colleagues that work on Mac and when they will install and deploy a new version of the Lambda function it will have only Mac platform for ffmpeg. We solved this by using Jenkins and Docker to deploy from same linux container, but this is not always ok as we don't have Jenkins for all projects.

Add support for raspberry / raspbian buster

On rasperrypi 4 I get "segmentation fault" trying to use ffmpeg installed with the installer. I also tried to call it directly in node_modules/@ffmpeg-installer/linux-arm/ffmpeg and it gives me directly the message "segmentation fault", so it seems to be the wrong binary for this architecture.

"Could not find ffmpeg executable" using 'app.asar.unpacked'

I'm trying to run this once packaged on Windows (electron packager). The folder containing ffmpeg.exe successfully unpacks. I then use:

const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path.replace('app.asar', 'app.asar.unpacked');

but I get the error

"Could not find ffmpeg executable"

tried ..,"resources\app.asar\node_modules\@ffmpeg-installer\win32-ia32\ffmpeg.exe"

So it seems to be trying to find the file before it allows the path to be modified to include "app.asar.unpacked".

Cannot install package for linux-64 while using Windows

Steps to reproduce:

  1. Use Windows
  2. Try to Install package using: npm install @ffmpeg-installer/linux-x64 --force

Result:
The following error occurred:

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN using --force Recommended protections disabled.
npm ERR! code 1
npm ERR! path D:\Src\MyProject1\node_modules\@ffmpeg-installer\linux-x64
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c C:\Users\ILLIAH~3\AppData\Local\Temp\postinstall-86e7c462.cmd
npm ERR! 'chmod' is not recognized as an internal or external command,
npm ERR! operable program or batch file.

Deprecate in favor of ffmpeg-static?

As part of becoming a contributor of this package I have looked around for alternatives to see whether it makes sense to continue maintenance of node-ffmpeg-installer. It seems as though https://github.com/eugeneware/ffmpeg-static fulfills the same purpose, already has the means to automatically keep the binaries updated, has more GitHub stars and is actively maintained.

It seems to me that this would be the best course of action.

Remove binaries from git

Unless I'm mistaken, the ffmpeg binaries need only be available at publish time, and don't need to be ballooning the repository size.

For a solution I'm thinking something along the lines of:

  1. Store a link to a specific build in configuration for each platform package
  2. Have an associated script that will unzip/untar etc
  3. Before publishing, download the binary to include in the package

Another option:

  1. Steps 1,2 above
  2. Download the binary when installing using an "install" build script

The downsides of the second option are that if in some point in the future, the download link is broken, users won't be able to install it.

Recipe for Elastic Beansstalk?

Hello guys

Stuck here to install this package on an Elastic Beansstalk server instance. Always says permission denied. Any clues?

-------------------------------------
/var/log/eb-commandprocessor.log
-------------------------------------
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 180, in npm_install
      raise e
  subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v8.15.0-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1 (ElasticBeanstalk::ExternalInvocationError)
caused by: + /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install
  
  > [email protected] install /tmp/deployment/application/node_modules/fmerge
  > node install.js
  
  fs.js:646
    return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                   ^
  
  Error: EACCES: permission denied, open 'fmerge.min.js'
      at Object.fs.openSync (fs.js:646:18)
      at Object.fs.writeFileSync (fs.js:1299:33)
      at Object.<anonymous> (/tmp/deployment/application/node_modules/fmerge/install.js:19:4)
      at Module._compile (module.js:653:30)
      at Object.Module._extensions..js (module.js:664:10)
      at Module.load (module.js:566:32)
      at tryModuleLoad (module.js:506:12)
      at Function.Module._load (module.js:498:3)
      at Function.Module.runMain (module.js:694:10)
      at startup (bootstrap_node.js:204:16)
  npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @ffmpeg-installer/[email protected] (node_modules/@ffmpeg-installer/darwin-x64):
  npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @ffmpeg-installer/[email protected]: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
  npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @ffmpeg-installer/[email protected] (node_modules/@ffmpeg-installer/linux-ia32):
  npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @ffmpeg-installer/[email protected]: wanted {"os":"linux","arch":"ia32"} (current: {"os":"linux","arch":"x64"})
  npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @ffmpeg-installer/[email protected] (node_modules/@ffmpeg-installer/win32-ia32):
  npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @ffmpeg-installer/[email protected]: wanted {"os":"win32","arch":"ia32"} (current: {"os":"linux","arch":"x64"})
  npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @ffmpeg-installer/[email protected] (node_modules/@ffmpeg-installer/win32-x64):
  npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @ffmpeg-installer/[email protected]: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})
  npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @ffprobe-installer/[email protected] (node_modules/@ffprobe-installer/darwin-x64):
  npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @ffprobe-installer/[email protected]: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
  npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @ffprobe-installer/[email protected] (node_modules/@ffprobe-installer/linux-ia32):
  npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @ffprobe-installer/[email protected]: wanted {"os":"linux","arch":"ia32"} (current: {"os":"linux","arch":"x64"})
  npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @ffprobe-installer/[email protected] (node_modules/@ffprobe-installer/win32-ia32):
  npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @ffprobe-installer/[email protected]: wanted {"os":"win32","arch":"ia32"} (current: {"os":"linux","arch":"x64"})
  npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @ffprobe-installer/[email protected] (node_modules/@ffprobe-installer/win32-x64):
  npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @ffprobe-installer/[email protected]: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})
  npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
  npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
  
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! [email protected] install: `node install.js`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the [email protected] install script.
  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  
  npm ERR! A complete log of this run can be found in:
  npm ERR!     /tmp/.npm/_logs/2019-03-09T05_24_19_744Z-debug.log
  Running npm install:  /opt/elasticbeanstalk/node-install/node-v8.15.0-linux-x64/bin/npm
  Setting npm config jobs to 1
  npm config jobs set to 1
  Running npm with --production flag
  Failed to run npm install. Snapshot logs for more details.
  UTC 2019/03/09 05:24:19 cannot find application npm debug log at /tmp/deployment/application/npm-debug.log 
  
  Traceback (most recent call last):
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 695, in <module>
      main()
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 677, in main
      node_version_manager.run_npm_install(options.app_path)
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 136, in run_npm_install
      self.npm_install(bin_path, self.config_manager.get_container_config('app_staging_dir'))
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 180, in npm_install
      raise e
  subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v8.15.0-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1 (Executor::NonZeroExitStatus)


[2019-03-09T05:24:19.866Z] ERROR [1769]  : Command CMD-ConfigDeploy failed!
[2019-03-09T05:24:19.867Z] INFO  [1769]  : Command processor returning results: 
{"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"(TRUNCATED).../opt/elasticbeanstalk/containerfiles/ebnode.py\", line 180, in npm_install\n    raise e\nsubprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v8.15.0-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1. \nHook /opt/elasticbeanstalk/hooks/configdeploy/pre/50npm.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI","returncode":1,"events":[{"msg":"Failed to run npm install. Snapshot logs for more details.","severity":"ERROR","timestamp":1552109059867}]}],"truncated":"true"}
[2019-03-10T01:08:29.935Z] DEBUG [7184]  : Reading config file: /etc/elasticbeanstalk/.aws-eb-stack.properties
[2019-03-10T01:08:29.935Z] DEBUG [7184]  : Checking if the command processor should execute...
[2019-03-10T01:08:29.938Z] DEBUG [7184]  : Checking whether the command is applicable to instance (i-0ec5360233e1caf41)..
[2019-03-10T01:08:29.938Z] INFO  [7184]  : Command is applicable to this instance (i-0ec5360233e1caf41)..
[2019-03-10T01:08:29.938Z] DEBUG [7184]  : Checking if the received command stage is valid..
[2019-03-10T01:08:29.938Z] INFO  [7184]  : No stage_num in command. Valid stage..
[2019-03-10T01:08:29.938Z] INFO  [7184]  : Received command CMD-TailLogs: {"execution_data"=>"*", "instance_ids"=>["i-0ec5360233e1caf41"], "data"=>"034dd024-42d1-11e9-86fc-5fe2ff927f0c", "command_name"=>"CMD-TailLogs", "api_version"=>"1.0", "resource_name"=>"AWSEBAutoScalingGroup", "request_id"=>"034dd024-42d1-11e9-86fc-5fe2ff927f0c"}
[2019-03-10T01:08:29.938Z] INFO  [7184]  : Command processor should execute command.
[2019-03-10T01:08:29.938Z] DEBUG [7184]  : Storing current stage..
[2019-03-10T01:08:29.938Z] DEBUG [7184]  : Stage_num does not exist. Not saving null stage. Returning..
[2019-03-10T01:08:29.938Z] DEBUG [7184]  : Reading config file: /etc/elasticbeanstalk/.aws-eb-stack.properties
[2019-03-10T01:08:29.938Z] DEBUG [7184]  : Retrieving metadata for key: AWS::ElasticBeanstalk::Ext||_ContainerConfigFileContent||commands..
[2019-03-10T01:08:29.939Z] DEBUG [7184]  : Retrieving metadata for key: AWS::ElasticBeanstalk::Ext||_API||_Commands..
[2019-03-10T01:08:29.939Z] INFO  [7184]  : Found enabled addons: ["logstreaming", "logpublish"].
[2019-03-10T01:08:29.941Z] INFO  [7184]  : Updating Command definition of addon logstreaming.
[2019-03-10T01:08:29.941Z] INFO  [7184]  : Updating Command definition of addon logpublish.
[2019-03-10T01:08:29.941Z] DEBUG [7184]  : Loaded definition of Command CMD-TailLogs.
[2019-03-10T01:08:29.941Z] INFO  [7184]  : Executing CMD-TailLogs
[2019-03-10T01:08:29.942Z] INFO  [7184]  : Executing command: CMD-TailLogs...
[2019-03-10T01:08:29.942Z] INFO  [7184]  : Executing command CMD-TailLogs activities...
[2019-03-10T01:08:29.942Z] DEBUG [7184]  : Setting environment variables..
[2019-03-10T01:08:29.942Z] INFO  [7184]  : Running AddonsBefore for command CMD-TailLogs...
[2019-03-10T01:08:29.942Z] DEBUG [7184]  : Running stages of Command CMD-TailLogs from stage 0 to stage 0...
[2019-03-10T01:08:29.942Z] INFO  [7184]  : Running stage 0 of command CMD-TailLogs...
[2019-03-10T01:08:29.942Z] DEBUG [7184]  : Loaded 1 actions for stage 0.
[2019-03-10T01:08:29.942Z] INFO  [7184]  : Running 1 of 1 actions: TailLogs...

libopus support

I get an error when I try to decode an opus file (unknown format 'opus').

Is opus intended to be supported? If not any plans to do so, or suggestions on how to possibly make it work?

Just support current platform ?

I am using node to install node-ffmpeg-installer in mac environment. I only installed a Darwin version of ffmpeg. How can I download Darwin and Windows version of ffmpeg at the same time? Because my electron software needs to support two systems at the same time.

how install @ffmpeg-installer/ffmpeg totally

when i use npm i @ffmpeg-installer/darwin-x64 --force. then use npm i @ffmpeg-installer/ffmpeg ,It always only install darwin-arm64 but i want reinstall all the ffmpeg banary, please help me

preinstall/postinstall extra failsafes

Add scripts to fail properly and clearly.

  • preinstall: do the unsupported platform/arch check that is in index.js and fail fast
  • postinstall: get path like in index.js and verify the file exists, fail otherwise

Way to suppress NPM warn logs on postinstall

While installing the module I get these logs, such as :

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @ffmpeg-installer/[email protected] (node_modules/@ffmpeg-installer/linux-arm):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @ffmpeg-installer/[email protected]: wanted {"os":"linux","arch":"arm"} (current: {"os":"darwin","arch":"x64"})

It's kind of ugly to spit out on an install, is there anyway I can suppress these warn logs specifically for this module?

Cannot find ffprobe

Great library, could be very useful for my site if it would also support ffprobe.

Probably it's included in the installs since it's ffmpeg's little sibling. Just can't get the path to it when using in conjunction with fluent-ffmpeg.

Need something like this but for ffprobe:

const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;

maybe add two distinct getters like .getFfmpegPath() and .getFfProbePath()?

MIDI support

Hi, I'm hoping you can help me understand a problem we're having! When using this installer on a Mac, invoking [this ffmpeg] -i song.midi output.mp4 works just fine. However, when running the same node code on Ubuntu fails because the linux build of ffmpeg provided can't seem to handle MIDI decoding.

Is this a known issue? How is the Darwin build different from the Linux build? Is there an easy way to add MIDI support to the linux build?

stream ends after loading one segment

On a mac, everything works perfectly, the stream is converted. But the same code on ubuntu loads only one segment of the stream and finishes the job. No errors occur. Tried different combinations of options. Again, everything works on a mac, but not on ubuntu

Issue using package when deploying to Azure

When deployed to Azure I received this error

Error: Could not find ffmpeg executable, tried "C:\home\site\wwwroot\server\node_modules\@ffmpeg-installer\win32-ia32\ffmpeg.exe", "C:\home\site\wwwroot\server\node_modules\@ffmpeg-installer\ffmpeg\node_modules\@ffmpeg-installer\win32-ia32\ffmpeg.exe" and "C:\home\site\wwwroot\server\node_modules\@ffmpeg-installer\win32-ia32\ffmpeg.exe"

I wrote the code on a windows device and as such the folder downloaded with the module was the win32-x64 folder. However looking at the files in Azure it downloaded the Linux folder instead, due to Azure running on Linux.

Is there a way around this, or a step I am missing?

Usage on AWS Lambda

This looks like a really handy library.

I was wondering how the binary install works.

Does the binary get fetched each time the lambda runs?

If so, isn't the lambda function going to be quite expensive in time resources if ffmpeg has to be installed each time the lambda runs?

Do you happen to know how long the process takes on average?

Thanks

ERROR in ./node_modules/@ffmpeg-installer/ffmpeg/index.js

Trying to use in electron results in this error, crashing renderer process.

Module not found: Error: Can't resolve 'C:\Users\up\to\project\node_modules@ffmpeg-installer\ffmpeg\node_modules@ffmpeg-installer\win32-x64\package.json' in 'C:\Users\up\to\project\node_modules@ffmpeg-installer\ffmpeg'

Clearly this path has two 'node_module' parts in it and is poorly formed, any ideas

Wrong ffmpeg.path if asar is enabled

ffmpeg.path returns path like ....\resources\app.asar\node_modules\@ffmpeg-installer\win32-x64\ffmpeg.exe regardless of asar state.
It should return ....\resources\app.asar.unpacked\node_modules\@ffmpeg-installer\win32-x64\ffmpeg.exe if asar is enabled.

It does not support win32?

image
image

My electron app can run in win-unpacked
But it can not run in win-ia32-unpacked with error undefined: undefined

Someone know why?

Does not work as sub dependency

If I have the following dependencies:
project A -> project B -> ffmpeg-installer,

Then it I get the following error:
Uncaught Could not find ffmpeg executable, tried "/home/seba/dev/project-a/node_modules/project-b/node_modules/@ffmpeg-installer/linux-x64/ffmpeg" and "/home/seba/dev/project-a/node_modules/project-b/node_modules/@ffmpeg-installer/ffmpeg/node_modules/@ffmpeg-installer/linux-x64/ffmpeg"

Because the node_modules folder looks like ( with npm 6.4.1):

project A
|-node_modules
   |-@ffmpeg-installer
      |-node_modules
         |-linux-x64
            |-ffmpeg (=> binary it needs, but doesn't search this location)
   |-project-b
      |-node_modules
         |-@ffmpeg-installer
            |-ffmpeg

Error on Alpine linux 3.8

I use this on multiple Linux distros and it works (like a charm) on all except Alpine Linux 3.8 (launched in a docker container).

I get the error:
Failed to resolve hostname s3.amazonaws.com: Name or service not known

I installed ffmpeg in the container directly using the alpine linux package manager (apk) (apk add ffmpeg) and I see that the version installed is different from this (which is understandable) but it doesn't return the same error when an ffprobe is attempted.
See the different versions:

  • ffprobe from this library
./ffprobe https://s3.amazonaws.com/XXXXXXXXXXXXX.mp4
ffprobe version N-48944-g9b069eb14e-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
  libavutil      56. 28.100 / 56. 28.100
  libavcodec     58. 52.102 / 58. 52.102
  libavformat    58. 27.103 / 58. 27.103
  libavdevice    58.  7.100 / 58.  7.100
  libavfilter     7. 54.101 /  7. 54.101
  libswscale      5.  4.101 /  5.  4.101
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
[tcp @ 0x555556a58440] Failed to resolve hostname s3.amazonaws.com: Name or service not known
https://s3.amazonaws.com/XXXXXXXXXXXXX.mp4: Input/output error
  • ffprobe installed by apk
ffprobe https://s3.amazonaws.com/XXXXXXXXXXXX.mp4
ffprobe version 3.4.6 Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 6.4.0 (Alpine 6.4.0)
  configuration: --prefix=/usr --enable-avresample --enable-avfilter --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --disable-stripping --disable-static --disable-librtmp --enable-vaapi --enable-vdpau --enable-libopus --disable-debug
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'https://s3.amazonaws.com/XXXXXXXXXXXXX.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.20.100
  Duration: 00:35:00.02, start: 0.000000, bitrate: 221 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 138 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 76 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

Any ideas why this is happening?

Using Webpack

Hi,
I'm adding Webpack to my NodeJS project but having issues with ffmpeg-installer. The build process works but when running the app I get the following error:

Cannot find module "[...]@ffmpeg-installer\win32-x64\package.json"

Not sure what to do to fix this but anyway I'm curious if anyone else has used Webpack with this package.

Info:

  • Node 10.15.0
  • NPM 6.10.3
  • Webpack 4.41.2
  • ffmpeg-installer 1.0.20
  • Windows 10 64b

Thanks.

Request for ARM support

Hi Kristoffer (@kribblo),

When I try following code on a Raspberry Pi 3 Model B (running Raspbian):

    const ffmpeg = require('@ffmpeg-installer/ffmpeg');
    console.log(ffmpeg.path, ffmpeg.version);

Then the result is "Unsupported platform/architecture: linux-arm".

Do you have plans to support ARM processors?
Perhaps following information allows you to determine whether it is possible or not:

  • Seems that Debian supports 3 ports of ARM hardware (armhf / armel / arm64), where both armhf and armel are 32-bit.
  • I found two ways to determine the hardware: see 1 and 2.
  • And here there are binaries available for armhf/armel/arm64.

Thanks for your time !!
Bart

Error: spawn EACCES

I am running macOS 10.12.4 and it appears that this installer isn't giving proper executable permissions to the FFMPEG executable.

After I did it manually chmod u+x /path/to/executable it works fine. This should probably be done automatically via postinstall script.

Also applies to ffprobe-installer.

NPM multi OS compatibilty issue

Dear community,

is there a way to install the linux64 binary via NPM if deploying / packaging an application on OSX.

Let me explain. I'm packaging a serverless node application for AWS Lambda and while packaging my application on OSX it uses the Darwin folder binary which works fine on OSX but the packaged application is getting deployed on a Linux env. Which makes the app fail.

Tried multiple things and will now try to copy the binary via webpack copy plugin to the bundle. Let's see if I can make that work with ffmpeg-fluent...

Best,
Hamed

Unable to install linux-x64 binary

Hello there! I've been using this package for a Linux server running node on AWS. The installer was working until around December 10th, 2018, and now my server is crashing and I'm getting an error in my logs.

Working locally on OSX and Windows things have been working perfectly, but Linux seems to be having the issue.

Any insight would be greatly appreciated!

Error below:

/var/app/current/node_modules/@ffmpeg-installer/ffmpeg/index.js:37
    throw 'Could not find ffmpeg executable, tried "' + npm3Binary + '" and "' + npm2Binary + '"';
    ^
Could not find ffmpeg executable, tried "/var/app/current/node_modules/@ffmpeg-installer/linux-x64/ffmpeg" and "/var/app/current/node_modules/@ffmpeg-installer/ffmpeg/node_modules/@ffmpeg-installer/linux-x64/ffmpeg"

Typo in README.md?

Hi,

It looks like that in README.md instead of

process.spawn()

const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const spawn = require('child_process').spawn;
const ffmpeg = spawn('ffmpeg', args);
ffmpeg.on('exit', onExit);

something like

process.spawn()

const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const spawn = require('child_process').spawn;
const ffmpeg = spawn(ffmpegPath, args);     // < < < < < FIRST argument is changed
ffmpeg.on('exit', onExit);

should be written.

macOS arm64 (darwin-arm64 for M1 and M2) missing --enable-libwebp

arm64 arch on macOS is missing --enable-libwebp

./node_modules/@ffmpeg-installer/darwin-arm64/ffmpeg
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
  built with Apple clang version 12.0.0 (clang-1200.0.32.27)
  configuration: --prefix=/Volumes/tempdisk/sw --extra-cflags=-fno-stack-check --arch=arm64 --cc=/usr/bin/clang --enable-gpl --enable-libopus --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libvpx --enable-libass --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libsnappy --enable-libaom --enable-libvidstab --enable-version3 --pkg-config-flags=--static --disable-ffplay --enable-postproc --enable-nonfree --enable-neon --enable-runtime-cpudetect --disable-indev=qtkit --disable-indev=x11grab_xcb
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Hyper fast Audio and Video encoder

Using @ffmpeg-installer on macOS intel has it:

./node_modules/@ffmpeg-installer/darwin-x64/ffmpeg
ffmpeg version N-92718-g092cb17983-tessus  https://evermeet.cx/ffmpeg/  Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
  libavutil      56. 24.101 / 56. 24.101
  libavcodec     58. 42.102 / 58. 42.102
  libavformat    58. 24.101 / 58. 24.101
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 46.101 /  7. 46.101
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Hyper fast Audio and Video encoder

Same for windows (win32-x64):

ffmpeg version N-92722-gf22fcd4483 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181201
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 24.101 / 56. 24.101
  libavcodec     58. 42.102 / 58. 42.102
  libavformat    58. 24.101 / 58. 24.101
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 46.101 /  7. 46.101
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100

And to fully close the circle, ffmpeg installed via brew has it as well:

/opt/homebrew/bin/ffmpeg
ffmpeg version 5.0.1 Copyright (c) 2000-2022 the FFmpeg developers
  built with Apple clang version 13.1.6 (clang-1316.0.21.2)
  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/5.0.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-neon
  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
Hyper fast Audio and Video encoder

Please add to darwin-arm64

Rubberband missing

It's me again. Turns out the important rubberband filter is missing in the ffmpeg binaries of this package:

No such filter: 'rubberband'

Would it be too much to ask for adding that filter too?

Fontconfig error when using drawtext filter

When trying to add text to a video on Linux-64 (Ubuntu 19.10), this error appears:

ffmpeg stderr: Fontconfig warning: line 5: unknown element "its:rules"

The text is still written, but it takes about a minute per second of video material.

When replacing the ffmpeg binary with a newer one (git master: built on 20200324) from https://www.johnvansickle.com/ffmpeg/ the error disappears and the video is rendered in seconds.

Video output contains green artifacts

Hoping someone might know how to resolve this. I'm calling ffmpeg using child_process.exec in Electron to create a slideshow video from a set of images. Usually this results in green artifacts spanning the width of the video and going anywhere between the lower and upper quarters of the video height. Other than the image artifacts the video outputs with expected settings (frame rate, etc).

When I run the same command on the same image content on the same copy of ffmpeg in a terminal window outside my app, everything works fine. It looks like this:

/path/to/ffmpeg -f image2 -framerate 8 -i "/path/to/images/img%02d.jpg" -c:v libx264 "/path/to/video.mp4"

Playing around with the ffmpeg options has not worked. I'm inclined to think it has something to do with how child_process executes it. Any ideas?

unable to find libasound_module_conf_pulse.so, 64bit linux

I am getting this error when I try to caputre audio through alsa device in my 64bit ubuntu system.

ALSA lib ../../src/conf.c:3545:(snd_config_hooks_call) Cannot open shared library libasound_module_conf_pulse.so (/usr/lib/alsa-lib/libasound_module_conf_pulse.so: libasound_module_conf_pulse.so: cannot open shared object file: No such file or directory)
ALSA lib ../../../src/pcm/pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM hw:0

libasound_module_conf_pulse.so is present in usr/lib/x86_64-linux-gnu/alsa-lib

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.