Skip to content

Commit

Permalink
cherrypick(release-1.4): stop relying on ubuntu stock ffmpeg
Browse files Browse the repository at this point in the history
Cherry-pick:
- PR microsoft#3882 SHA 430f2be

References microsoft#3845
  • Loading branch information
aslushnikov committed Sep 15, 2020
1 parent 8bc84ff commit 6cd8380
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/server/chromium/videoRecorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { assert } from '../../utils/utils';
import { launchProcess } from '../processLauncher';
import { Progress, runAbortableTask } from '../progress';
import * as types from '../types';
import { spawnAsync } from '../validateDependencies';

const fps = 25;

Expand Down Expand Up @@ -60,16 +59,12 @@ export class VideoRecorder {

let ffmpegPath = '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');
} else if (os.platform() === 'darwin') {
else if (os.platform() === 'darwin')
ffmpegPath = path.join(binPath, 'ffmpeg-mac');
} else {
// Look for ffmpeg in PATH.
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');
}
else
ffmpegPath = path.join(binPath, 'ffmpeg-linux');
const { launchedProcess, gracefullyClose } = await launchProcess({
executablePath: ffmpegPath,
args,
Expand Down
Binary file added third_party/ffmpeg/ffmpeg-linux
Binary file not shown.

0 comments on commit 6cd8380

Please sign in to comment.