Jetson orin nx camera

jetson orin nx
ubutun 20.04
GStreamer-1.16
我根据NVIDIA文档中的教程使用gstreamer打开摄像头时报错:设置暂停管道 …
Could not open DRM failed
错误: 管道不想暂停。
错误:来自组件 /GstPipeline:pipeline0/GstNvDrmVideoSink:nvdrmvideosink0:Gstreamer 错误:改变状态时失败,并且一些组件无法提供有关错误原因的信息。
额外的调试信息:
gstbasesink.c(5367): gst_base_sink_change_state (): /GstPipeline:pipeline0/GstNvDrmVideoSink:nvdrmvideosink0:
Failed to start
设置 NULL 管道 …
释放管道资源 …

这时我运行的文档中的程序:gst-launch-1.0 nvarguscamerasrc ! ‘video/x-raw(memory:NVMM),
width=(int)1920, height=(int)1080, format=(string)NV12,
framerate=(fraction)30/1’ ! queue ! nvdrmvideosink -e
尝试了几次后没能解决问题,请问能告诉我怎么解决吗,谢谢!

hello 1799545238,

is it complete error messages? may I also know which camera module you’re working with?
please give below pipeline a try besides using nvdrmvideosink DRM video sink element.
for instance,
$ export DISPLAY=:0
$ gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM),framerate=30/1,format=NV12' ! nvvidconv ! xvimagesink -e

if above pipeline still not working, please also refer to Approaches for Validating and Testing the V4L2 Driver to narrow down the issue.

你好,我使用的是imx317的usb摄像头,运行了您提供的代码报错:tennis-~$ gst-launch-1.0 nvarguscamerasrc ! ‘video/x-raw(memory:NVMM),framerate=30/1,format=NV12’ ! nvvidconv ! xvimagesink -e
Invalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keynvbufsurftransform: Could not get EGL display connection
设置暂停管道 …
Invalid MIT-MAGIC-COOKIE-1 key错误: 管道不想暂停。
错误:来自组件 /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0:Could not initialise Xv output
额外的调试信息:
xvimagesink.c(1773): gst_xv_image_sink_open (): /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0:
Could not open display (null)
设置 NULL 管道 …
释放管道资源 …

这是完整的错误信息,另外,我使用opencv cv::VideoCapture cap(0,cv::CAP_V4L2);打开(1280*720)的摄像头,为什么平均帧率只有10帧左右,我的相机是可以达到120帧的

你好,我在运行x服务器 $ xinit & 后,运行您提供的代码变成了另外的错误:
tennis-~$ gst-launch-1.0 nvarguscamerasrc ! ‘video/x-raw(memory:NVMM),framerate=30/1,format=NV12’ ! nvvidconv ! xvimagesink -e
设置暂停管道 …
管道正在使用且不需要 PREROLL …
设置播放管道 …
New clock: GstSystemClock
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:751 No cameras available
警告:来自组件 /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0:无法建立有效的管道,请改用队列。
额外的调试信息:
gstbasesink.c(1209): gst_base_sink_query_latency (): /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0:
Not enough buffering available for the processing deadline of 0:00:00.015000000, add enough queues to buffer 0:00:00.015000000 additional data. Shortening processing latency to 0:00:00.000000000.
收到来自组件“pipeline0”的 EOS 信号。
Execution ended after 0:00:00.002541041
设置 NULL 管道 …
释放管道资源 …

hello 1799545238,

please test with v4l2src instead; nvarguscamerasrc it doesn’t works with USB cameras.

你好,是使用这一段代码打开吗
$gst-launch-1.0 v4l2src device=/dev/video0 ! ‘video/x-raw, format=YUY2, width=640, height=480, framerate=30/1’ ! xvimagesink -ev
这个的视频格式是YUY2,我应该怎么使用上MJPG,谢谢

hello 1799545238,

please check you’re able to access to the camera stream.
if there’s no failure. you may extend the pipeline for adding video converter to encode the frames.
for instance,
$ gst-launch-1.0 v4l2src device=/dev/video1 ! "video/x-raw, format=(string)UYVY, width=(int)1920, height=(int)1080" ! fpsdisplaysink text-overlay=0 video-sink=fakesink sync=0 -v
and,
$ gst-launch-1.0 v4l2src num-buffers=1 ! "video/x-raw, format=(string)UYVY, width=(int)1280, height=(int)800, framerate=(fraction)30/1" ! nvvidconv ! nvjpegenc ! filesink location=cam0.jpg

我使用这段代码的时候是可以打开摄像头的:
gst-launch-1.0 v4l2src device=/dev/video0 ! ‘video/x-raw, format=YUY2, width=640, height=480, framerate=30/1’ ! xvimagesink -ev
但当我使用您提供的;两段代码运行后都报错:
tennis-~$ gst-launch-1.0 v4l2src num-buffers=1 ! “video/x-raw, format=(string)UYVY, width=(int)1280, height=(int)800, framerate=(fraction)30/1” ! nvvidconv ! nvjpegenc ! filesink location=cam0.jpg
设置暂停管道 …
管道正在使用且不需要 PREROLL …
设置播放管道 …
New clock: GstSystemClock
错误:来自组件 /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:Internal data stream error.
额外的调试信息:
gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.000147874
设置 NULL 管道 …
释放管道资源 …

hello 1799545238,

they’re sample pipelines, please revise the format types to YUV2 accordingly. (as YUYV is defined as YUY2).
for instance
$ gst-launch-1.0 v4l2src num-buffers=1 device=/dev/video0 ! ‘video/x-raw, format=YUY2, width=640, height=480, framerate=30/1’ ! nvvidconv ! nvjpegenc ! filesink location=cam0.jpg -e

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.