Navigation

    VEYE IMAGING Forum

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

    UNSOLVED IMX307使用抓拍模式pipeline启动失败

    CS MIPI camera
    2
    11
    1160
    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.
    • veye_xumm
      veye_xumm @lyj last edited by

      @lyj
      请直接执行:

      gst-launch-1.0 v4l2src num-buffers=1 ! "video/x-raw,format=(string)UYVY, width=(int)2560, height=(int)1440" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvjpegenc ! filesink location=jpgname.jpg
      

      把你这边的提示信息发出来看看。

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

        @veye_xumm 可我是双相机呢,我有两个相机,我要指定一下吧

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

          @lyj
          取video0

          gst-launch-1.0 v4l2src -d /dev/video0 num-buffers=1 ! "video/x-raw,format=(string)UYVY, width=(int)2560, height=(int)1440" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvjpegenc ! filesink location=jpgname.jpg
          

          取video1

          gst-launch-1.0 v4l2src -d /dev/video1 num-buffers=1 ! "video/x-raw,format=(string)UYVY, width=(int)2560, height=(int)1440" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvjpegenc ! filesink location=jpgname.jpg
          
          L 2 Replies Last reply Reply Quote 0
          • L
            lyj @veye_xumm last edited by

            @veye_xumm 我试试

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

              @veye_xumm

              cap = cv2.VideoCapture('v4l2src -d /dev/video0 num-buffers=1 ! \"video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080\" ! nvvidconv ! \"video/x-raw(memory:NVMM),format=(string)I420\" ! nvjpegenc ! filesink location=jpgname.jpg')
              

              我使用这段代码,提示错误如下微信图片_20231025112341.jpg

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

                @lyj
                这脚本不是直接这样扔到python代码里面的啊。
                你如果一定要用python去调用shell脚本。可以参考:

                import subprocess
                
                # 定义要执行的GStreamer命令
                gstreamer_command = "gst-launch-1.0 v4l2src -d /dev/video0 num-buffers=1 ! 'video/x-raw,format=(string)UYVY, width=(int)2560, height=(int)1440' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=(string)I420' ! nvjpegenc ! filesink location=jpgname.jpg"
                
                # 使用subprocess运行GStreamer命令
                try:
                    subprocess.run(gstreamer_command, shell=True, check=True)
                    print("GStreamer command executed successfully.")
                except subprocess.CalledProcessError as e:
                    print(f"Error executing GStreamer command: {e}")
                
                
                L 3 Replies Last reply Reply Quote 0
                • L
                  lyj @veye_xumm last edited by

                  @veye_xumm 为啥视频预览可以用python调用,这个不行呢

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

                    @veye_xumm 还得是大佬出手,我还有个问题,这个图片只能保存成jpg吗?能不能是bmp格式

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

                      @veye_xumm 请问这个抓拍的图片可以弄成视频流吗?必须保存成图片吗?

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

                        @lyj 这个本质上是gstreamer的一个命令行,你可以上网上或者上英伟达的资料网站上查一下是否有压缩成视频流的,或者压缩成bmp的相关gstreamer plugin。

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