cherrypick(release-1.4): stop relying on ubuntu stock ffmpeg (#3894)
Cherry-pick:
- PR #3882 SHA 430f2bedaa
References #3845
This commit is contained in:
parent
8bc84ff349
commit
bf97758cf2
|
|
@ -21,7 +21,6 @@ import { assert } from '../../utils/utils';
|
||||||
import { launchProcess } from '../processLauncher';
|
import { launchProcess } from '../processLauncher';
|
||||||
import { Progress, runAbortableTask } from '../progress';
|
import { Progress, runAbortableTask } from '../progress';
|
||||||
import * as types from '../types';
|
import * as types from '../types';
|
||||||
import { spawnAsync } from '../validateDependencies';
|
|
||||||
|
|
||||||
const fps = 25;
|
const fps = 25;
|
||||||
|
|
||||||
|
|
@ -60,16 +59,12 @@ export class VideoRecorder {
|
||||||
|
|
||||||
let ffmpegPath = 'ffmpeg';
|
let ffmpegPath = 'ffmpeg';
|
||||||
const binPath = path.join(__dirname, '../../../third_party/ffmpeg/');
|
const binPath = path.join(__dirname, '../../../third_party/ffmpeg/');
|
||||||
if (os.platform() === 'win32') {
|
if (os.platform() === 'win32')
|
||||||
ffmpegPath = path.join(binPath, os.arch() === 'x64' ? 'ffmpeg-win64.exe' : 'ffmpeg-win32.exe');
|
ffmpegPath = path.join(binPath, os.arch() === 'x64' ? 'ffmpeg-win64.exe' : 'ffmpeg-win32.exe');
|
||||||
} else if (os.platform() === 'darwin') {
|
else if (os.platform() === 'darwin')
|
||||||
ffmpegPath = path.join(binPath, 'ffmpeg-mac');
|
ffmpegPath = path.join(binPath, 'ffmpeg-mac');
|
||||||
} else {
|
else
|
||||||
// Look for ffmpeg in PATH.
|
ffmpegPath = path.join(binPath, 'ffmpeg-linux');
|
||||||
const {code, error} = await spawnAsync(ffmpegPath, ['-version'], {});
|
|
||||||
if (code !== 0 || error)
|
|
||||||
throw new Error('ffmpeg not found.\nInstall missing packages with:\n sudo apt-get install ffmpeg');
|
|
||||||
}
|
|
||||||
const { launchedProcess, gracefullyClose } = await launchProcess({
|
const { launchedProcess, gracefullyClose } = await launchProcess({
|
||||||
executablePath: ffmpegPath,
|
executablePath: ffmpegPath,
|
||||||
args,
|
args,
|
||||||
|
|
|
||||||
BIN
third_party/ffmpeg/ffmpeg-linux
vendored
Executable file
BIN
third_party/ffmpeg/ffmpeg-linux
vendored
Executable file
Binary file not shown.
Loading…
Reference in a new issue