Skip to content

Added embedded env type for CSI camera in video handler - #13

Open
salehmanochehri wants to merge 1 commit into
alireza787b:mainfrom
salehmanochehri:main
Open

Added embedded env type for CSI camera in video handler#13
salehmanochehri wants to merge 1 commit into
alireza787b:mainfrom
salehmanochehri:main

Conversation

@salehmanochehri

Copy link
Copy Markdown

When using the CSI_CAMERA. By default, GStreamer pipeline is only defined for Nvidia boards. Raspberry Pi camera CSI have been added to the pipeline in video handler class and configuration file.

@alireza787b

Copy link
Copy Markdown
Owner

When using the CSI_CAMERA. By default, GStreamer pipeline is only defined for Nvidia boards. Raspberry Pi camera CSI have been added to the pipeline in video handler class and configuration file.

Hey saleh👋

Thanks for taking the time to work on Raspberry Pi CSI camera support! Sorry for the delayed response

Since you opened this PR, I've done a major reorganization and improvement of the video_handler.py module with a much cleaner architecture using template-based pipelines. The current implementation already has robust CSI camera support, but I love your idea of explicit Raspberry Pi support!

🎯 Better Approach: New CSI_RPI Video Source Type

Rather than adding an EMBEDDED_ENVIRONMENT config parameter (which would be unused for most video sources), let's follow the existing pattern and create a dedicated CSI_RPI video source type alongside the current CSI_CAMERA (which we can rename to CSI_JETSON).

Why this is cleaner:

  • ✅ Explicit hardware selection (users know their platform)
  • ✅ Follows existing VIDEO_SOURCE_TYPE pattern
  • ✅ Uses the existing template system
  • ✅ No config bloat
  • ✅ Easy to test both platforms

📋 Implementation Guide:

1. Config Update:

VideoSource:
  # Add CSI_RPI as new option
  VIDEO_SOURCE_TYPE: CSI_RPI  # or CSI_JETSON

2. Video Handler Updates:

  • Add CSI_RPI to the handlers mapping
  • Create _create_csi_rpi_capture() method
  • Add _build_gstreamer_csi_rpi_pipeline() method
  • Keep existing template system in GStreamerPipelines.CSI_RPI

3. Fix the Pipeline:

Your Raspberry Pi pipeline had a critical bug - gst-inspect-1.0 is a debugging tool, not for execution. The correct libcamerasrc pipeline should be:

"libcamerasrc ! video/x-raw,width={width},height={height},framerate={fps}/1 ! videoconvert ! video/x-raw,format=BGR ! appsink drop=true max-buffers=1 sync=false"

🤝 Want to Collaborate?

I'd love to have you implement this cleaner approach! It would be a great addition. Check out the current video_handler.py structure and let me know if you'd like to:

  1. Implement the CSI_RPI source type using the existing template pattern
  2. Test it on your Raspberry Pi setup
  3. Update the documentation with both CSI options

The current codebase is much more organized now - take a look and let me know your thoughts!

Thanks again for the contribution! 🚀

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.

2 participants