IMX307使用抓拍模式pipeline启动失败
-
IMX307,使用以下参数 v4l2src num-buffers=1 /dev/video0! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvjpegenc ! filesink location=1.jpg 启动pipeline,提示cannot find appsink in maanual pipeline,开启失败
-
@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把你这边的提示信息发出来看看。
-
@veye_xumm 可我是双相机呢,我有两个相机,我要指定一下吧
-
@lyj
取video0gst-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 -
@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')我使用这段代码,提示错误如下

-
@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}") -
@veye_xumm 为啥视频预览可以用python调用,这个不行呢
-
@veye_xumm 还得是大佬出手,我还有个问题,这个图片只能保存成jpg吗?能不能是bmp格式
-
@veye_xumm 请问这个抓拍的图片可以弄成视频流吗?必须保存成图片吗?
-
@lyj 这个本质上是gstreamer的一个命令行,你可以上网上或者上英伟达的资料网站上查一下是否有压缩成视频流的,或者压缩成bmp的相关gstreamer plugin。
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login