alliedvision / gst-vimbasrc

Official vimbasrc element for use of Vimba with GStreamer
Other
10 stars 9 forks source link

Running 2 cameras with different settings within the same process #23

Open oforomar opened 1 year ago

oforomar commented 1 year ago

I have 2 cameras 1800 U-511m, 1800 U-508c when I run them both using the same settings : -

capture = "vimbasrc camera=DEV_1AB22C01BB37 settingsfile=/home/nvidia/color_day.xml ! nvvidconv ! queue ! appsink"
cap = cv2.VideoCapture(capture, cv2.CAP_GSTREAMER)

they launch but the color camera (1800 U-508c) changes the pixel format to mono8 everytime.

When I provide a different config to the color camera, none of the streams work : -

color_cam = Camera("DEV_1AB22C01BB37", capture_string="vimbasrc camera=DEV_1AB22C01BB37 gain=28 exposureauto=1 balancewhiteauto=2 ! width=1028 height=1232 video/x-raw,format=BGR ! queue ! appsink")

However when I run each camera in a separate process, they work!

I want to be able to launch both streams from the same process with different config for each cam, I guess it is a bug related to issue#1, where the settings is being shared across the 2 cams ?

arunprakash-avt commented 1 year ago

Each camera has a specific DEV ID , color camera also supports Mono8 pixelformat. Therefore I request you to have two seperate setting files and load them according to the camera and DEV ID.

oforomar commented 1 year ago

Yes, I have 2 separate .xml files each for the relevant camera

arunprakash-avt commented 1 year ago

I would recommend you using the v0.3.2-beta1. As this version Support multiple vimbasrc instances.

oforomar commented 1 year ago

I read the thread in in #1 and updated to the beta version

arunprakash-avt commented 1 year ago

Then I hope this issue is solved so I will close this issue.

oforomar commented 1 year ago

I forgot to add the issue still persists after updating

arunprakash-avt commented 1 year ago

I request you to write us an email to support@alliedvision.com.

robbyfrt commented 1 year ago

I can confirm that running two Alvium USB Cameras work with v0.3.2-beta1 using the following gst-string:

gst-launch-1.0 \
vimbasrc camera=DEV_1AB22C*** settingsfile=/mounted/custom_lib/vimba/500c_480p_2.xml ! nvvideoconvert ! 'video/x-raw(memory:NVMM), format=(string)NV12' ! m.sink_0 \
vimbasrc camera=DEV_1AB22C*** settingsfile=/mounted/custom_lib/vimba/500c_480p.xml ! nvvideoconvert ! 'video/x-raw(memory:NVMM), format=(string)NV12' ! m.sink_1 \
nvstreammux name=m batch-size=1 ! nvmultistreamtiler rows=1 columns=2 width=640 height=480 ! nvvideoconvert ! nvdsosd ! nvegltransform ! nveglglessink sync=false

GST_DEBUG=vimbasrc:4 also confirms that both devices were closed properly:

Interrupt: Stopping pipeline ...
Execution ended after 0:00:13.478742877
Setting pipeline to NULL ...
0:00:19.915996985  2868 0xaaab09ff4cc0 INFO                vimbasrc gstvimbasrc.c:1264:gst_vimbasrc_create:<vimbasrc1> Element state is no longer "GST_STATE_PLAYING". Aborting create call.
[ERROR push 334] push failed [-2]
Freeing pipeline ...
0:00:22.242154267  2868 0xaaab09700360 INFO                vimbasrc gstvimbasrc.c:966:gst_vimbasrc_finalize:<vimbasrc1> Closed camera DEV_1AB22C***
0:00:22.272789027  2868 0xaaab09700360 INFO                vimbasrc gstvimbasrc.c:966:gst_vimbasrc_finalize:<vimbasrc0> Closed camera DEV_1AB22C***
0:00:22.489327277  2868 0xaaab09700360 INFO                vimbasrc gstvimbasrc.c:982:gst_vimbasrc_finalize:<vimbasrc0> Vimba API was shut down

Plattform: Jetson Xavier NX, Deepstream 6.2, ARM64 version.