@homebridge/camera-utils
Version:
Utilities to simplify homebridge camera plugin development
22 lines • 718 B
JavaScript
import { execa } from 'execa';
import ffmpegForHomebridgePath from 'ffmpeg-for-homebridge';
export const defaultFfmpegPath = ffmpegForHomebridgePath || 'ffmpeg';
export async function doesFfmpegSupportCodec(codec, ffmpegPath = defaultFfmpegPath) {
try {
const { stdout } = await execa(ffmpegPath, ['-codecs']);
return stdout.includes(codec);
}
catch (error) {
throw new Error(`FFmpeg not found at path: ${ffmpegPath}, error: ${error}`);
}
}
export async function isFfmpegInstalled(ffmpegPath = defaultFfmpegPath) {
try {
await execa(ffmpegPath, ['-codecs']);
return true;
}
catch (_) {
return false;
}
}
//# sourceMappingURL=ffmpeg.js.map