Skip to content

Commit a982927

Browse files
committed
Initial v3 setup
1 parent 4e02d12 commit a982927

File tree

149 files changed

+3692
-40054
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+3692
-40054
lines changed

.github/CONTRIBUTING.md

+13-14
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,29 @@
22

33
## Reporting issues
44

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

77
### Required information
88

99
When reporting issues be sure to include at least:
1010

11-
* Some code that may be used to reproduce the problem
12-
* Which version of fluent-ffmpeg, of ffmpeg and which OS you're using
13-
* If the problem only happens with some input sources, please include a link to a source that may be used to reproduce the problem
14-
* Be sure to include the full error message when there is one
15-
* 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:
11+
- Some code that may be used to reproduce the problem
12+
- Which version of fluent-ffmpeg, of ffmpeg and which OS you're using
13+
- If the problem only happens with some input sources, please include a link to a source that may be used to reproduce the problem
14+
- Be sure to include the full error message when there is one
15+
- 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:
1616

1717
```js
18-
ffmpeg('some/input.mp4')
19-
.on('error', function(err, stdout, stderr) {
20-
console.log('An error happened: ' + err.message);
21-
console.log('ffmpeg standard output:\n' + stdout);
22-
console.log('ffmpeg standard error:\n' + stderr);
23-
});
18+
ffmpeg('some/input.mp4').on('error', function (err, stdout, stderr) {
19+
console.log('An error happened: ' + err.message)
20+
console.log('ffmpeg standard output:\n' + stdout)
21+
console.log('ffmpeg standard error:\n' + stderr)
22+
})
2423
```
2524

2625
### Ffmpeg usage
2726

28-
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:
27+
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:
2928

3029
```js
3130
ffmpeg('some/input.mp4')
@@ -37,7 +36,7 @@ ffmpeg('some/input.mp4')
3736

3837
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.
3938

40-
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:
39+
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:
4140

4241
```sh
4342
$ ffmpeg -i video with spaces.avi

.github/ISSUE_TEMPLATE.md

+6-11
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,26 @@
22

33
### Version information
44

5-
* fluent-ffmpeg version:
6-
* ffmpeg version:
7-
* OS:
5+
- fluent-ffmpeg version:
6+
- ffmpeg version:
7+
- OS:
88

99
### Code to reproduce
1010

1111
```js
1212

13-
1413
```
1514

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

1817
### Expected results
1918

20-
21-
2219
### Observed results
2320

24-
25-
2621
### Checklist
2722

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

30-
* [ ] I have read the [FAQ](https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/wiki/FAQ)
31-
* [ ] 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)
32-
* [ ] I have included full stderr/stdout output from ffmpeg
25+
- [ ] I have read the [FAQ](https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/wiki/FAQ)
26+
- [ ] 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)
27+
- [ ] I have included full stderr/stdout output from ffmpeg

.github/workflows/ci.yml

+111-25
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,141 @@
1-
name: CI Testing
1+
name: Continuous integration
2+
23
on:
3-
pull_request:
44
push:
55
branches:
66
- master
7+
pull_request:
8+
79
jobs:
8-
test:
9-
name: Run tests
10+
lint:
11+
name: Lint source files
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup node
18+
uses: actions/setup-node@v3
19+
with:
20+
cache: yarn
21+
22+
- name: Install dependencies
23+
run: yarn
24+
25+
- name: Lint source files
26+
run: yarn lint
27+
28+
unit-tests:
29+
name: Unit tests
1030
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
35+
- name: Setup node
36+
uses: actions/setup-node@v3
37+
with:
38+
cache: yarn
39+
40+
- name: Install dependencies
41+
run: yarn
42+
43+
- name: Build
44+
run: yarn build
45+
46+
- name: Run unit tests
47+
run: yarn test tests/unit
48+
49+
- name: Upload coverage
50+
uses: coverallsapp/github-action@v2
51+
with:
52+
parallel: true
53+
54+
integration-tests:
1155
strategy:
1256
matrix:
13-
node: [18, 20, 21]
57+
node:
58+
- 18
59+
- 20
60+
name: Integration tests on Node ${{ matrix.node }}
61+
runs-on: ubuntu-latest
1462
steps:
1563
- name: Checkout
1664
uses: actions/checkout@v4
17-
- name: Install flvtool2
18-
run: sudo gem install flvtool2
19-
- name: Install ffmpeg
20-
run: sudo apt install -y ffmpeg
65+
2166
- name: Setup node
2267
uses: actions/setup-node@v3
2368
with:
2469
node-version: ${{ matrix.node }}
2570
cache: yarn
71+
2672
- name: Install dependencies
2773
run: yarn
74+
75+
- name: Build
76+
run: yarn build
77+
2878
- name: Run tests
29-
run: yarn test
30-
- name: Generate coverage report
31-
run: yarn coverage
32-
- name: Store coveralls coverage
79+
run: yarn test tests/integration
80+
81+
- name: Upload coverage
3382
uses: coverallsapp/github-action@v2
3483
with:
35-
flag-name: linux-node-${{ matrix.node }}
3684
parallel: true
37-
- name: Upload to codecov
38-
uses: codecov/codecov-action@v3
39-
env:
40-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
85+
86+
acceptance-tests:
87+
strategy:
88+
matrix:
89+
os:
90+
- ubuntu-latest
91+
- macos-latest
92+
- windows-latest
93+
node:
94+
- 18
95+
- 20
96+
name: Acceptance with Node ${{ matrix.node }} on ${{ matrix.os }}
97+
runs-on: ${{ matrix.os }}
98+
steps:
99+
- name: Checkout
100+
uses: actions/checkout@v4
101+
102+
- name: Setup node
103+
uses: actions/setup-node@v3
104+
with:
105+
node-version: ${{ matrix.node }}
106+
cache: yarn
107+
108+
- name: Install ffmpeg
109+
uses: ConorMacBride/install-package@v1
110+
with:
111+
apt: ffmpeg
112+
brew: ffmpeg
113+
choco: ffmpeg
114+
115+
- name: Install dependencies
116+
run: yarn
117+
118+
- name: Build
119+
run: yarn build
120+
121+
- name: Run tests
122+
run: yarn test tests/acceptance
123+
124+
- name: Upload coverage
125+
uses: coverallsapp/github-action@v2
41126
with:
42-
files: coverage/lcov.info
43-
name: ubuntu-latest-node-${{ matrix.node }}
127+
parallel: true
44128

45-
upload-coverage:
46-
name: Upload coverage
47-
needs: test
129+
finish-coverage:
130+
name: Finalize coverage
131+
needs:
132+
- unit-tests
133+
- integration-tests
134+
- acceptance-tests
48135
if: ${{ always() }}
49136
runs-on: ubuntu-latest
50137
steps:
51-
- name: Upload to coveralls
138+
- name: Finalize coverage
52139
uses: coverallsapp/github-action@v2
53140
with:
54141
parallel-finished: true
55-
carryforward: "linux-node-18,linux-node-20,linux-node-21"

.github/workflows/release.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types:
6+
- released
7+
8+
jobs:
9+
publish:
10+
name: Publish package
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Extract version from package.json
17+
run: |
18+
PACKAGE_JSON_VERSION=$(cat package.json | jq .version)
19+
echo "PACKAGE_JSON_VERSION=$PACKAGE_JSON_VERSION" >> $GITHUB_ENV
20+
echo "EXPECTED_REF=refs/tags/v$PACKAGE_JSON_VERSION" >> $GITHUB_ENV
21+
22+
- name: Check version matches tag
23+
if: ${{ env.EXPECTED_REF != github.ref }}
24+
run: |
25+
echo "Tag ${{ github.ref }} does not match package.json version ${{ env.PACKAGE_JSON_VERSION }}"
26+
exit 1
27+
28+
- name: Setup node
29+
uses: actions/setup-node@v3
30+
with:
31+
node-version: 18
32+
cache: yarn
33+
34+
- name: Install dependencies
35+
run: yarn
36+
37+
- name: Build
38+
run: yarn build
39+
40+
- name: Publish
41+
run: yarn publish --new-version ${{ env.PACKAGE_JSON_VERSION }}
42+
env:
43+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
*.project
21
node_modules
2+
3+
# Test output
34
.nyc_output
4-
*.swp
5-
.idea
6-
*.iml
75
coverage
6+
7+
# Build output
8+
build
9+
docs
10+
types

.npmignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
*.md
21
.git*
32
test/
4-
examples/
3+
src/

.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build
2+
coverage

.prettierrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
semi: false
2+
singleQuote: true
3+
trailingComma: none

CHANGELOG.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# fluent-ffmpeg changelog
2+
3+
## Unreleased
4+
5+
### Breaking changes
6+
7+
- Complete API rewrite
8+
- Drop support for Node.js < 18
9+
- Drop support for flvtool/flvmeta
10+
- Drop support for avconv/avprobe
11+
12+
### New features
13+
14+
- No dependencies
15+
- Built-in typescript types
16+
17+
### Development
18+
19+
- Native typescript
20+
- Use yarn for dependency management
21+
- Use ava for the test suite
22+
- Use sinon for mocks
23+
- Use c8 for code coverage
24+
- Use prettier for linting
25+
- Use typedoc for documentation generation
26+
- Use Github Actions for CI
27+
- Use coveralls for coverage reports
28+
- Drop FOSSA, useless since we have no runtime dependencies

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(The MIT License)
22

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

55
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:
66

Makefile

-20
This file was deleted.

0 commit comments

Comments
 (0)