Skip to content

Commit ffb4b56

Browse files
authored
Merge pull request #8 from Streampunk/master
Merge in latest beamcoder v0.6.15 GPL-3.0-or-later
2 parents ab226a7 + 5504d7b commit ffb4b56

18 files changed

+715
-727
lines changed

.circleci/config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ jobs:
99
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
1010
UV_THREADPOOL_SIZE: 16
1111
docker:
12-
- image: streampunkmedia/testbeam:10-4.1
12+
- image: streampunkmedia/testbeam:16-4.4
1313
steps:
1414
- checkout
1515
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
1616
- restore_cache:
1717
keys:
1818
# This branch if available
19-
- v1-dep-{{ .Branch }}-
19+
- v2-dep-{{ .Branch }}-
2020
# Default branch if not
21-
- v1-dep-master-
21+
- v2-dep-master-
2222
# Any branch if there are none on the default branch - this should be unnecessary if you have your default branch configured correctly
23-
- v1-dep-
23+
- v2-dep-
2424
- run: npm install tap-xunit
2525
- run: npm install --unsafe-perm
2626
- save_cache:
27-
key: v1-dep-{{ .Branch }}-{{ epoch }}
27+
key: v2-dep-{{ .Branch }}-{{ epoch }}
2828
paths:
2929
- ./node_modules
3030
- run: echo 'export PATH="~/Streampunk/beamcoder/node_modules/.bin:$PATH"' >> $BASH_ENV

.circleci/test_image/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM cimg/node:16.13
2+
3+
# install FFmpeg
4+
RUN sudo apt-get update \
5+
&& sudo apt-get install software-properties-common \
6+
&& sudo add-apt-repository ppa:savoury1/ffmpeg4 \
7+
&& sudo apt-get update \
8+
&& sudo apt-get upgrade && sudo apt-get dist-upgrade \
9+
&& sudo apt-get install libavcodec-dev libavformat-dev libavdevice-dev libavfilter-dev libavutil-dev libpostproc-dev libswresample-dev libswscale-dev
10+
11+
# delete all the apt list files since they're big and get stale quickly
12+
RUN sudo rm -rf /var/lib/apt/lists/*
13+
# this forces "apt-get update" in dependent images, which is also good

.circleci/test_image/build.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Instructions for building the CircleCI docker image for testing
2+
3+
- install docker desktop
4+
- cd to this directory
5+
- docker build -t streampunkmedia/testbeam:x-y.z .
6+
- run container locally to check build
7+
- push to Docker Hub
8+
- update config.yml to pull new version tag
9+
- push to git to trigger new build and test
10+
11+
(x: NodeAPI base version, y.z: FFmpeg build number)
12+
13+
See https://circleci.com/developer/images/image/cimg/node for CircleCI docker image tags

.vscode/c_cpp_properties.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"C:/Program Files (x86)/Windows Kits/8.1/Include/shared",
1010
"C:/Program Files (x86)/Windows Kits/8.1/Include/winrt",
1111
"${workspaceFolder}/**",
12-
"${workspaceFolder}/ffmpeg/ffmpeg-4.3.1-win64-shared/include/**",
13-
"${env:USERPROFILE}/AppData/Local/node-gyp/Cache/12.18.2/include/node"
12+
"${workspaceFolder}/ffmpeg/ffmpeg-4.x-win64-shared/include/**",
13+
"${env:USERPROFILE}/AppData/Local/node-gyp/Cache/12.21.0/include/node"
1414
],
1515
"defines": [
1616
"_DEBUG",

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,6 @@
5353
"xtr1common": "cpp",
5454
"xtree": "cpp",
5555
"xutility": "cpp"
56-
}
56+
},
57+
"cmake.configureOnOpen": false
5758
}

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ This will install all necessary dependencies, download the FFmpeg shared and dev
9292

9393
Note that if you want to use a local version of FFmpeg then, before the install, symbolic link or copy appropriate folders to:
9494

95-
./node_modules/beamcoder/ffmpeg/ffmpeg-4.1-win64-shared
96-
./node_modules/beamcoder/ffmpeg/ffmpeg-4.1-win64-dev
95+
./node_modules/beamcoder/ffmpeg/ffmpeg-4.x-win64-shared
9796

9897
To ensure that sufficient threads are available to process several requests in parallel, set the `UV_THREADPOOL_SIZE` environment variable, e.g.:
9998

binding.gyp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,30 +45,30 @@
4545
}
4646
},
4747
"include_dirs" : [
48-
"ffmpeg/ffmpeg-4.3-win64-shared/include"
48+
"ffmpeg/ffmpeg-4.x-win64-shared/include"
4949
],
5050
"libraries": [
51-
"-l../ffmpeg/ffmpeg-4.3-win64-shared/lib/avcodec",
52-
"-l../ffmpeg/ffmpeg-4.3-win64-shared/lib/avdevice",
53-
"-l../ffmpeg/ffmpeg-4.3-win64-shared/lib/avfilter",
54-
"-l../ffmpeg/ffmpeg-4.3-win64-shared/lib/avformat",
55-
"-l../ffmpeg/ffmpeg-4.3-win64-shared/lib/avutil",
56-
"-l../ffmpeg/ffmpeg-4.3-win64-shared/lib/postproc",
57-
"-l../ffmpeg/ffmpeg-4.3-win64-shared/lib/swresample",
58-
"-l../ffmpeg/ffmpeg-4.3-win64-shared/lib/swscale"
51+
"-l../ffmpeg/ffmpeg-4.x-win64-shared/lib/avcodec",
52+
"-l../ffmpeg/ffmpeg-4.x-win64-shared/lib/avdevice",
53+
"-l../ffmpeg/ffmpeg-4.x-win64-shared/lib/avfilter",
54+
"-l../ffmpeg/ffmpeg-4.x-win64-shared/lib/avformat",
55+
"-l../ffmpeg/ffmpeg-4.x-win64-shared/lib/avutil",
56+
"-l../ffmpeg/ffmpeg-4.x-win64-shared/lib/postproc",
57+
"-l../ffmpeg/ffmpeg-4.x-win64-shared/lib/swresample",
58+
"-l../ffmpeg/ffmpeg-4.x-win64-shared/lib/swscale"
5959
],
6060
"copies": [
6161
{
6262
"destination": "build/Release/",
6363
"files": [
64-
"ffmpeg/ffmpeg-4.3-win64-shared/bin/avcodec-58.dll",
65-
"ffmpeg/ffmpeg-4.3-win64-shared/bin/avdevice-58.dll",
66-
"ffmpeg/ffmpeg-4.3-win64-shared/bin/avfilter-7.dll",
67-
"ffmpeg/ffmpeg-4.3-win64-shared/bin/avformat-58.dll",
68-
"ffmpeg/ffmpeg-4.3-win64-shared/bin/avutil-56.dll",
69-
"ffmpeg/ffmpeg-4.3-win64-shared/bin/postproc-55.dll",
70-
"ffmpeg/ffmpeg-4.3-win64-shared/bin/swresample-3.dll",
71-
"ffmpeg/ffmpeg-4.3-win64-shared/bin/swscale-5.dll"
64+
"ffmpeg/ffmpeg-4.x-win64-shared/bin/avcodec-58.dll",
65+
"ffmpeg/ffmpeg-4.x-win64-shared/bin/avdevice-58.dll",
66+
"ffmpeg/ffmpeg-4.x-win64-shared/bin/avfilter-7.dll",
67+
"ffmpeg/ffmpeg-4.x-win64-shared/bin/avformat-58.dll",
68+
"ffmpeg/ffmpeg-4.x-win64-shared/bin/avutil-56.dll",
69+
"ffmpeg/ffmpeg-4.x-win64-shared/bin/postproc-55.dll",
70+
"ffmpeg/ffmpeg-4.x-win64-shared/bin/swresample-3.dll",
71+
"ffmpeg/ffmpeg-4.x-win64-shared/bin/swscale-5.dll"
7272
]
7373
}
7474
]

install_ffmpeg.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,16 @@ async function win32() {
100100
else throw e;
101101
});
102102

103-
const ffmpegFilename = 'ffmpeg-4.3-win64-shared';
103+
const ffmpegFilename = 'ffmpeg-4.x-win64-shared';
104104
await access(`ffmpeg/${ffmpegFilename}`, fs.constants.R_OK).catch(async () => {
105105
const html = await getHTML('https://github.com/BtbN/FFmpeg-Builds/wiki/Latest', 'latest autobuilds');
106106
const htmlStr = html.toString('utf-8');
107107
const autoPos = htmlStr.indexOf('<p><a href=');
108108
const endPos = htmlStr.indexOf('</div>', autoPos);
109109
const autoStr = htmlStr.substring(autoPos, endPos);
110-
const sharedEndPos = autoStr.lastIndexOf('">win64-gpl-shared-4.3');
110+
const sharedEndPos = autoStr.lastIndexOf('">win64-gpl-shared-4.');
111+
if (sharedEndPos === -1)
112+
throw new Error('Failed to find latest v4.x autobuild from "https://github.com/BtbN/FFmpeg-Builds/wiki/Latest"');
111113
const startStr = '<p><a href="';
112114
const sharedStartPos = autoStr.lastIndexOf(startStr, sharedEndPos) + startStr.length;
113115
const downloadSource = autoStr.substring(sharedStartPos, sharedEndPos);
@@ -212,7 +214,7 @@ case 'win32':
212214
console.error('Only 64-bit platforms are supported.');
213215
process.exit(1);
214216
} else {
215-
win32();
217+
win32().catch(console.error);
216218
}
217219
break;
218220
case 'linux':

0 commit comments

Comments
 (0)