()
| 67 | }; |
| 68 | |
| 69 | const 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. |