From d3ebb82f12969ffca03d4c6927330d8aa3b3de01 Mon Sep 17 00:00:00 2001 From: Mel Date: Thu, 1 May 2025 05:04:54 +0200 Subject: Stream MJPEG webcam frames through go2rtc Signed-off-by: Mel --- modules/go2rtc.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'modules/go2rtc.nix') 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" ""; }; }; }; -- cgit 1.4.1