### Manage Streams and Capture Frames with Pipeline (C#) Source: https://context7.com/orbbec/orbbecunitysdk/llms.txt Demonstrates how to initialize and configure the Pipeline class to enable color and depth streams, set alignment modes, capture synchronized framesets, and access camera parameters. It also shows how to start and stop recording to a BAG file. ```csharp using Orbbec; // Create pipeline and configure streams using (Pipeline pipeline = new Pipeline()) { using (Config config = new Config()) { // Get available stream profiles StreamProfileList colorProfiles = pipeline.GetStreamProfileList(SensorType.OB_SENSOR_COLOR); StreamProfileList depthProfiles = pipeline.GetStreamProfileList(SensorType.OB_SENSOR_DEPTH); // Enable color and depth streams with default profiles if (colorProfiles.ProfileCount() > 0) config.EnableStream(colorProfiles.GetProfile(0)); if (depthProfiles.ProfileCount() > 0) config.EnableStream(depthProfiles.GetProfile(0)); // Set depth-to-color alignment mode config.SetAlignMode(AlignMode.ALIGN_D2C_SW_MODE); // Start pipeline pipeline.Start(config); // Enable frame synchronization pipeline.EnableFrameSync(); // Get camera parameters (after D2C alignment) CameraParam cameraParam = pipeline.GetCameraParam(); Console.WriteLine($"Depth Intrinsic: fx={cameraParam.depthIntrinsic.fx}, fy={cameraParam.depthIntrinsic.fy}"); // Capture frames in a loop for (int i = 0; i < 100; i++) { using (Frameset frameset = pipeline.WaitForFrames(1000)) { if (frameset != null) { using (ColorFrame colorFrame = frameset.GetColorFrame()) using (DepthFrame depthFrame = frameset.GetDepthFrame()) { if (colorFrame != null) Console.WriteLine($"Color: {colorFrame.GetWidth()}x{colorFrame.GetHeight()}"); if (depthFrame != null) Console.WriteLine($"Depth: {depthFrame.GetWidth()}x{depthFrame.GetHeight()}, Scale: {depthFrame.GetValueScale()}mm"); } } } } // Recording functionality pipeline.StartRecord("recording.bag"); // ... capture frames ... pipeline.StopRecord(); pipeline.Stop(); } } ``` -------------------------------- ### Control Depth Sensor Stream - C# Source: https://context7.com/orbbec/orbbecunitysdk/llms.txt Demonstrates how to get a depth sensor, list its available stream profiles, select a specific profile (e.g., 640x480 @ 30fps), start the stream with a callback to process depth frames, and then stop the sensor. It also includes error handling for IMU sensors. ```csharp using Orbbec; using (Context context = new Context()) using (DeviceList deviceList = context.QueryDeviceList()) using (Device device = deviceList.GetDevice(0)) { // Get depth sensor using (Sensor depthSensor = device.GetSensor(SensorType.OB_SENSOR_DEPTH)) { Console.WriteLine($"Sensor Type: {depthSensor.GetSensorType()}"); // Get available stream profiles using (StreamProfileList profileList = depthSensor.GetStreamProfileList()) { Console.WriteLine($"Available profiles: {profileList.ProfileCount()}"); // Find a suitable profile StreamProfile selectedProfile = null; for (uint i = 0; i < profileList.ProfileCount(); i++) { using (StreamProfile profile = profileList.GetProfile(i)) { VideoStreamProfile videoProfile = profile.As(); if (videoProfile != null) { Console.WriteLine($"Profile {i}: {videoProfile.GetWidth()}x{videoProfile.GetHeight()}@{videoProfile.GetFPS()}fps, Format: {videoProfile.GetFormat()}"); // Select 640x480 @ 30fps profile if (videoProfile.GetWidth() == 640 && videoProfile.GetHeight() == 480 && videoProfile.GetFPS() == 30) { selectedProfile = profileList.GetProfile(i); break; } videoProfile.Dispose(); } } } if (selectedProfile != null) { // Start sensor with callback depthSensor.Start(selectedProfile, (Frame frame) => { DepthFrame depthFrame = frame.As(); if (depthFrame != null) { Console.WriteLine($"Depth Frame #{frame.GetIndex()}: {depthFrame.GetWidth()}x{depthFrame.GetHeight()}, Timestamp: {frame.GetTimeStamp()}"); depthFrame.Dispose(); } frame.Dispose(); }); Thread.Sleep(5000); depthSensor.Stop(); selectedProfile.Dispose(); } } } // Access IMU sensors try { using (Sensor accelSensor = device.GetSensor(SensorType.OB_SENSOR_ACCEL)) using (Sensor gyroSensor = device.GetSensor(SensorType.OB_SENSOR_GYRO)) { Console.WriteLine("IMU sensors available"); } } catch (NativeException) { Console.WriteLine("IMU not supported on this device"); } } ``` -------------------------------- ### Multi-Device Synchronization with Orbbec SDK (C#) Source: https://context7.com/orbbec/orbbecunitysdk/llms.txt Demonstrates how to synchronize capture from multiple Orbbec depth cameras using the Orbbec SDK in C#. It configures primary and secondary devices, starts pipelines for each, and captures synchronized frames, printing their timestamps. Requires the Orbbec SDK and appropriate camera drivers. ```csharp using Orbbec; using (Context context = new Context()) { // Enable clock synchronization across devices context.EnableDeviceClockSync(1000); // Sync every 1000ms using (DeviceList deviceList = context.QueryDeviceList()) { if (deviceList.DeviceCount() >= 2) { // Configure primary device using (Device primaryDevice = deviceList.GetDevice(0)) { MultiDeviceSyncConfig primaryConfig = new MultiDeviceSyncConfig(); primaryConfig.syncMode = MultiDeviceSyncMode.OB_MULTI_DEVICE_SYNC_MODE_PRIMARY; primaryConfig.depthDelayUs = 0; primaryConfig.colorDelayUs = 0; primaryConfig.triggerOutEnable = true; primaryConfig.triggerOutDelayUs = 0; primaryDevice.SetMultiDeviceSyncConfig(primaryConfig); } // Configure secondary device using (Device secondaryDevice = deviceList.GetDevice(1)) { MultiDeviceSyncConfig secondaryConfig = new MultiDeviceSyncConfig(); secondaryConfig.syncMode = MultiDeviceSyncMode.OB_MULTI_DEVICE_SYNC_MODE_SECONDARY; secondaryConfig.depthDelayUs = 0; secondaryConfig.colorDelayUs = 0; secondaryConfig.triggerOutEnable = true; secondaryDevice.SetMultiDeviceSyncConfig(secondaryConfig); } // Create pipelines for each device using (Device dev1 = deviceList.GetDevice(0)) using (Device dev2 = deviceList.GetDevice(1)) using (Pipeline pipeline1 = new Pipeline(dev1)) using (Pipeline pipeline2 = new Pipeline(dev2)) { using (Config config = new Config()) { config.EnableAllStream(); pipeline1.Start(config); pipeline2.Start(config); // Capture synchronized frames from both cameras for (int i = 0; i < 100; i++) { using (Frameset fs1 = pipeline1.WaitForFrames(1000)) using (Frameset fs2 = pipeline2.WaitForFrames(1000)) { if (fs1 != null && fs2 != null) { using (DepthFrame df1 = fs1.GetDepthFrame()) using (DepthFrame df2 = fs2.GetDepthFrame()) { if (df1 != null && df2 != null) { Console.WriteLine($"Device 1 timestamp: {df1.GetTimeStamp()}, Device 2 timestamp: {df2.GetTimeStamp()}"); } } } } } pipeline1.Stop(); pipeline2.Stop(); } } } } } ``` -------------------------------- ### Asynchronous Point Cloud Processing with C# SDK Source: https://context7.com/orbbec/orbbecunitysdk/llms.txt This example demonstrates asynchronous point cloud generation using a callback function with the Orbbec Unity SDK. The PointCloudFilter is configured, a callback is set to handle processed frames, and frames are pushed to the filter for background processing. This is useful for non-blocking operations. ```csharp using Orbbec; using System; using System.Threading; // ... pipeline setup and cameraParam retrieval ... // Async filter processing with callback using (PointCloudFilter asyncFilter = new PointCloudFilter()) { asyncFilter.SetCameraParam(cameraParam); asyncFilter.SetPointFormat(Format.OB_FORMAT_POINT); asyncFilter.SetCallback((Frame frame) => { Console.WriteLine($"Async point cloud ready: {frame.GetDataSize()} bytes"); frame.Dispose(); }); using (Frameset frameset = pipeline.WaitForFrames(1000)) { if (frameset != null) { asyncFilter.PushFrame(frameset); } } Thread.Sleep(100); // Wait for async processing asyncFilter.Reset(); } // ... pipeline stop ... ``` -------------------------------- ### Control Device Properties and Information in C# Source: https://context7.com/orbbec/orbbecunitysdk/llms.txt This C# snippet demonstrates how to use the Device class to retrieve device information, query supported properties, set boolean properties like auto-exposure, get integer property ranges, manage depth work modes, configure multi-device synchronization, and set up device state change callbacks. It requires the Orbbec SDK context and device listing. ```csharp using Orbbec; using (Context context = new Context()) using (DeviceList deviceList = context.QueryDeviceList()) { if (deviceList.DeviceCount() > 0) { using (Device device = deviceList.GetDevice(0)) { // Get device information using (DeviceInfo info = device.GetDeviceInfo()) { Console.WriteLine($"Device: {info.Name()}"); Console.WriteLine($"PID: {info.Pid()}, VID: {info.Vid()}"); Console.WriteLine($"Serial: {info.SerialNumber()}"); Console.WriteLine($"Firmware: {info.FirmwareVersion()}"); Console.WriteLine($"Hardware: {info.HardwareVersion()}"); Console.WriteLine($"Connection: {info.ConnectionType()}"); } // Get sensor list using (SensorList sensorList = device.GetSensorList()) { Console.WriteLine($"Sensor count: {sensorList.SensorCount()}"); } // Check and set device properties if (device.IsPropertySupported(PropertyId.OB_PROP_DEPTH_AUTO_EXPOSURE_BOOL, PermissionType.OB_PERMISSION_READ_WRITE)) { // Enable auto exposure for depth device.SetBoolProperty(PropertyId.OB_PROP_DEPTH_AUTO_EXPOSURE_BOOL, true); bool autoExposure = device.GetBoolProperty(PropertyId.OB_PROP_DEPTH_AUTO_EXPOSURE_BOOL); Console.WriteLine($"Auto Exposure: {autoExposure}"); } // Get property range if (device.IsPropertySupported(PropertyId.OB_PROP_DEPTH_EXPOSURE_INT, PermissionType.OB_PERMISSION_READ)) { IntPropertyRange exposureRange = device.GetIntPropertyRange(PropertyId.OB_PROP_DEPTH_EXPOSURE_INT); Console.WriteLine($"Exposure Range: {exposureRange.min}-{exposureRange.max}, Current: {exposureRange.cur}"); } // Depth work mode management (for supported devices) try { DepthWorkMode currentMode = device.GetCurrentDepthWorkMode(); Console.WriteLine($"Current Depth Mode: {new string(currentMode.name).TrimEnd('\0')}"); using (DepthWorkModeList modeList = device.GetDepthWorkModeList()) { Console.WriteLine($"Available depth modes: {modeList.Count()}"); } } catch (NativeException) { /* Device may not support depth work modes */ } // Multi-device synchronization configuration MultiDeviceSyncConfig syncConfig = device.GetMultiDeviceSyncConfig(); Console.WriteLine($"Sync Mode: {syncConfig.syncMode}"); // Device state callback device.SetDeviceStateChangedCallback((UInt64 state, String message) => { Console.WriteLine($"Device state changed: {state}, {message}"); }); } } } ``` -------------------------------- ### Get SDK Version Information (C#) Source: https://context7.com/orbbec/orbbecunitysdk/llms.txt Retrieves and displays the version information of the Orbbec SDK. This includes the full version code, as well as separate major, minor, and patch version numbers. ```csharp using Orbbec; // Get SDK version information int fullVersion = Version.GetVersion(); int majorVersion = Version.GetMajorVersion(); int minorVersion = Version.GetMinorVersion(); int patchVersion = Version.GetPatchVersion(); Console.WriteLine($"Orbbec SDK Version: {majorVersion}.{minorVersion}.{patchVersion}"); Console.WriteLine($"Full Version Code: {fullVersion}"); ``` -------------------------------- ### Manage SDK Context and Devices (C#) Source: https://context7.com/orbbec/orbbecunitysdk/llms.txt Demonstrates how to initialize and manage the Orbbec SDK context, query connected devices, retrieve device information, and set up callbacks for device connection changes. It also shows how to configure SDK logging. ```csharp using Orbbec; // Create SDK context using (Context context = new Context()) { // Query connected devices using (DeviceList deviceList = context.QueryDeviceList()) { uint deviceCount = deviceList.DeviceCount(); Console.WriteLine($"Found {deviceCount} device(s)"); if (deviceCount > 0) { // Get the first device using (Device device = deviceList.GetDevice(0)) { DeviceInfo info = device.GetDeviceInfo(); Console.WriteLine($"Device Name: {info.Name()}"); Console.WriteLine($"Serial Number: {info.SerialNumber()}"); Console.WriteLine($"Firmware Version: {info.FirmwareVersion()}"); } } } // Set up device plug/unplug callback context.SetDeviceChangedCallback((DeviceList removed, DeviceList added) => { Console.WriteLine($"Devices removed: {removed.DeviceCount()}, added: {added.DeviceCount()}"); removed.Dispose(); added.Dispose(); }); // Configure logging Context.SetLoggerSeverity(LogSeverity.OB_LOG_SEVERITY_INFO); Context.SetLoggerToFile(LogSeverity.OB_LOG_SEVERITY_DEBUG, "./logs"); } ``` -------------------------------- ### Configure Specific Stream Profiles in C# Source: https://context7.com/orbbec/orbbecunitysdk/llms.txt This C# snippet demonstrates how to configure specific stream profiles, such as enabling a 1920x1080 color stream and the first available depth stream. It also shows how to set hardware alignment mode and enable depth scaling. This method requires iterating through available profiles to find desired ones. ```csharp using Orbbec; using (Pipeline pipeline = new Pipeline()) { // Method 1: Configure specific stream profiles using (Config config = new Config()) { // Get stream profile lists StreamProfileList colorProfiles = pipeline.GetStreamProfileList(SensorType.OB_SENSOR_COLOR); StreamProfileList depthProfiles = pipeline.GetStreamProfileList(SensorType.OB_SENSOR_DEPTH); StreamProfileList irProfiles = pipeline.GetStreamProfileList(SensorType.OB_SENSOR_IR); // Find and enable specific profiles for (uint i = 0; i < colorProfiles.ProfileCount(); i++) { using (StreamProfile profile = colorProfiles.GetProfile(i)) { VideoStreamProfile vp = profile.As(); if (vp != null && vp.GetWidth() == 1920 && vp.GetHeight() == 1080) { config.EnableStream(colorProfiles.GetProfile(i)); break; } vp?.Dispose(); } } // Enable first depth profile if (depthProfiles.ProfileCount() > 0) config.EnableStream(depthProfiles.GetProfile(0)); // Set alignment mode config.SetAlignMode(AlignMode.ALIGN_D2C_HW_MODE); // Hardware alignment // config.SetAlignMode(AlignMode.ALIGN_D2C_SW_MODE); // Software alignment // config.SetAlignMode(AlignMode.ALIGN_DISABLE); // No alignment // Configure depth scaling after D2C config.SetDepthScaleRequire(true); // Set D2C target resolution (when color stream not enabled via SDK) config.SetD2CTargetResolution(1920, 1080); pipeline.Start(config); colorProfiles.Dispose(); depthProfiles.Dispose(); irProfiles?.Dispose(); } // Method 2: Enable all streams with default profiles using (Config config = new Config()) { config.EnableAllStream(); pipeline.Start(config); } // Method 3: Disable specific streams using (Config config = new Config()) { config.EnableAllStream(); config.DisableStream(StreamType.OB_STREAM_IR); // Disable IR stream pipeline.Start(config); } pipeline.Stop(); } ``` -------------------------------- ### Record and Playback Depth Streams with Orbbec SDK (C#) Source: https://context7.com/orbbec/orbbecunitysdk/llms.txt Demonstrates recording depth streams to a '.bag' file and playing it back using the Orbbec SDK in C#. This involves configuring the pipeline, starting/stopping recording, and processing frames during playback. It requires the Orbbec SDK to be integrated into a Unity project. ```csharp using Orbbec; // Recording using (Pipeline pipeline = new Pipeline()) { using (Config config = new Config()) { config.EnableAllStream(); pipeline.Start(config); // Start recording pipeline.StartRecord("depth_recording.bag"); // Capture and record frames for (int i = 0; i < 300; i++) // Record ~10 seconds at 30fps { using (Frameset frameset = pipeline.WaitForFrames(1000)) { if (frameset != null) { Console.WriteLine($"Recording frame {i}"); } } } // Stop recording pipeline.StopRecord(); pipeline.Stop(); } } // Playback using (Pipeline pipeline = new Pipeline("depth_recording.bag")) { // Get playback object using (Playback playback = pipeline.GetPlayback()) { // Set playback callback for state changes playback.SetPlaybackCallback((MediaState state) => { switch (state) { case MediaState.OB_MEDIA_BEGIN: Console.WriteLine("Playback started"); break; case MediaState.OB_MEDIA_PAUSE: Console.WriteLine("Playback paused"); break; case MediaState.OB_MEDIA_RESUME: Console.WriteLine("Playback resumed"); break; case MediaState.OB_MEDIA_END: Console.WriteLine("Playback ended"); break; } }); // Start playback pipeline.Start(null); // Read frames from recording while (true) { using (Frameset frameset = pipeline.WaitForFrames(1000)) { if (frameset == null) break; // End of recording using (DepthFrame depthFrame = frameset.GetDepthFrame()) { if (depthFrame != null) { Console.WriteLine($"Playback: Depth {depthFrame.GetWidth()}x{depthFrame.GetHeight()}, Timestamp: {depthFrame.GetTimeStamp()}"); } } } } pipeline.Stop(); } } ``` -------------------------------- ### Callback-based Pipeline Frame Handling (C#) Source: https://context7.com/orbbec/orbbecunitysdk/llms.txt Illustrates the use of a callback function for asynchronous frame processing with the Pipeline class. This approach allows the application to continue running while frames are received and processed in the background. ```csharp // Callback-based pipeline usage using (Pipeline pipeline = new Pipeline()) { using (Config config = new Config()) { config.EnableAllStream(); pipeline.Start(config, (Frameset frameset) => { Console.WriteLine($"Received frameset with {frameset.GetFrameCount()} frames"); frameset.Dispose(); }); // Application runs, callback receives frames Thread.Sleep(5000); pipeline.Stop(); } } ``` -------------------------------- ### Generate Point Cloud using C# SDK Source: https://context7.com/orbbec/orbbecunitysdk/llms.txt This snippet demonstrates how to generate a point cloud from depth frames using the Orbbec Unity SDK. It configures the PointCloudFilter with camera parameters and desired output format, then processes frames to extract point data. Dependencies include the Orbbec SDK and a configured pipeline. ```csharp using Orbbec; using (Pipeline pipeline = new Pipeline()) { using (Config config = new Config()) { config.EnableAllStream(); config.SetAlignMode(AlignMode.ALIGN_D2C_SW_MODE); pipeline.Start(config); // Get camera parameters for point cloud CameraParam cameraParam = pipeline.GetCameraParam(); // Create point cloud filter using (PointCloudFilter pointCloudFilter = new PointCloudFilter()) { pointCloudFilter.SetCameraParam(cameraParam); pointCloudFilter.SetPointFormat(Format.OB_FORMAT_POINT); // XYZ only // pointCloudFilter.SetPointFormat(Format.OB_FORMAT_RGB_POINT); // XYZRGB pointCloudFilter.SetAlignState(true); // Enable if using D2C aligned frames pointCloudFilter.SetPositionDataScaled(1.0f); pointCloudFilter.SetCoordinateSystem(CoordinateSystemType.OB_RIGHT_HAND_COORDINATE_SYSTEM); using (Frameset frameset = pipeline.WaitForFrames(1000)) { if (frameset != null) { // Process frameset to generate point cloud using (Frame pointCloudFrame = pointCloudFilter.Process(frameset)) { if (pointCloudFrame != null) { PointsFrame points = pointCloudFrame.As(); if (points != null) { UInt32 dataSize = points.GetDataSize(); float scale = points.GetPositionValueScale(); // Get point cloud data byte[] pointData = new byte[dataSize]; points.CopyData(ref pointData); // Calculate number of points (12 bytes per point for XYZ float) int pointCount = (int)(dataSize / 12); Console.WriteLine($"Generated {pointCount} points, scale: {scale}"); points.Dispose(); } } } } } } pipeline.Stop(); } } ``` -------------------------------- ### Access Orbbec Frame Data in C# Source: https://context7.com/orbbec/orbbecunitysdk/llms.txt Demonstrates how to capture and access various frame types (Color, Depth, IR, Points) from an Orbbec sensor using the Pipeline and Config classes. It shows how to retrieve frame dimensions, data size, format, and raw data buffers, as well as metadata like timestamps. This code requires the Orbbec SDK to be integrated into the Unity project. ```csharp using Orbbec; // Working with frames from Pipeline using (Pipeline pipeline = new Pipeline()) { using (Config config = new Config()) { config.EnableAllStream(); pipeline.Start(config); using (Frameset frameset = pipeline.WaitForFrames(1000)) { if (frameset != null) { // Access color frame using (ColorFrame colorFrame = frameset.GetColorFrame()) { if (colorFrame != null) { UInt32 width = colorFrame.GetWidth(); UInt32 height = colorFrame.GetHeight(); UInt32 dataSize = colorFrame.GetDataSize(); Format format = colorFrame.GetFormat(); // Get frame data byte[] colorData = new byte[dataSize]; colorFrame.CopyData(ref colorData); // Or get pointer for direct access IntPtr dataPtr = colorFrame.GetDataPtr(); // Frame metadata byte[] metadata = colorFrame.GetMetadata(); UInt64 timestamp = colorFrame.GetTimeStamp(); UInt64 systemTimestamp = colorFrame.GetSystemTimeStamp(); Console.WriteLine($"Color: {width}x{height}, Format: {format}, Size: {dataSize}, Timestamp: {timestamp}"); } } // Access depth frame using (DepthFrame depthFrame = frameset.GetDepthFrame()) { if (depthFrame != null) { float valueScale = depthFrame.GetValueScale(); UInt32 dataSize = depthFrame.GetDataSize(); // Get depth data as 16-bit values byte[] depthData = new byte[dataSize]; depthFrame.CopyData(ref depthData); // Access depth value at pixel (x, y) int x = 320, y = 240; int pixelIndex = (int)(y * depthFrame.GetWidth() + x) * 2; ushort rawDepth = (ushort)(depthData[pixelIndex] | (depthData[pixelIndex + 1] << 8)); float depthMm = rawDepth * valueScale; Console.WriteLine($"Depth at ({x},{y}): {depthMm}mm (raw: {rawDepth}, scale: {valueScale})"); } } // Access IR frame using (IRFrame irFrame = frameset.GetIRFrame()) { if (irFrame != null) { Console.WriteLine($"IR: {irFrame.GetWidth()}x{irFrame.GetHeight()}"); } } // Access point cloud frame (if generated by filter) using (PointsFrame pointsFrame = frameset.GetPointsFrame()) { if (pointsFrame != null) { float positionScale = pointsFrame.GetPositionValueScale(); UInt32 dataSize = pointsFrame.GetDataSize(); Console.WriteLine($"Points: {dataSize} bytes, Position Scale: {positionScale}"); } } // Generic frame access by type using (Frame frame = frameset.GetFrame(FrameType.OB_FRAME_DEPTH)) { if (frame != null) { DepthFrame df = frame.As(); if (df != null) { Console.WriteLine($"Generic access depth: {df.GetWidth()}x{df.GetHeight()}"); df.Dispose(); } } } } } pipeline.Stop(); } } ``` -------------------------------- ### Convert MJPG to RGB using C# SDK Source: https://context7.com/orbbec/orbbecunitysdk/llms.txt This snippet shows how to convert a Motion JPEG (MJPG) color frame to RGB format using the Orbbec Unity SDK's FormatConvertFilter. It checks if the incoming frame is MJPG and then applies the conversion. The output is an RGB VideoFrame. ```csharp using Orbbec; // ... pipeline setup and frameset retrieval ... // Format conversion filter using (FormatConvertFilter formatFilter = new FormatConvertFilter()) { using (Frameset frameset = pipeline.WaitForFrames(1000)) { if (frameset != null) { using (ColorFrame colorFrame = frameset.GetColorFrame()) { if (colorFrame != null && colorFrame.GetFormat() == Format.OB_FORMAT_MJPG) { formatFilter.SetConvertFormat(ConvertFormat.FORMAT_MJPG_TO_RGB); using (Frame rgbFrame = formatFilter.Process(colorFrame)) { if (rgbFrame != null) { VideoFrame vf = rgbFrame.As(); Console.WriteLine($"Converted to RGB: {vf?.GetWidth()}x{vf?.GetHeight()}"); vf?.Dispose(); } } } } } } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.