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

How to open csi camera in a docker container #1823

Open
AnhHazz opened this issue Apr 3, 2024 · 3 comments
Open

How to open csi camera in a docker container #1823

AnhHazz opened this issue Apr 3, 2024 · 3 comments

Comments

@AnhHazz
Copy link

AnhHazz commented Apr 3, 2024

Hi @dusty-nv
I'm using a ros:humble docker container which is not a ros_deeplearning container and I want to send camera images through ros2 topic. The problem is this container doesn't have nvgstreamer so I can't use:
std::string gstreamer_pipeline (int capture_width, int capture_height, int display_width, int display_height, int framerate, int flip_method) { return "nvarguscamerasrc ! video/x-raw(memory:NVMM), width=(int)" + std::to_string(capture_width) + ", height=(int)" + std::to_string(capture_height) + ", framerate=(fraction)" + std::to_string(framerate) + "/1 ! nvvidconv flip-method=" + std::to_string(flip_method) + " ! video/x-raw, width=(int)" + std::to_string(display_width) + ", height=(int)" + std::to_string(display_height) + ", format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink"; }

std::string pipeline = gstreamer_pipeline(capture_width, capture_height, display_width, display_height, framerate, flip_method); std::cout << "Using pipeline: \n\t" << pipeline << "\n";

cv::VideoCapture cap(pipeline, cv::CAP_GSTREAMER);

Is there any way I can use the csi camera?
As I know, camera devices always have their name inside /dev folder so we can read from the device. i searched but haven't found where csi camera in that folder. I only found /dev/video0. Is that it? Tks for helping!

@dusty-nv
Copy link
Owner

dusty-nv commented Apr 3, 2024

Hi @AnhHazz, the /dev/video* devices are for V4L2 interface, instead the Argus CSI daemon communicates over this socket mounted into the container:

-v /tmp/argus_socket:/tmp/argus_socket \

@AnhHazz
Copy link
Author

AnhHazz commented Apr 3, 2024

@dusty-nv Thanks for reply i see, but i still don't know what to do. Can you tell me exactly what steps in order to run the csi camera inside a container? Or how to install nvgstreamer inside the container?

I don't use your docker images so those nvgst commands are not available now

@dusty-nv
Copy link
Owner

dusty-nv commented Apr 4, 2024

@AnhHazz I think you need to have gstreamer installed inside the container and be using --runtime nvidia to enable the nvidia plugins for gstreamer

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

No branches or pull requests

2 participants