#
Integrating RTSP Camera Streams in .NET Applications
Video Capture SDK .Net VideoCaptureCoreX VideoCaptureCore
#
Setting Up Standard RTSP Camera Sources
Implementing RTSP camera streams in your .NET applications provides flexible access to network cameras and video streams. This powerful capability allows real-time monitoring, surveillance features, and video processing directly within your application.
For additional connection options and alternative protocols, please reference our detailed IP cameras documentation which covers a wide range of camera integration approaches.
// Create RTSP source settings object
var rtsp = await RTSPSourceSettings.CreateAsync(new Uri("url"), "login", "password", true /*capture audio?*/);
// Set source to the VideoCaptureCoreX object
VideoCapture1.Video_Source = rtsp;
#
Optimizing for Low-Latency RTSP Streaming
Low latency is critical for many real-time applications including security monitoring, interactive systems, and live broadcasting. Our SDK provides specialized configurations to minimize delay between capture and display.
Our SDK includes a dedicated mode specifically engineered for low-latency RTSP streaming. When properly configured, this mode typically achieves latency under 250 milliseconds, making it ideal for time-sensitive applications.
// Create the source settings object.
var settings = new IPCameraSourceSettings();
// Configure IP address, username, password, etc.
// ...
// Set RTSP LowLatency mode.
settings.Type = IPSourceEngine.RTSP_LowLatency;
// Set UDP or TCP mode.
settings.RTSP_LowLatency_UseUDP = false; // true to use UDP, false to use TCP
// Set source to the VideoCaptureCore object.
VideoCapture1.IP_Camera_Source = settings;
NEW: Ultra-Low Latency Mode (60-120ms)
VideoCaptureCoreX now includes a dedicated low latency mode that achieves 60-120ms total latency - up to 10x faster than standard mode. Perfect for real-time surveillance, interactive monitoring, and security applications.
// Create RTSP source settings
var rtsp = await RTSPSourceSettings.CreateAsync(
new Uri("rtsp://192.168.1.100:554/stream"),
"admin",
"password",
true); // enable audio
// Enable low latency mode - optimizes for minimal delay (60-120ms)
rtsp.LowLatencyMode = true;
// Set source to VideoCaptureCoreX
VideoCapture1.Video_Source = rtsp;
How It Works:
- Sets RTSP jitter buffer to 80ms (vs. default 1000ms)
- Optimizes internal queue buffering (2 frames max)
- Disables packet reordering for minimal delay
- Trade-off: Optimizes speed over stability
When to Use:
- ✓ Real-time surveillance and monitoring
- ✓ Live security systems
- ✓ Interactive video applications
- ✓ Remote control systems
- ✗ Recording on unstable networks (use default)
- ✗ Long-term archival capture (use default)
Advanced Configuration:
For fine-tuned control, you can manually configure latency parameters:
var rtsp = await RTSPSourceSettings.CreateAsync(uri, login, password, audioEnabled);
// Manual low latency configuration
rtsp.Latency = TimeSpan.FromMilliseconds(50); // Custom buffer size
rtsp.BufferMode = RTSPBufferMode.None; // No jitter buffering
rtsp.DropOnLatency = false; // Don't drop frames
#
Implementation Examples and Reference Applications
These sample projects demonstrate practical RTSP implementation patterns and can serve as starting points for your own development. Reviewing these examples will help you understand best practices for RTSP integration.
#
Troubleshooting RTSP Connections
When working with RTSP cameras, you may encounter connectivity issues related to network configuration, firewall settings, or authentication. Here are key factors to consider:
- Verify network connectivity between your application and the camera
- Ensure correct authentication credentials are provided
- Check if firewalls are blocking required ports (typically 554 for RTSP)
- Consider using TCP instead of UDP if experiencing packet loss
- Test camera streams with VLC or similar tools to isolate application-specific issues