diff --git a/client/src/input/camera.rs b/client/src/input/camera.rs index c0a776f..6eb7188 100644 --- a/client/src/input/camera.rs +++ b/client/src/input/camera.rs @@ -26,17 +26,24 @@ impl CameraCapture { // (NVIDIA → VA-API → software x264). let (enc, kf_prop, kf_val) = Self::choose_encoder(); tracing::info!("📸 using encoder element: {enc}"); + let have_nvvidconv = gst::ElementFactory::find("nvvidconv").is_some(); let (src_caps, preenc) = match enc { - "nvh264enc" => ( - "video/x-raw(memory:NVMM),format=NV12,width=1280,height=720", - "nvvidconv !" - ), - "vaapih264enc" => ( - "video/x-raw,format=NV12,width=1280,height=720", - "videoconvert !" - ), - _ => ("video/x-raw,width=1280,height=720", "videoconvert !"), - }; + // ─────────────────────────────────────────────────────────────────── + // Jetson (has nvvidconv) Desktop (falls back to videoconvert) + // ─────────────────────────────────────────────────────────────────── + "nvh264enc" if have_nvvidconv => + ("video/x-raw(memory:NVMM),format=NV12,width=1280,height=720", + "nvvidconv !"), + "nvh264enc" /* else */ => + ("video/x-raw,format=NV12,width=1280,height=720", + "videoconvert !"), + "vaapih264enc" => + ("video/x-raw,format=NV12,width=1280,height=720", + "videoconvert !"), + _ => + ("video/x-raw,width=1280,height=720", + "videoconvert !"), + }; // let desc = format!( // "v4l2src device={dev} do-timestamp=true ! {raw_caps},width=1280,height=720 ! \ diff --git a/scripts/install/server.sh b/scripts/install/server.sh index 8ca910c..2443786 100755 --- a/scripts/install/server.sh +++ b/scripts/install/server.sh @@ -122,7 +122,7 @@ After=network.target lesavka-core.service [Service] ExecStart=/usr/local/bin/lesavka-server Restart=always -Environment=RUST_LOG=lesavka_server=info,lesavka_server::audio=trace,lesavka_server::video=trace,lesavka_server::gadget=info +Environment=RUST_LOG=lesavka_server=info,lesavka_server::audio=info,lesavka_server::video=debug,lesavka_server::gadget=info Environment=RUST_BACKTRACE=1 Environment=GST_DEBUG="*:2,alsasink:6,alsasrc:6" Restart=always