Skip to main content

Module simple

Module simple 

Source
Expand description

Simple output builder for OBS.

This module provides a simplified interface for configuring OBS outputs based on the SimpleOutput implementation from OBS Studio.

§Example

§Example

use libobs_simple::output::simple::{SimpleOutputBuilder, X264Preset};
use libobs_simple::quick_start::quick_start;
use libobs_wrapper::{context::ObsContext, utils::StartupInfo, data::video::ObsVideoInfoBuilder};

#[tokio::main]
async fn main() {
let context = StartupInfo::new()
    .set_video_info(
          ObsVideoInfoBuilder::new()
            // Configure video info as need
            .build()
     ).start()
      .unwrap()
     
    let output = SimpleOutputBuilder::new(context, "./recording.mp4")
        .video_bitrate(6000)
        .audio_bitrate(160)
        .x264_encoder(X264Preset::VeryFast)
        .build()
        .unwrap();

    // Add sources here (for more docs, look [this](https://github.com/libobs-rs/libobs-rs/blob/main/examples/monitor-capture/src/main.rs) example

    println!("Output created!");
}

Structs§

OutputSettings
Unified output settings
SimpleOutputBuilder

Enums§

AudioEncoder
Audio encoder configuration
HardwareCodec
Target codec for generic hardware selection
HardwarePreset
Preset for hardware encoders (NVENC, AMD, QSV)
OutputFormat
Output format for file recording
VideoEncoder
Video encoder configuration
X264Preset
Preset for x264 software encoder

Traits§

ObsContextSimpleExt