@mega-yfue/eufy-sdk / captureSnapshotFromShared
Function: captureSnapshotFromShared()
function captureSnapshotFromShared(source, opts?): Promise<{
height: number;
jpeg: Buffer;
width: number;
}>;Live snapshot off a SHARED source (V6) — snapshot as just another consumer of the shared live pull. If the source is already warm and has a cached keyframe (V2 keyframe-prime), the joining consumer receives that IDR immediately and we decode it with no extra pull — a snapshot while someone else watches costs nothing on the wire. Otherwise we warm the source and wait for a clean keyframe (the first IDR after a cold start is frequently partial, so skip it by default). Requires ffmpeg for the Annex-B → JPEG decode.
The returned dimensions are the ENCODED IMAGE's own, read back out of it — never the frame header's. The header states the stream's geometry when the capture started, and a stream that reconfigures mid-burst leaves it describing something the returned bytes contradict; the return value describes an image, so the image is its source of truth.
Parameters
source
opts?
collectMs?
number
ffmpegLevel?
| "debug" | "info" | "error" | "quiet" | "panic" | "fatal" | "warning" | "verbose" | "trace"
ffmpegPath?
string
logger?
skipKeyframes?
number
timeoutMs?
number
Returns
Promise<{ height: number; jpeg: Buffer; width: number; }>