diff options
| author | Mel <mel@rnrd.eu> | 2025-05-01 05:04:54 +0200 |
|---|---|---|
| committer | Mel <mel@rnrd.eu> | 2025-05-01 05:04:54 +0200 |
| commit | d3ebb82f12969ffca03d4c6927330d8aa3b3de01 (patch) | |
| tree | 52b05b041d796ba976380455d2a0defd0ee995ef /modules/go2rtc.nix | |
| parent | cee18d9ba59b96087854f4c50474842c04b40105 (diff) | |
| download | network-d3ebb82f12969ffca03d4c6927330d8aa3b3de01.tar.zst network-d3ebb82f12969ffca03d4c6927330d8aa3b3de01.zip | |
Stream MJPEG webcam frames through go2rtc
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'modules/go2rtc.nix')
| -rw-r--r-- | modules/go2rtc.nix | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/go2rtc.nix b/modules/go2rtc.nix index 488d679..62d2531 100644 --- a/modules/go2rtc.nix +++ b/modules/go2rtc.nix @@ -2,8 +2,8 @@ let ffmpegDevice = - device: format: resolution: hz: - "ffmpeg:device?video=${device}&input_format=${format}&video_size=${resolution}&framerate=${hz}#video=h264#hardware"; + device: format: resolution: hz: options: + "ffmpeg:device?video=${device}&input_format=${format}&video_size=${resolution}&framerate=${hz}${options}"; go2rtcPort = 1984; webrtcPort = 8555; @@ -29,7 +29,10 @@ in }; streams = { - webcam = ffmpegDevice "/dev/video0" "yuyv422" "1280x720" "30"; + cam1-yuyv422 = ffmpegDevice "/dev/video0" "yuyv422" "1280x960" "30" "#video=h264#hardware"; + # todo: i think ffmpeg still currently reencodes the mjpeg again, + # but with video=copy all i get back are corrupted frames. + cam1-mjpeg = ffmpegDevice "/dev/video0" "mjpeg" "1280x960" "30" ""; }; }; }; |
