Skip to content

Commit

Permalink
Initial v3 setup
Browse files Browse the repository at this point in the history
  • Loading branch information
njoyard committed Nov 15, 2023
1 parent 4e02d12 commit ed00c50
Show file tree
Hide file tree
Showing 147 changed files with 3,422 additions and 40,054 deletions.
27 changes: 13 additions & 14 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,29 @@

## Reporting issues

Please start by [reading the FAQ][faq] first. If your question is not answered, here are some guidelines on how to effectively report issues.
Please start by [reading the FAQ][faq] first. If your question is not answered, here are some guidelines on how to effectively report issues.

### Required information

When reporting issues be sure to include at least:

* Some code that may be used to reproduce the problem
* Which version of fluent-ffmpeg, of ffmpeg and which OS you're using
* If the problem only happens with some input sources, please include a link to a source that may be used to reproduce the problem
* Be sure to include the full error message when there is one
* When an ffmpeg error happens (eg. 'ffmpeg exited with code 1'), you should also include the full output from ffmpeg (stdout and stderr), as it may contain useful information about what whent wrong. You can do that by looking at the 2nd and 3rd parameters of the `error` event handler on an FfmpegCommand, for example:
- Some code that may be used to reproduce the problem
- Which version of fluent-ffmpeg, of ffmpeg and which OS you're using
- If the problem only happens with some input sources, please include a link to a source that may be used to reproduce the problem
- Be sure to include the full error message when there is one
- When an ffmpeg error happens (eg. 'ffmpeg exited with code 1'), you should also include the full output from ffmpeg (stdout and stderr), as it may contain useful information about what whent wrong. You can do that by looking at the 2nd and 3rd parameters of the `error` event handler on an FfmpegCommand, for example:

```js
ffmpeg('some/input.mp4')
.on('error', function(err, stdout, stderr) {
console.log('An error happened: ' + err.message);
console.log('ffmpeg standard output:\n' + stdout);
console.log('ffmpeg standard error:\n' + stderr);
});
ffmpeg('some/input.mp4').on('error', function (err, stdout, stderr) {
console.log('An error happened: ' + err.message)
console.log('ffmpeg standard output:\n' + stdout)
console.log('ffmpeg standard error:\n' + stderr)
})
```

### Ffmpeg usage

If your command ends up with an ffmpeg error (eg. 'ffmpeg exited with code X : ...'), be sure to try the command manually from command line. You can get the ffmpeg command line that is executed for a specific Fluent-ffmpeg command by using the `start` event:
If your command ends up with an ffmpeg error (eg. 'ffmpeg exited with code X : ...'), be sure to try the command manually from command line. You can get the ffmpeg command line that is executed for a specific Fluent-ffmpeg command by using the `start` event:

```js
ffmpeg('some/input.mp4')
Expand All @@ -37,7 +36,7 @@ ffmpeg('some/input.mp4')

If it does not work, you most likely have a ffmpeg-related problem that does not fit as a fluent-ffmpeg issue; in that case head to the [ffmpeg documentation](ffmpeg.org/documentation.html) to find out what you did wrong.

If it _does_ work, please double-check how you escaped arguments and options when passing them to fluent-ffmpeg. For example, when running from command line, you may have to quote arguments to tell your shell that a space is indeed part of a filename or option. When using fluent-ffmpeg, you don't have to do that, as you're already passing options and arguments separately. Here's a (dumb) example:
If it _does_ work, please double-check how you escaped arguments and options when passing them to fluent-ffmpeg. For example, when running from command line, you may have to quote arguments to tell your shell that a space is indeed part of a filename or option. When using fluent-ffmpeg, you don't have to do that, as you're already passing options and arguments separately. Here's a (dumb) example:

```sh
$ ffmpeg -i video with spaces.avi
Expand Down
17 changes: 6 additions & 11 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,26 @@

### Version information

* fluent-ffmpeg version:
* ffmpeg version:
* OS:
- fluent-ffmpeg version:
- ffmpeg version:
- OS:

### Code to reproduce

```js


```

(note: if the problem only happens with some inputs, include a link to such an input file)

### Expected results



### Observed results



### Checklist

<!-- you may delete that checklist when you have checked everything -->

* [ ] I have read the [FAQ](https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/wiki/FAQ)
* [ ] I tried the same with command line ffmpeg and it works correctly (hint: if the problem also happens this way, this is an ffmpeg problem and you're not reporting it to the right place)
* [ ] I have included full stderr/stdout output from ffmpeg
- [ ] I have read the [FAQ](https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/wiki/FAQ)
- [ ] I tried the same with command line ffmpeg and it works correctly (hint: if the problem also happens this way, this is an ffmpeg problem and you're not reporting it to the right place)
- [ ] I have included full stderr/stdout output from ffmpeg
134 changes: 109 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,139 @@
name: CI Testing
name: Continuous integration
on:
pull_request:
push:
branches:
- master
pull_request:
jobs:
test:
name: Run tests
lint:
name: Lint source files
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v3
with:
cache: yarn

- name: Install dependencies
run: yarn

- name: Lint source files
run: yarn lint

unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v3
with:
cache: yarn

- name: Install dependencies
run: yarn

- name: Build
run: yarn build

- name: Run unit tests
run: yarn test tests/unit

- name: Upload coverage
uses: coverallsapp/github-action@v2
with:
parallel: true

integration-tests:
strategy:
matrix:
node: [18, 20, 21]
node:
- 18
- 20
name: Integration tests on Node ${{ matrix.node }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install flvtool2
run: sudo gem install flvtool2
- name: Install ffmpeg
run: sudo apt install -y ffmpeg

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn

- name: Install dependencies
run: yarn

- name: Build
run: yarn build

- name: Run tests
run: yarn test
- name: Generate coverage report
run: yarn coverage
- name: Store coveralls coverage
run: yarn test tests/integration

- name: Upload coverage
uses: coverallsapp/github-action@v2
with:
flag-name: linux-node-${{ matrix.node }}
parallel: true
- name: Upload to codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

acceptance-tests:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
node:
- 18
- 20
name: Acceptance with Node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn

- name: Install ffmpeg
uses: ConorMacBride/install-package@v1
with:
apt: ffmpeg
brew: ffmpeg
choco: ffmpeg

- name: Install dependencies
run: yarn

- name: Build
run: yarn build

- name: Run tests
run: yarn test tests/acceptance

- name: Upload coverage
uses: coverallsapp/github-action@v2
with:
files: coverage/lcov.info
name: ubuntu-latest-node-${{ matrix.node }}
parallel: true

upload-coverage:
name: Upload coverage
needs: test
finish-coverage:
name: Finalize coverage
needs:
- unit-tests
- integration-tests
- acceptance-tests
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Upload to coveralls
- name: Finalize coverage
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
carryforward: "linux-node-18,linux-node-20,linux-node-21"
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
*.project
node_modules

# Test output
.nyc_output
*.swp
.idea
*.iml
coverage

# Build output
build
docs
types
3 changes: 1 addition & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
*.md
.git*
test/
examples/
src/
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
coverage
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
semi: false
singleQuote: true
trailingComma: none
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# fluent-ffmpeg changelog

## Unreleased

### Breaking changes

- Complete API rewrite
- Drop support for Node.js < 18
- Drop support for flvtool/flvmeta
- Drop support for avconv/avprobe

### New features

- No dependencies
- Built-in typescript types

### Development

- Native typescript
- Use yarn for dependency management
- Use ava for the test suite
- Use sinon for mocks
- Use c8 for code coverage
- Use prettier for linting
- Use typedoc for documentation generation
- Use Github Actions for CI
- Use coveralls for coverage reports
- Drop FOSSA, useless since we have no runtime dependencies
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(The MIT License)

Copyright (c) 2011-2015 The fluent-ffmpeg contributors
Copyright (c) 2011-2023 The fluent-ffmpeg contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
20 changes: 0 additions & 20 deletions Makefile

This file was deleted.

Loading

0 comments on commit ed00c50

Please sign in to comment.