Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rm patch-package, a vulnerable dep #10

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 83 additions & 38 deletions .github/workflows/release-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,17 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/darwin-x64
asset_name: darwin-x64
asset_path: bin/ffmpeg-darwin-x64
asset_name: ffmpeg-darwin-x64
asset_content_type: application/octet-stream

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/ffprobe-darwin-x64
asset_name: ffprobe-darwin-x64
asset_content_type: application/octet-stream

- uses: actions/[email protected]
Expand All @@ -46,153 +55,189 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/linux-arm
asset_name: linux-arm
asset_path: bin/ffmpeg-linux-arm
asset_name: ffmpeg-linux-arm
asset_content_type: application/octet-stream

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/linux-arm.README
asset_name: linux-arm.README
asset_content_type: text/plain
asset_path: bin/ffmpeg-darwin-arm64
asset_name: ffmpeg-darwin-arm64
asset_content_type: application/octet-stream

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/linux-arm.LICENSE
asset_name: linux-arm.LICENSE
asset_path: bin/ffprobe-darwin-arm64
asset_name: ffprobe-darwin-arm64
asset_content_type: application/octet-stream

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/darwin-arm64.README
asset_name: darwin-arm64.README
asset_content_type: text/plain

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/linux-arm64
asset_name: linux-arm64
asset_path: bin/ffprobe-linux-arm
asset_name: ffprobe-linux-arm
asset_content_type: application/octet-stream

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/linux-arm64.README
asset_name: linux-arm64.README
asset_path: bin/linux-arm.README
asset_name: linux-arm.README
asset_content_type: text/plain

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/linux-arm64.LICENSE
asset_name: linux-arm64.LICENSE
asset_path: bin/linux-arm.LICENSE
asset_name: linux-arm.LICENSE
asset_content_type: text/plain

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/linux-ia32
asset_name: linux-ia32
asset_path: bin/ffmpeg-linux-arm64
asset_name: ffmpeg-linux-arm64
asset_content_type: application/octet-stream

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/linux-ia32.README
asset_name: linux-ia32.README
asset_path: bin/ffprobe-linux-arm64
asset_name: ffprobe-linux-arm64
asset_content_type: application/octet-stream

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/linux-arm64.README
asset_name: linux-arm64.README
asset_content_type: text/plain

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/linux-ia32.LICENSE
asset_name: linux-ia32.LICENSE
asset_path: bin/linux-arm64.LICENSE
asset_name: linux-arm64.LICENSE
asset_content_type: text/plain

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/linux-x64
asset_name: linux-x64
asset_path: bin/ffmpeg-linux-ia32
asset_name: ffmpeg-linux-ia32
asset_content_type: application/octet-stream

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/linux-x64.README
asset_name: linux-x64.README
asset_path: bin/ffprobe-linux-ia32
asset_name: ffprobe-linux-ia32
asset_content_type: application/octet-stream

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/linux-ia32.README
asset_name: linux-ia32.README
asset_content_type: text/plain

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/linux-x64.LICENSE
asset_name: linux-x64.LICENSE
asset_path: bin/linux-ia32.LICENSE
asset_name: linux-ia32.LICENSE
asset_content_type: text/plain

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/win32-ia32
asset_name: win32-ia32
asset_path: bin/ffmpeg-linux-x64
asset_name: ffmpeg-linux-x64
asset_content_type: application/octet-stream

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/win32-ia32.README
asset_name: win32-ia32.README
asset_path: bin/ffprobe-linux-x64
asset_name: ffprobe-linux-x64
asset_content_type: application/octet-stream

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/linux-x64.README
asset_name: linux-x64.README
asset_content_type: text/plain

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/win32-ia32.LICENSE
asset_name: win32-ia32.LICENSE
asset_path: bin/linux-x64.LICENSE
asset_name: linux-x64.LICENSE
asset_content_type: text/plain

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/win32-x64
asset_name: win32-x64
asset_path: bin/ffmpeg-win32-x64
asset_name: ffmpeg-win32-x64
asset_content_type: application/octet-stream

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/win32-x64.README
asset_name: win32-x64.README
asset_content_type: text/plain
asset_path: bin/ffprobe-win32-x64
asset_name: ffprobe-win32-x64
asset_content_type: application/octet-stream

- uses: actions/[email protected]
env:
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Test

on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 16.x
- run: npm install
- run: npm ci
- run: npm test
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ bin/*
/ffmpeg.exe
/ffmpeg.README
/ffmpeg.LICENSE
/ffprobe
/ffprobe.exe
/ffprobe.README
/ffprobe.LICENSE
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ addons:
- unzip
- tar
script:
- npm run install
- npm test
- 'file=$(npm pack -s) && file=$(realpath $file)'
- 'cd $(mktemp -d) && npm init -y'
Expand Down
38 changes: 23 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,46 @@
# ffmpeg-static
# ffmpeg-ffprobe-static

**[ffmpeg](https://ffmpeg.org) static binaries for Mac OSX and Linux and Windows.**
Fork of [ffmpeg-static](https://github.com/eugeneware/ffmpeg-static) that includes ffprobe.

Supports macOS (64-bit), Linux (32 and 64-bit, armhf, arm64) and Windows (32 and 64-bit). [The ffmpeg version currently used is `4.3.1`.](https://github.com/eugeneware/ffmpeg-static/releases/tag/b4.3.1)
## Info

*Note:* The version of `ffmpeg-static` follows [SemVer](http://semver.org). When releasing new versions, **we do *not* consider breaking changes in `ffmpeg` itself**, but only the JS interface (see below). To stop `ffmpeg-static` from breaking your code by getting updated, [lock the version down](https://docs.npmjs.com/files/package.json#dependencies) or use a [lockfile](https://docs.npmjs.com/files/package-lock.json).
**[ffmpeg](https://ffmpeg.org) static binaries for Mac OSX, Linux, Windows and FreeBSD.**

[![npm version](https://img.shields.io/npm/v/ffmpeg-static.svg)](https://www.npmjs.com/package/ffmpeg-static)
[![build status](https://travis-ci.org/eugeneware/ffmpeg-static.svg?branch=master)](http://travis-ci.org/eugeneware/ffmpeg-static)
![minimum Node.js version](https://img.shields.io/node/v/ffmpeg-static.svg)
Supports macOS (64-bit and arm64), Linux (32 and 64-bit, armhf, arm64) and Windows (32 and 64-bit). [The ffmpeg version currently used is `6.0`.](https://github.com/descriptinc/ffmpeg-ffprobe-static/releases/tag/b6.0)

*Note:* The version of `ffmpeg-ffprobe-static` follows [SemVer](http://semver.org). When releasing new versions, **we do *not* consider breaking changes in `ffmpeg` itself**, but only the JS interface (see below). To stop `ffmpeg-ffprobe-static` from breaking your code by getting updated, [lock the version down](https://docs.npmjs.com/files/package.json#dependencies) or use a [lockfile](https://docs.npmjs.com/files/package-lock.json).

[![npm version](https://img.shields.io/npm/v/ffmpeg-ffprobe-static.svg)](https://www.npmjs.com/package/ffmpeg-ffprobe-static)
[![Actions Status](https://github.com/descriptinc/ffmpeg-ffprobe-static/workflows/test/badge.svg)](https://github.com/descriptinc/ffmpeg-ffprobe-static/actions)
![minimum Node.js version](https://img.shields.io/node/v/ffmpeg-ffprobe-static.svg)

## Installation

This module is installed via npm:

``` bash
$ npm install ffmpeg-static
$ npm install ffmpeg-ffprobe-static
```

*Note:* During installation, it will download the appropriate `ffmpeg` binary from the [`b4.3.1` GitHub release](https://github.com/eugeneware/ffmpeg-static/releases/tag/b4.3.1). Use and distribution of the binary releases of FFmpeg are covered by their respective license.
*Note:* During installation, it will download the appropriate `ffmpeg` binary from the [`b6.0` GitHub release](https://github.com/descriptinc/ffmpeg-ffprobe-static/releases/tag/b6.0). Use and distribution of the binary releases of FFmpeg are covered by their respective license.

Alternatively, it will fetch binaries from `FFMPEG_FFPROBE_STATIC_BASE_URL` if set as an environment variable. The default base URL is https://github.com/descriptinc/ffmpeg-ffprobe-static/releases/download/. The install script will fetch binaries from `BASE_URL/binary-release-tag` (the `binary-release-tag` is set in package.json and can customized by setting `FFMPEG_BINARY_RELEASE`).

### Electron & other cross-platform packaging tools

Because `ffmpeg-static` will download a binary specific to the OS/platform, you need to purge `node_modules` before (re-)packaging your app *for a different OS/platform* ([read more in #35](https://github.com/eugeneware/ffmpeg-static/issues/35#issuecomment-630225392)).
Because `ffmpeg-ffprobe-static` will download a binary specific to the OS/platform, you need to purge `node_modules` before (re-)packaging your app *for a different OS/platform* ([read more in #35](https://github.com/eugeneware/ffmpeg-static/issues/35#issuecomment-630225392)).

## Example Usage

Returns the path of a statically linked ffmpeg binary on the local filesystem.

``` js
var pathToFfmpeg = require('ffmpeg-static');
var pathToFfmpeg = require('ffmpeg-ffprobe-static');
console.log(pathToFfmpeg);
```

```
/Users/j/playground/node_modules/ffmpeg-static/ffmpeg
/Users/j/playground/node_modules/ffmpeg-ffprobe-static/ffmpeg
```

Check the [example script](example.js) for a more thorough example.
Expand All @@ -43,17 +49,19 @@ Check the [example script](example.js) for a more thorough example.

[The build script](build/index.sh) downloads binaries from these locations:

- [Windows builds](https://ffmpeg.zeranoe.com/builds/win64/static/)
- [Windows x64 builds](https://github.com/ShareX/FFmpeg/)
- [Windows x86 builds](https://github.com/sudo-nautilus/FFmpeg-Builds-Win32/)
- [Linux builds](https://johnvansickle.com/ffmpeg/)
- [macOS builds](https://evermeet.cx/pub/ffmpeg/)
- macOS builds [for Intel](https://evermeet.cx/pub/ffmpeg/) / [for ARM (Apple Silicon)](https://osxexperts.net/)
- [FreeBSD builds](https://github.com/Thefrank/ffmpeg-static-freebsd/releases)

The build script extracts build information and (when possible) the license file from the downloaded package or the distribution server. Please consult the individual build's project site for exact source versions, which you can locate based on the version information included in the README file.

## Show your support

This npm package includes statically linked binaries that are produced by the following individuals. Please consider supporting and donating to them who have been providing quality binary builds for many years:

- **Windows builds**: [Kyle Schwarz](https://ffmpeg.zeranoe.com/builds/)
- **Windows builds**: [Jaex](https://getsharex.com/donate/)
- **Linux builds**: [John Van Sickle](https://www.johnvansickle.com/ffmpeg/)
- **macOS builds**: [Helmut K. C. Tessarek](https://evermeet.cx/ffmpeg/#donations)

Expand Down
Loading
Loading