MCPcopy Create free account
hub / github.com/Vanilagy/webcodecs-polyfill / canUseHwAccel

Function canUseHwAccel

src/video_encoder.ts:69–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67};
68
69const canUseHwAccel = () => {
70 if (os.platform() !== 'linux') {
71 return true; // Assume Windows/macOS work fine
72 }
73
74 // node-av downright crashes (with exit code 0, lol) if these aren't there, so we check ourselves
75 const paths = [
76 '/usr/lib/x86_64-linux-gnu/libva-drm.so.2',
77 '/usr/lib/libva-drm.so.2',
78 '/usr/lib/x86_64-linux-gnu/libcuda.so.1',
79 '/usr/lib/libcuda.so.1',
80 ];
81 return paths.some(p => fs.existsSync(p));
82};
83
84/**
85 * Encodes video frames into encoded chunks.

Callers 1

createCodecContextMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected