github steveseguin/electroncapture 2.21.0
Application audio capture (windows) + lossless encoder

pre-releaseone day ago

This is an experimental release. 🧪

  • application audio capture (windows)
  • tried increased the maximum and minimum allowed video encoder quality
  • h265 video encoder support enabled
  • more command line parameters (see audio application branch's readme for details)
  • chromium engine updated to more secure stable version that still supports transparencies
  • experimental nvenc support enabled. *see below for my personal notes on this all

When using the app in Administrator Mode + Elevated Privileges Mode (node-integration enabled via --node), the app can capture isolated window-audio within Windows; not just system audio. https://vdo.ninja/alpha/ as well needed

Why this release is awesome? Well, it makes screen capture more powerful, without needing OBS and virtual audio cables. A better more-refined version is coming, but consider this a test version.

Windows-only audio capture. Linux support is untested, but I tried to add lossless encoding support also. Mac support is absent.

🎈

* Technical notes on the NVEnc logic

Requirements: Hardware acceleration must stay enabled in Electron (do not call app.disableHardwareAcceleration()), and the process must run on a machine with an NVENC-capable GPU + recent driver. Windows only. (NOT LINUX; NOT MAC)

MediaRecorder

  • Blink routes MediaRecorder video through the GPU VideoEncodeAcceleratorAdapter, which picks the hardware encoder when it is allowed. That adapter talks to the GPU process, so on Windows it lands on the NVENC-backed Media Foundation MFT.
  • Request an NVENC-friendly codec (H.264 or HEVC). Example:
    const mimeType = 'video/mp4;codecs="avc1.640028"';
    if (!MediaRecorder.isTypeSupported(mimeType)) throw new Error('H.264 not enabled');
    const recorder = new MediaRecorder(stream, {
      mimeType,
      videoBitsPerSecond: 20_000_000, // drives the QP floor from our patch
    });
  • Inspect chrome://media-internals while recording: the entry should show VideoEncoder as GpuVideoAccelerator/
    MediaFoundationVideoEncodeAccelerator with Implementation: Hardware. If it falls back to software, lower the resolution/bitrate or
    confirm the GPU driver exposes H.264 export.

WebCodecs VideoEncoder

  • WebCodecs uses the same accelerator adapter when hardwareAcceleration is 'prefer-hardware' or 'require-hardware'.
  • Configure H.264/HEVC (or AV1 if your board exposes NVENC AV1) and check support before starting:
    const config = {
      codec: 'avc1.640028',
      width,
      height,
      bitrate: 15_000_000,
      framerate: 60,
      hardwareAcceleration: 'require-hardware',
    };
    const {supported, config: resolved} = await VideoEncoder.isConfigSupported(config);
    if (!supported) throw new Error(resolved.notSupportedErrorMessage);
    const encoder = new VideoEncoder({
      output: chunk => {/* ... */},
      error: e => console.error(e),
    });
    encoder.configure(resolved.config);
  • Call encoder.encode and watch encoder.flush(). During runtime, encoder.encodeQueueSize should stay low; encoder.ondequeue events expose metadata.encoderImplementation (expect media::VideoEncodeAccelerator or similar). If support comes back unsupported, NVENC isn’t exposed for that profile/driver combo.

WebRTC (RTCPeerConnection / getUserMedia)

  • WebRTC consults the GPU factories to enumerate hardware encoder profiles. When H.264/HEVC is available, it prefers the hardware-backed implementation.
  • To force H.264 so the NVENC path is selected:
    const pc = new RTCPeerConnection();
    const sender = pc.addTrack(stream.getVideoTracks()[0], stream);
    const h264 = RTCRtpSender.getCapabilities('video').codecs
                   .filter(c => c.mimeType === 'video/H264');
    sender.setCodecPreferences(h264);
  • After the call starts, open chrome://webrtc-internals, locate your peer connection, and check videoEncoderImplementationName or
    EncoderImplementation. It should report Hardware (on recent Chromium builds it will say MediaFoundationVideoEncoder with vendor
    NVIDIA). The quantizer telemetry should reflect the patched 0–20 window.
  • If you see software implementations, confirm the capture format is supported (NVENC blocks some odd frame sizes), the bitrate isn’t
    set below a couple of Mbps, and no SDP munging reorders codecs back to VP8/VP9.

Don't miss a new electroncapture release

NewReleases is sending notifications on new releases.