Skip to content

Commit ed00c50

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

File tree

147 files changed

+3422
-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.

147 files changed

+3422
-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

+109-25
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,139 @@
1-
name: CI Testing
1+
name: Continuous integration
22
on:
3-
pull_request:
43
push:
54
branches:
65
- master
6+
pull_request:
77
jobs:
8-
test:
9-
name: Run tests
8+
lint:
9+
name: Lint source files
1010
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Setup node
16+
uses: actions/setup-node@v3
17+
with:
18+
cache: yarn
19+
20+
- name: Install dependencies
21+
run: yarn
22+
23+
- name: Lint source files
24+
run: yarn lint
25+
26+
unit-tests:
27+
name: Unit tests
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Setup node
34+
uses: actions/setup-node@v3
35+
with:
36+
cache: yarn
37+
38+
- name: Install dependencies
39+
run: yarn
40+
41+
- name: Build
42+
run: yarn build
43+
44+
- name: Run unit tests
45+
run: yarn test tests/unit
46+
47+
- name: Upload coverage
48+
uses: coverallsapp/github-action@v2
49+
with:
50+
parallel: true
51+
52+
integration-tests:
1153
strategy:
1254
matrix:
13-
node: [18, 20, 21]
55+
node:
56+
- 18
57+
- 20
58+
name: Integration tests on Node ${{ matrix.node }}
59+
runs-on: ubuntu-latest
1460
steps:
1561
- name: Checkout
1662
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
63+
2164
- name: Setup node
2265
uses: actions/setup-node@v3
2366
with:
2467
node-version: ${{ matrix.node }}
2568
cache: yarn
69+
2670
- name: Install dependencies
2771
run: yarn
72+
73+
- name: Build
74+
run: yarn build
75+
2876
- name: Run tests
29-
run: yarn test
30-
- name: Generate coverage report
31-
run: yarn coverage
32-
- name: Store coveralls coverage
77+
run: yarn test tests/integration
78+
79+
- name: Upload coverage
3380
uses: coverallsapp/github-action@v2
3481
with:
35-
flag-name: linux-node-${{ matrix.node }}
3682
parallel: true
37-
- name: Upload to codecov
38-
uses: codecov/codecov-action@v3
39-
env:
40-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
83+
84+
acceptance-tests:
85+
strategy:
86+
matrix:
87+
os:
88+
- ubuntu-latest
89+
- macos-latest
90+
- windows-latest
91+
node:
92+
- 18
93+
- 20
94+
name: Acceptance with Node ${{ matrix.node }} on ${{ matrix.os }}
95+
runs-on: ${{ matrix.os }}
96+
steps:
97+
- name: Checkout
98+
uses: actions/checkout@v4
99+
100+
- name: Setup node
101+
uses: actions/setup-node@v3
102+
with:
103+
node-version: ${{ matrix.node }}
104+
cache: yarn
105+
106+
- name: Install ffmpeg
107+
uses: ConorMacBride/install-package@v1
108+
with:
109+
apt: ffmpeg
110+
brew: ffmpeg
111+
choco: ffmpeg
112+
113+
- name: Install dependencies
114+
run: yarn
115+
116+
- name: Build
117+
run: yarn build
118+
119+
- name: Run tests
120+
run: yarn test tests/acceptance
121+
122+
- name: Upload coverage
123+
uses: coverallsapp/github-action@v2
41124
with:
42-
files: coverage/lcov.info
43-
name: ubuntu-latest-node-${{ matrix.node }}
125+
parallel: true
44126

45-
upload-coverage:
46-
name: Upload coverage
47-
needs: test
127+
finish-coverage:
128+
name: Finalize coverage
129+
needs:
130+
- unit-tests
131+
- integration-tests
132+
- acceptance-tests
48133
if: ${{ always() }}
49134
runs-on: ubuntu-latest
50135
steps:
51-
- name: Upload to coveralls
136+
- name: Finalize coverage
52137
uses: coverallsapp/github-action@v2
53138
with:
54139
parallel-finished: true
55-
carryforward: "linux-node-18,linux-node-20,linux-node-21"

.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)