mirror of
https://github.com/bleackstorm/SteamFrame-FPV-Control-Center.git
synced 2026-12-03 07:31:57 +01:00
feat(perf,ux): GPU compute warp, dual-layer OpenXR OSD, HW decode, profiles & modular architecture (Lots 3 & 4)
This commit is contained in:
1 parent
d82a65d9e6
commit
4aa4fc06e7
27 files changed
+9678
-7045
No files matched your search
+33
-10
@@ -121,7 +121,7 @@ impl DvrRecorder {
|
||||
Self::launch(pipeline_str, file_path, DvrMode::StreamCopy)
|
||||
}
|
||||
|
||||
/// Démarre un enregistrement en mode incrustation OSD (re-encodage rapide x264enc)
|
||||
/// Démarre un enregistrement en mode incrustation OSD (sonde encodeur H.264 matériel puis repli x264enc)
|
||||
pub fn start_composited_osd(
|
||||
dir: &str,
|
||||
container: DvrContainer,
|
||||
@@ -136,14 +136,37 @@ impl DvrRecorder {
|
||||
let file_path = Self::generate_filepath(dir, container);
|
||||
let muxer = container.muxer_element();
|
||||
|
||||
let pipeline_str = format!(
|
||||
"appsrc name=dvr_src is-live=true format=time do-timestamp=true max-bytes={DVR_MAX_QUEUE_BYTES} \
|
||||
caps=video/x-raw,format=RGBA,width={width},height={height},framerate=0/1 ! \
|
||||
videoconvert ! \
|
||||
x264enc tune=zerolatency speed-preset=ultrafast bitrate=8000 key-int-max=60 ! \
|
||||
h264parse config-interval=-1 ! \
|
||||
{muxer} ! \
|
||||
filesink name=dvr_sink sync=false"
|
||||
let make_pipeline = |encoder: &str| {
|
||||
format!(
|
||||
"appsrc name=dvr_src is-live=true format=time do-timestamp=true max-bytes={DVR_MAX_QUEUE_BYTES} \
|
||||
caps=video/x-raw,format=RGBA,width={width},height={height},framerate=0/1 ! \
|
||||
videoconvert ! \
|
||||
{encoder} ! \
|
||||
h264parse config-interval=-1 ! \
|
||||
{muxer} ! \
|
||||
filesink name=dvr_sink sync=false"
|
||||
)
|
||||
};
|
||||
|
||||
// En production, tenter un encodeur matériel (v4l2h264enc / vah264enc) avant x264enc CPU
|
||||
#[cfg(not(test))]
|
||||
for &(factory, desc) in &[
|
||||
("v4l2h264enc", "v4l2h264enc"),
|
||||
("vah264enc", "vah264enc bitrate=8000"),
|
||||
] {
|
||||
if gst::ElementFactory::find(factory).is_some() {
|
||||
if let Ok(rec) = Self::launch(make_pipeline(desc), file_path.clone(), DvrMode::CompositedOsd) {
|
||||
log::info!(
|
||||
"[DVR] Démarrage enregistrement OSD HW ({factory}, {width}x{height} VFR) -> {:?}",
|
||||
file_path
|
||||
);
|
||||
return Ok(rec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let pipeline_str = make_pipeline(
|
||||
"x264enc tune=zerolatency speed-preset=ultrafast bitrate=8000 key-int-max=60",
|
||||
);
|
||||
|
||||
log::info!(
|
||||
@@ -289,7 +312,7 @@ impl DvrRecorder {
|
||||
if self.mode == DvrMode::StreamCopy {
|
||||
self.bytes_written.fetch_add(buf_len, Ordering::Relaxed);
|
||||
}
|
||||
if frame_num % 30 == 0 {
|
||||
if frame_num.is_multiple_of(30) {
|
||||
self.poll_health_and_size();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user