feat(media): live video --input — a film, a webcam or an IP camera without writing the ffmpeg line
`shade live video` needed a hand-written ffmpeg pipeline. --input <file | /dev/video0 | rtsp://…> probes the source and runs ffmpeg itself: H.264 and AAC are copied (a camera's own encoder, no CPU), anything else becomes H.264 with a keyframe every 2 s whatever the frame rate (where late joiners start) and AAC (>6 channels downmixed to 5.1), out as low-latency fragmented MP4. A file is paced (-re) as if live; RTSP goes over TCP; /dev/videoN opens as v4l2. ffmpeg's failure is reported with its own last lines. Verified: liveEncodePlan unit tests (copy, encode, pacing, RTSP/v4l2, audio-only, nothing-to-send); Chromium through the relay: VP9/Opus WebM encoded → live H.264/AAC, keyframe every 4th 0.5 s fragment, 0.96 s latency; H.264/AAC MKV copied, 1.8 s latency. Media suite 97/0. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -66,6 +66,9 @@ New package **`@shade/media`** — see `docs/media.md`.
|
||||
`PostgresLivePinStore`, `createSharedMediaBackend` in
|
||||
`@shade/storage-postgres`. A live pin can no longer change key, even between
|
||||
instances (`LivePinTakenError`).
|
||||
- **`shade live video --input`** a film, `/dev/video0` or `rtsp://…`: ffmpeg is
|
||||
run for you, H.264/AAC copied (a camera's own encoder) and anything else
|
||||
encoded to H.264 (keyframe every 2 s) and AAC, as low-latency fMP4.
|
||||
- **`shade live images`.** A channel of pictures: JPEG/PNG piped in (a
|
||||
webcam through `ffmpeg -f image2pipe`), a slideshow of files, or each new
|
||||
picture landing in a watched folder. `ImageStreamSplitter` walks JPEG
|
||||
|
||||
Reference in New Issue
Block a user