Skip to content

Commit 85c8af8

Browse files
Updating install script
1 parent 4ba327c commit 85c8af8

File tree

2 files changed

+3
-60
lines changed

2 files changed

+3
-60
lines changed

.github/workflows/prebuild.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ jobs:
1616
shell: bash
1717
run: |
1818
apt update
19-
DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends --no-install-suggests -y git git-lfs \
19+
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --no-install-suggests -y git git-lfs \
2020
libxcb1 unzip nodejs curl nodejs npm python3-setuptools build-essential libxcb1-dev
21+
DEBIAN_FRONTEND=noninteractive apt-get install libavcodec-dev libavformat-dev libavdevice-dev libavfilter-dev libavutil-dev libpostproc-dev libswresample-dev libswscale-dev libzimg-dev
2122
2223
- uses: actions/checkout@v2
2324
with:

install_ffmpeg.js

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -131,63 +131,6 @@ async function win32() {
131131
}
132132

133133
async function linux() {
134-
console.log('Checking/downloading ffmpeg shared libraries');
135-
136-
await mkdir('ffmpeg').catch(e => {
137-
if (e.code === 'EEXIST') return;
138-
else throw e;
139-
});
140-
141-
const version = '1.49.rc.1';
142-
143-
// default to platform-architecture
144-
let arch = os.arch();
145-
146-
// but if the '--arch' argument is provided
147-
// use the next argument as the value (e.g. 'x64' or 'arm64')
148-
const overrideArchIndex = process.argv.indexOf('--arch');
149-
if (0 < overrideArchIndex && overrideArchIndex < process.argv.length - 1) {
150-
arch = process.argv[overrideArchIndex + 1];
151-
}
152-
153-
if (arch === 'x64') {
154-
arch = 'x86_64';
155-
}
156-
157-
const ffmpegFilename = `ffmpeg-ffprobe-shared-linux-${arch}.${version}`;
158-
const tag = `v${version}`;
159-
160-
await access(`ffmpeg/${ffmpegFilename}`, fs.constants.R_OK).catch(async () => {
161-
const ws = fs.createWriteStream(`ffmpeg/${ffmpegFilename}.tar.gz`);
162-
const url = `https://github.com/descriptinc/ffmpeg-build-script/releases/download/${tag}/${ffmpegFilename}.tar.gz`
163-
console.log(url);
164-
await get(
165-
ws,
166-
url,
167-
`${ffmpegFilename}.tar.gz`
168-
).catch(async (err) => {
169-
if (err.name === 'RedirectError') {
170-
const redirectURL = err.message;
171-
await get(ws, redirectURL, `${ffmpegFilename}.tar.gz`);
172-
} else {
173-
console.error(err);
174-
throw err;
175-
}
176-
});
177-
178-
await mkdir(`ffmpeg/${ffmpegFilename}`).catch(e => {
179-
if (e.code === 'EEXIST') return;
180-
else throw e;
181-
});
182-
183-
await exec(`tar xvzf ffmpeg/${ffmpegFilename}.tar.gz -C ffmpeg/${ffmpegFilename}/`);
184-
185-
console.log(`Adding path "$PWD/ffmpeg/${ffmpegFilename}/" to ldconfig path`);
186-
await exec(`echo "$PWD/ffmpeg/${ffmpegFilename}/" | tee -a /etc/ld.so.conf.d/ffmpeg.conf`)
187-
console.log('Running LDCONFIG');
188-
await exec(`ldconfig`)
189-
});
190-
191134
console.log('Checking FFmpeg dependencies for Beam Coder on Linux.');
192135
const { stdout } = await execFile('ldconfig', ['-p']).catch(console.error);
193136
let result = 0;
@@ -231,8 +174,7 @@ async function linux() {
231174

232175
if (result === 1) {
233176
console.log(`Try running the following (Ubuntu/Debian):
234-
sudo add-apt-repository ppa:savoury1/ffmpeg4
235-
sudo apt-get install libavcodec-dev libavformat-dev libavdevice-dev libavfilter-dev libavutil-dev libpostproc-dev libswresample-dev libswscale-dev libzimg-dev`);
177+
sudo apt-get install libavcodec-dev libavformat-dev libavdevice-dev libavfilter-dev libavutil-dev libpostproc-dev libswresample-dev libswscale-dev libzimg-dev`);
236178
process.exit(1);
237179
}
238180
return result;

0 commit comments

Comments
 (0)