Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(RTSP streaming): Add Production-Ready RTSP Support with H.264/H.265 Auto-Detection and Configurable Transport #76

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

subhashchy
Copy link

Enhanced RTSP Support for Hailo Pipeline

Feature Description

Added robust RTSP streaming support to the Hailo pipeline with automatic codec detection and improved reliability.

Key Enhancements

  • Added automatic codec detection supporting both H.264 and H.265 (HEVC) streams
  • Implemented configurable RTSP transport protocols (TCP/UDP/HTTP)
  • Added adjustable latency control for fine-tuning stream delay
  • Enhanced buffer management for better stream stability
  • Added retry mechanism for connection resilience

Technical Implementation

  • Integrated rtpbin for improved RTP packet handling
  • Added parsebin and decodebin3 for automatic codec detection and robust decoding
  • Implemented leaky queues for better memory management
  • Added configurable timeouts and retry mechanisms
  • Added stream format validation through capsfilter

Configuration Options

  • --rtsp-protocols: Choose between tcp/udp/udp-mcast/http (default: tcp)
  • --rtsp-latency: Adjust stream latency in milliseconds (default: 100ms)

Use Cases

  1. Security Camera Integration

    • Direct connection to IP cameras
    • Support for both H.264 and H.265 security cameras
    • Multiple stream quality support
  2. Industrial Monitoring

    • Real-time process monitoring
    • Quality control systems
    • Production line surveillance
  3. Smart City Applications

    • Traffic monitoring
    • Public space surveillance
    • Crowd analysis

Example Usage

# Basic RTSP stream
python detection.py -i rtsp://username:password@ip:port/stream

# Low-latency configuration
python detection.py -i rtsp://ip:port/stream --rtsp-latency 50

# UDP protocol for local network
python detection.py -i rtsp://ip:port/stream --rtsp-protocols udp

Performance Considerations

  • Automatic codec detection adds minimal overhead
  • Configurable latency allows balancing between delay and stability
  • Memory-efficient queue management prevents buffer bloat
  • Retry mechanism ensures robust operation in unstable networks

Compatibility

  • Works with major IP camera brands (Hikvision, Dahua, Axis, etc.)
  • Supports standard RTSP protocol implementations
  • Compatible with both H.264 and H.265 streams
  • Tested with various stream resolutions (up to 4K)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant