Navigation

    VEYE IMAGING Forum

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Recent
    • Popular
    • Users
    • WIKI
    • veye.cc

    UNSOLVED Error occurs when more than three CS-USB-IMX307 are connected.

    USB camera
    2
    10
    1890
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • O
      octa_yk last edited by octa_yk

      I want to connect four CS-USB-IMX307 units to Jetson NX.

      However, when I open the third unit, I get an error message.

      Have you ever connected four CS-USB-IMX307 units to Jetson NX?

      If you know how to connect them, please let me know.

      $ gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,format=YUY2,width=640,height=360,framerate=30/1' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! nvvidconv ! nveglglessink & \
      > gst-launch-1.0 v4l2src device=/dev/video1 ! 'video/x-raw,format=YUY2,width=640,height=360,framerate=30/1' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! nvvidconv ! nveglglessink & \
      > gst-launch-1.0 v4l2src device=/dev/video2 ! 'video/x-raw,format=YUY2,width=640,height=360,framerate=30/1' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! nvvidconv ! nveglglessink &
      [1] 10085
      [2] 10086
      [3] 10087
      
      $ Setting pipeline to PAUSED ...
      
      Using winsys: x11 
      Pipeline is live and does not need PREROLL ...
      Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
      Setting pipeline to PLAYING ...
      New clock: GstSystemClock
      Setting pipeline to PAUSED ...
      
      Using winsys: x11 
      Pipeline is live and does not need PREROLL ...
      Setting pipeline to PAUSED ...
      
      Using winsys: x11 
      Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
      Setting pipeline to PLAYING ...
      New clock: GstSystemClock
      Pipeline is live and does not need PREROLL ...
      Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
      Setting pipeline to PLAYING ...
      New clock: GstSystemClock
      ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
      Additional debug info:
      gstv4l2src.c(658): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
      Buffer pool activation failed
      Execution ended after 0:00:00.369937048
      Setting pipeline to PAUSED ...
      Setting pipeline to READY ...
      Setting pipeline to NULL ...
      Freeing pipeline ...
      
      veye_xumm 1 Reply Last reply Reply Quote 0
      • veye_xumm
        veye_xumm @octa_yk last edited by

        @octa_yk
        Use nvoverlaysink as sink will be fine, the specific reasons I have not yet studied in depth, you can try first.

        gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,format=YUY2,width=640,height=360,framerate=30/1' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! nvvidconv ! nvoverlaysink
        
        1 Reply Last reply Reply Quote 0
        • O
          octa_yk last edited by octa_yk

          @veye_xumm

          I used "nvoverlaysink" and the result was the same.

          Are you able to connect and image 4 USB cameras in your environment?

          Please let us know the details of your environment, including the OS version you are using.

          $ gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,format=YUY2,width=640,height=360,framerate=30/1' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! nvvidconv ! nvoverlaysink & \
          > gst-launch-1.0 v4l2src device=/dev/video1 ! 'video/x-raw,format=YUY2,width=640,height=360,framerate=30/1' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! nvvidconv ! nvoverlaysink & \
          > gst-launch-1.0 v4l2src device=/dev/video2 ! 'video/x-raw,format=YUY2,width=640,height=360,framerate=30/1' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! nvvidconv ! nvoverlaysink &
          [1] 9800
          [2] 9801
          [3] 9802
          Setting pipeline to PAUSED ...
          Setting pipeline to PAUSED ...
          Setting pipeline to PAUSED ...
          Pipeline is live and does not need PREROLL ...
          Pipeline is live and does not need PREROLL ...
          Pipeline is live and does not need PREROLL ...
          Setting pipeline to PLAYING ...
          New clock: GstSystemClock
          Setting pipeline to PLAYING ...
          Setting pipeline to PLAYING ...
          New clock: GstSystemClock
          New clock: GstSystemClock
          ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
          Additional debug info:
          gstv4l2src.c(658): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
          Buffer pool activation failed
          Execution ended after 0:00:00.467221630
          Setting pipeline to PAUSED ...
          Setting pipeline to READY ...
          Setting pipeline to NULL ...
          Freeing pipeline ...
          
          veye_xumm 1 Reply Last reply Reply Quote 0
          • veye_xumm
            veye_xumm @octa_yk last edited by

            @octa_yk
            You can try to display 1 usb video. This will definitely work.
            The problem is that nvoverlaysink will try to use the whole screen, so your command will error out.
            I don't have much experience with this either. Suggestions are as follows.

            1. You can refer to:
              http://wiki.veye.cc/index.php/VEYE_CS_Camera_for_Jetson_TX2#Gstreamer_Usage
              The chapter of Preview 2 cameras 1080p HD, this command uses nvcompsitor to achieve the simultaneous preview of two cameras.
            2. Or, the form of the command like you are now, specify a display area for each camera's nvoverlaysink.

            Also, you can go to nvidia's forum to ask this question. They should have more experience.

            O 1 Reply Last reply Reply Quote 0
            • O
              octa_yk @veye_xumm last edited by octa_yk

              I don't have much experience with this either.

              In other words, I have never connected this camera to NX to display four cameras. There is no guarantee that I can. Is that correct?

              Also, you can go to nvidia's forum to ask this question. They should have more experience.

              There has been some discussion about this on the nvidia forums, but nvidia has stated that it is possible to connect 4 cameras.

              If you can't connect them, then the problem is with the camera itself.
              In other words, the camera is reserving more bandwidth than it needs, and if the total amount exceeds the limit, an error will occur.

              veye_xumm 1 Reply Last reply Reply Quote 0
              • veye_xumm
                veye_xumm @octa_yk last edited by

                @octa_yk I don't think it has anything to do with bandwidth, it's a problem with the gstreamer command. It has nothing to do with the camera, it's the display.

                O 1 Reply Last reply Reply Quote 0
                • O
                  octa_yk @veye_xumm last edited by

                  @veye_xumm

                  You do not need to use gstreamer.

                  So how can I connect and display four cameras?
                  Please direct me to the answer from among all the possibilities.

                  Or are you stating that you can for a phenomenon that has never been realized?

                  veye_xumm 1 Reply Last reply Reply Quote 0
                  • veye_xumm
                    veye_xumm @octa_yk last edited by

                    @octa_yk
                    Hi,The following command can connect two cameras at the same time.

                    gst-launch-1.0 -v \
                    nvcompositor name=mix \
                    sink_0::xpos=0    sink_0::ypos=0   sink_0::width=640 sink_0::height=360 \
                    sink_1::xpos=640 sink_1::ypos=0   sink_1::width=640 sink_1::height=360 \
                    ! 'video/x-raw(memory:NVMM),format=RGBA,width=1920,height=1080,framerate=30/1' ! nvvidconv ! nvoverlaysink \
                    v4l2src device=/dev/video2 ! 'video/x-raw,format=YUY2,width=640,height=360,framerate=30/1' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=RGBA,width=640,height=360,pixel-aspect-ratio=1/1' ! queue ! mix.sink_0 \
                    v4l2src device=/dev/video3 ! 'video/x-raw,format=YUY2,width=640,height=360,framerate=30/1' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=RGBA,width=640,height=360,pixel-aspect-ratio=1/1' ! queue ! mix.sink_1 \
                    

                    When I try to connect 4 cameras at the same time, an error is reported.

                    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
                    

                    So I google it,and got this:
                    https://forums.developer.nvidia.com/t/use-gstreamer-to-open-two-usb-cameras-failed-to-allocate-required-memory/122843

                    I suggest you try the patch mentioned there.

                    The device I used : Jetson NX Jetpack4.6.1.

                    O 1 Reply Last reply Reply Quote 0
                    • O
                      octa_yk @veye_xumm last edited by octa_yk

                      @veye_xumm

                      If you applied a batch using "Jetson NX Jetpack 4.6.1", were you able to successfully connect 4 cameras?

                      veye_xumm 1 Reply Last reply Reply Quote 0
                      • veye_xumm
                        veye_xumm @octa_yk last edited by

                        @octa_yk No, this is just a suggestion for you.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post