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 13, 2023
1 parent b092615 commit b5c64fb
Show file tree
Hide file tree
Showing 136 changed files with 2,339 additions and 40,077 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
101 changes: 74 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,95 @@
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: codecov/codecov-action@v3
with:
files: coverage/lcov.info
name: unit

test:
strategy:
matrix:
node: [18, 20, 21]
os:
- ubuntu-latest
- macos-latest
- windows-latest
node:
- 18
- 20
name: Test Node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
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 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
- name: Generate coverage report
run: yarn coverage
- name: Store coverage
uses: coverallsapp/github-action@v2
with:
flag-name: linux-node-${{ matrix.node }}
parallel: true
run: yarn test tests/integration

upload-coverage:
name: Upload coverage
needs: test
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
parallel-finished: true
carryforward: "linux-node-18,linux-node-20,linux-node-21"
files: coverage/lcov.info
name: integration/${{ matrix.os }}/node-${{ matrix.node }}
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
*.project
build
coverage
node_modules
.nyc_output
*.swp
.idea
*.iml
coverage
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
20 changes: 0 additions & 20 deletions Makefile

This file was deleted.

Loading

0 comments on commit b5c64fb

Please sign in to comment.