Skip to content

Commit

Permalink
Merge pull request #8 from Streampunk/master
Browse files Browse the repository at this point in the history
Merge in latest beamcoder v0.6.15 GPL-3.0-or-later
  • Loading branch information
cvanwinkle authored Nov 10, 2021
2 parents ab226a7 + 5504d7b commit ffb4b56
Show file tree
Hide file tree
Showing 18 changed files with 715 additions and 727 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ jobs:
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
UV_THREADPOOL_SIZE: 16
docker:
- image: streampunkmedia/testbeam:10-4.1
- image: streampunkmedia/testbeam:16-4.4
steps:
- checkout
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
- restore_cache:
keys:
# This branch if available
- v1-dep-{{ .Branch }}-
- v2-dep-{{ .Branch }}-
# Default branch if not
- v1-dep-master-
- v2-dep-master-
# Any branch if there are none on the default branch - this should be unnecessary if you have your default branch configured correctly
- v1-dep-
- v2-dep-
- run: npm install tap-xunit
- run: npm install --unsafe-perm
- save_cache:
key: v1-dep-{{ .Branch }}-{{ epoch }}
key: v2-dep-{{ .Branch }}-{{ epoch }}
paths:
- ./node_modules
- run: echo 'export PATH="~/Streampunk/beamcoder/node_modules/.bin:$PATH"' >> $BASH_ENV
Expand Down
13 changes: 13 additions & 0 deletions .circleci/test_image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM cimg/node:16.13

# install FFmpeg
RUN sudo apt-get update \
&& sudo apt-get install software-properties-common \
&& sudo add-apt-repository ppa:savoury1/ffmpeg4 \
&& sudo apt-get update \
&& sudo apt-get upgrade && sudo apt-get dist-upgrade \
&& sudo apt-get install libavcodec-dev libavformat-dev libavdevice-dev libavfilter-dev libavutil-dev libpostproc-dev libswresample-dev libswscale-dev

# delete all the apt list files since they're big and get stale quickly
RUN sudo rm -rf /var/lib/apt/lists/*
# this forces "apt-get update" in dependent images, which is also good
13 changes: 13 additions & 0 deletions .circleci/test_image/build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Instructions for building the CircleCI docker image for testing

- install docker desktop
- cd to this directory
- docker build -t streampunkmedia/testbeam:x-y.z .
- run container locally to check build
- push to Docker Hub
- update config.yml to pull new version tag
- push to git to trigger new build and test

(x: NodeAPI base version, y.z: FFmpeg build number)

See https://circleci.com/developer/images/image/cimg/node for CircleCI docker image tags
4 changes: 2 additions & 2 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"C:/Program Files (x86)/Windows Kits/8.1/Include/shared",
"C:/Program Files (x86)/Windows Kits/8.1/Include/winrt",
"${workspaceFolder}/**",
"${workspaceFolder}/ffmpeg/ffmpeg-4.3.1-win64-shared/include/**",
"${env:USERPROFILE}/AppData/Local/node-gyp/Cache/12.18.2/include/node"
"${workspaceFolder}/ffmpeg/ffmpeg-4.x-win64-shared/include/**",
"${env:USERPROFILE}/AppData/Local/node-gyp/Cache/12.21.0/include/node"
],
"defines": [
"_DEBUG",
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,6 @@
"xtr1common": "cpp",
"xtree": "cpp",
"xutility": "cpp"
}
},
"cmake.configureOnOpen": false
}
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ This will install all necessary dependencies, download the FFmpeg shared and dev

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

./node_modules/beamcoder/ffmpeg/ffmpeg-4.1-win64-shared
./node_modules/beamcoder/ffmpeg/ffmpeg-4.1-win64-dev
./node_modules/beamcoder/ffmpeg/ffmpeg-4.x-win64-shared

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

Expand Down
34 changes: 17 additions & 17 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -45,30 +45,30 @@
}
},
"include_dirs" : [
"ffmpeg/ffmpeg-4.3-win64-shared/include"
"ffmpeg/ffmpeg-4.x-win64-shared/include"
],
"libraries": [
"-l../ffmpeg/ffmpeg-4.3-win64-shared/lib/avcodec",
"-l../ffmpeg/ffmpeg-4.3-win64-shared/lib/avdevice",
"-l../ffmpeg/ffmpeg-4.3-win64-shared/lib/avfilter",
"-l../ffmpeg/ffmpeg-4.3-win64-shared/lib/avformat",
"-l../ffmpeg/ffmpeg-4.3-win64-shared/lib/avutil",
"-l../ffmpeg/ffmpeg-4.3-win64-shared/lib/postproc",
"-l../ffmpeg/ffmpeg-4.3-win64-shared/lib/swresample",
"-l../ffmpeg/ffmpeg-4.3-win64-shared/lib/swscale"
"-l../ffmpeg/ffmpeg-4.x-win64-shared/lib/avcodec",
"-l../ffmpeg/ffmpeg-4.x-win64-shared/lib/avdevice",
"-l../ffmpeg/ffmpeg-4.x-win64-shared/lib/avfilter",
"-l../ffmpeg/ffmpeg-4.x-win64-shared/lib/avformat",
"-l../ffmpeg/ffmpeg-4.x-win64-shared/lib/avutil",
"-l../ffmpeg/ffmpeg-4.x-win64-shared/lib/postproc",
"-l../ffmpeg/ffmpeg-4.x-win64-shared/lib/swresample",
"-l../ffmpeg/ffmpeg-4.x-win64-shared/lib/swscale"
],
"copies": [
{
"destination": "build/Release/",
"files": [
"ffmpeg/ffmpeg-4.3-win64-shared/bin/avcodec-58.dll",
"ffmpeg/ffmpeg-4.3-win64-shared/bin/avdevice-58.dll",
"ffmpeg/ffmpeg-4.3-win64-shared/bin/avfilter-7.dll",
"ffmpeg/ffmpeg-4.3-win64-shared/bin/avformat-58.dll",
"ffmpeg/ffmpeg-4.3-win64-shared/bin/avutil-56.dll",
"ffmpeg/ffmpeg-4.3-win64-shared/bin/postproc-55.dll",
"ffmpeg/ffmpeg-4.3-win64-shared/bin/swresample-3.dll",
"ffmpeg/ffmpeg-4.3-win64-shared/bin/swscale-5.dll"
"ffmpeg/ffmpeg-4.x-win64-shared/bin/avcodec-58.dll",
"ffmpeg/ffmpeg-4.x-win64-shared/bin/avdevice-58.dll",
"ffmpeg/ffmpeg-4.x-win64-shared/bin/avfilter-7.dll",
"ffmpeg/ffmpeg-4.x-win64-shared/bin/avformat-58.dll",
"ffmpeg/ffmpeg-4.x-win64-shared/bin/avutil-56.dll",
"ffmpeg/ffmpeg-4.x-win64-shared/bin/postproc-55.dll",
"ffmpeg/ffmpeg-4.x-win64-shared/bin/swresample-3.dll",
"ffmpeg/ffmpeg-4.x-win64-shared/bin/swscale-5.dll"
]
}
]
Expand Down
8 changes: 5 additions & 3 deletions install_ffmpeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,16 @@ async function win32() {
else throw e;
});

const ffmpegFilename = 'ffmpeg-4.3-win64-shared';
const ffmpegFilename = 'ffmpeg-4.x-win64-shared';
await access(`ffmpeg/${ffmpegFilename}`, fs.constants.R_OK).catch(async () => {
const html = await getHTML('https://github.com/BtbN/FFmpeg-Builds/wiki/Latest', 'latest autobuilds');
const htmlStr = html.toString('utf-8');
const autoPos = htmlStr.indexOf('<p><a href=');
const endPos = htmlStr.indexOf('</div>', autoPos);
const autoStr = htmlStr.substring(autoPos, endPos);
const sharedEndPos = autoStr.lastIndexOf('">win64-gpl-shared-4.3');
const sharedEndPos = autoStr.lastIndexOf('">win64-gpl-shared-4.');
if (sharedEndPos === -1)
throw new Error('Failed to find latest v4.x autobuild from "https://github.com/BtbN/FFmpeg-Builds/wiki/Latest"');
const startStr = '<p><a href="';
const sharedStartPos = autoStr.lastIndexOf(startStr, sharedEndPos) + startStr.length;
const downloadSource = autoStr.substring(sharedStartPos, sharedEndPos);
Expand Down Expand Up @@ -212,7 +214,7 @@ case 'win32':
console.error('Only 64-bit platforms are supported.');
process.exit(1);
} else {
win32();
win32().catch(console.error);
}
break;
case 'linux':
Expand Down
Loading

0 comments on commit ffb4b56

Please sign in to comment.