mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-13 01:05:37 +02:00
feat(runner): Container detection and handling, video bit-depth flags and script updates (#303)
## Description Works in apptainer now.. podman is still the goat since apptainer needs docker treatment and even more.. - Added container detection so podman can be used to it's fullest, the non-sane ones are handled separately.. - Added video bit-depth option, cuz AV1 and 10-bit encoding go well together. - Some other package updates to nestri-server. - General tidying up of scripts to make multi-container-engine handling less of a pain. - Updated old wireplumber lua script to new json format. Further changes: - Removed unused debug arg from nestri-server. - Moved configs to config file folder rather than keeping them in containerfile. - Improved audio configs, moved some into wireplumber to keep things tidy. - Bit better arg handling in nestri-server. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Optional 10‑bit video support and auto‑launch of an app after display setup. * **Changes** * Standardized runtime/user env to NESTRI_* with updated home/cache paths and explicit LANG; password generation now logged. * Improved container/GPU detection and startup logging; reduced blanket root usage during startup; SSH setup surfaced. * WirePlumber/PipeWire moved to JSON configs; low‑latency clock and loopback audio policies added; audio capture defaults to PipeWire. * **Chores** * GStreamer/libp2p dependency upgrades and Rust toolchain pinned; NVIDIA driver capability exposed. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: DatCaptainHorse <DatCaptainHorse@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
aba0bc3be1
commit
590fe5e196
@@ -1,8 +1,6 @@
|
||||
pub struct AppArgs {
|
||||
/// Verbose output mode
|
||||
pub verbose: bool,
|
||||
/// Enable additional debug information and features, may affect performance
|
||||
pub debug: bool,
|
||||
|
||||
/// Virtual display resolution
|
||||
pub resolution: (u32, u32),
|
||||
@@ -15,13 +13,13 @@ pub struct AppArgs {
|
||||
pub room: String,
|
||||
|
||||
/// Experimental DMA-BUF support
|
||||
/// TODO: Move to video encoding flags
|
||||
pub dma_buf: bool,
|
||||
}
|
||||
impl AppArgs {
|
||||
pub fn from_matches(matches: &clap::ArgMatches) -> Self {
|
||||
Self {
|
||||
verbose: matches.get_one::<bool>("verbose").unwrap_or(&false).clone(),
|
||||
debug: matches.get_one::<bool>("debug").unwrap_or(&false).clone(),
|
||||
resolution: {
|
||||
let res = matches
|
||||
.get_one::<String>("resolution")
|
||||
@@ -54,7 +52,6 @@ impl AppArgs {
|
||||
pub fn debug_print(&self) {
|
||||
tracing::info!("AppArgs:");
|
||||
tracing::info!("> verbose: {}", self.verbose);
|
||||
tracing::info!("> debug: {}", self.debug);
|
||||
tracing::info!(
|
||||
"> resolution: '{}x{}'",
|
||||
self.resolution.0,
|
||||
|
||||
@@ -1,37 +1,48 @@
|
||||
pub struct DeviceArgs {
|
||||
/// GPU vendor (e.g. "intel")
|
||||
pub gpu_vendor: String,
|
||||
pub gpu_vendor: Option<String>,
|
||||
/// GPU name (e.g. "a770")
|
||||
pub gpu_name: String,
|
||||
/// GPU index, if multiple same GPUs are present, -1 for auto-selection
|
||||
pub gpu_index: i32,
|
||||
pub gpu_name: Option<String>,
|
||||
/// GPU index, if multiple same GPUs are present, None for auto-selection
|
||||
pub gpu_index: Option<u32>,
|
||||
/// GPU card/render path, sets card explicitly from such path
|
||||
pub gpu_card_path: String,
|
||||
pub gpu_card_path: Option<String>,
|
||||
}
|
||||
impl DeviceArgs {
|
||||
pub fn from_matches(matches: &clap::ArgMatches) -> Self {
|
||||
Self {
|
||||
gpu_vendor: matches
|
||||
.get_one::<String>("gpu-vendor")
|
||||
.unwrap_or(&"".to_string())
|
||||
.clone(),
|
||||
.cloned(),
|
||||
gpu_name: matches
|
||||
.get_one::<String>("gpu-name")
|
||||
.unwrap_or(&"".to_string())
|
||||
.clone(),
|
||||
gpu_index: matches.get_one::<i32>("gpu-index").unwrap_or(&-1).clone(),
|
||||
.cloned(),
|
||||
gpu_index: matches
|
||||
.get_one::<u32>("gpu-index")
|
||||
.cloned(),
|
||||
gpu_card_path: matches
|
||||
.get_one::<String>("gpu-card-path")
|
||||
.unwrap_or(&"".to_string())
|
||||
.clone(),
|
||||
.cloned(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn debug_print(&self) {
|
||||
tracing::info!("DeviceArgs:");
|
||||
tracing::info!("> gpu_vendor: '{}'", self.gpu_vendor);
|
||||
tracing::info!("> gpu_name: '{}'", self.gpu_name);
|
||||
tracing::info!("> gpu_index: {}", self.gpu_index);
|
||||
tracing::info!("> gpu_card_path: '{}'", self.gpu_card_path);
|
||||
tracing::info!(
|
||||
"> gpu_vendor: '{}'",
|
||||
self.gpu_vendor.as_deref().unwrap_or("auto")
|
||||
);
|
||||
tracing::info!(
|
||||
"> gpu_name: '{}'",
|
||||
self.gpu_name.as_deref().unwrap_or("auto")
|
||||
);
|
||||
tracing::info!(
|
||||
"> gpu_index: {}",
|
||||
self.gpu_index.map_or("auto".to_string(), |i| i.to_string())
|
||||
);
|
||||
tracing::info!(
|
||||
"> gpu_card_path: '{}'",
|
||||
self.gpu_card_path.as_deref().unwrap_or("auto")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,14 +64,14 @@ pub struct EncodingOptionsBase {
|
||||
/// Codec (e.g. "h264", "opus" etc.)
|
||||
pub codec: Codec,
|
||||
/// Overridable encoder (e.g. "vah264lpenc", "opusenc" etc.)
|
||||
pub encoder: String,
|
||||
pub encoder: Option<String>,
|
||||
/// Rate control method (e.g. "cqp", "vbr", "cbr")
|
||||
pub rate_control: RateControl,
|
||||
}
|
||||
impl EncodingOptionsBase {
|
||||
pub fn debug_print(&self) {
|
||||
tracing::info!("> Codec: '{}'", self.codec.as_str());
|
||||
tracing::info!("> Encoder: '{}'", self.encoder);
|
||||
tracing::info!("> Encoder: '{}'", self.encoder.as_deref().unwrap_or("auto"));
|
||||
match &self.rate_control {
|
||||
RateControl::CQP(cqp) => {
|
||||
tracing::info!("> Rate Control: CQP");
|
||||
@@ -93,6 +93,7 @@ impl EncodingOptionsBase {
|
||||
pub struct VideoEncodingOptions {
|
||||
pub base: EncodingOptionsBase,
|
||||
pub encoder_type: EncoderType,
|
||||
pub bit_depth: u32,
|
||||
}
|
||||
impl VideoEncodingOptions {
|
||||
pub fn from_matches(matches: &clap::ArgMatches) -> Self {
|
||||
@@ -104,10 +105,7 @@ impl VideoEncodingOptions {
|
||||
.unwrap_or(&VideoCodec::H264)
|
||||
.clone(),
|
||||
),
|
||||
encoder: matches
|
||||
.get_one::<String>("video-encoder")
|
||||
.unwrap_or(&"".to_string())
|
||||
.clone(),
|
||||
encoder: matches.get_one::<String>("video-encoder").cloned(),
|
||||
rate_control: match matches
|
||||
.get_one::<RateControlMethod>("video-rate-control")
|
||||
.unwrap_or(&RateControlMethod::CBR)
|
||||
@@ -132,6 +130,10 @@ impl VideoEncodingOptions {
|
||||
.get_one::<EncoderType>("video-encoder-type")
|
||||
.unwrap_or(&EncoderType::HARDWARE)
|
||||
.clone(),
|
||||
bit_depth: matches
|
||||
.get_one::<u32>("video-bit-depth")
|
||||
.copied()
|
||||
.unwrap_or(8),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,6 +141,7 @@ impl VideoEncodingOptions {
|
||||
tracing::info!("Video Encoding Options:");
|
||||
self.base.debug_print();
|
||||
tracing::info!("> Encoder Type: {}", self.encoder_type.as_str());
|
||||
tracing::info!("> Bit Depth: {}", self.bit_depth);
|
||||
}
|
||||
}
|
||||
impl Deref for VideoEncodingOptions {
|
||||
@@ -191,10 +194,7 @@ impl AudioEncodingOptions {
|
||||
.unwrap_or(&AudioCodec::OPUS)
|
||||
.clone(),
|
||||
),
|
||||
encoder: matches
|
||||
.get_one::<String>("audio-encoder")
|
||||
.unwrap_or(&"".to_string())
|
||||
.clone(),
|
||||
encoder: matches.get_one::<String>("audio-encoder").cloned(),
|
||||
rate_control: match matches
|
||||
.get_one::<RateControlMethod>("audio-rate-control")
|
||||
.unwrap_or(&RateControlMethod::CBR)
|
||||
|
||||
Reference in New Issue
Block a user