Jetson-utils

你好,我使用的设备是jetson orin nx,
在使用jetson-utils时,使用VideoOptions和VideoSource进行CSI相机的图像录制,可以达到19201080 60fps,但是当我使用这两个类进行将每一帧的图像进行逐帧保存时,他的帧率只有4fps左右,并且我看到他仅仅在cpu上运行,并没有像录制视频一样使用到gpu,请问我应该怎么修改才能达到像视频录制一样快的帧率,下面时采集图像的主要代码:
videoSource
input = videoSource::Create(“csi://0”,options1);
videoOutput* output = videoOutput::Create(“file://…/resource/image_%i.jpg”,options1);
期待您的回复,感谢。

hello 1799545238,

may I know what’s the real use-case, would you like to capture every JPG file for the streaming?
for instance, 60 JPG images per second with your 1920x1080@60-fps camera sensor?

对的,我想以图像的形式把视频的每一帧保存下来,是否我应该使用jetson-utils搭配nvjpeg来实现此功能?

hello 1799545238,

let’s try with below gst pipeline for quick testing.
it’ll enable camera stream for saving 90 frames, (i.e. it should runs around 3-sec with a 30-fps camera sensor)
please update the resolution, fps…etc per your camera capability,
$ gst-launch-1.0 nvarguscamerasrc sensor-id=0 sensor-mode=0 num-buffers=90 ! 'video/x-raw(memory:NVMM),width=1920, height=1080, framerate=30/1, format=NV12' ! nvvidconv ! jpegenc ! multifilesink location=~/Desktop/tmp/capture%d.jpeg -e

很抱歉,我在运行您提供的代码时报错:ARGUS_ERROR: Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute: 1139 InvalidState.
GST_ARGUS: Cleaning up
nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadExecute:694 NvBufSurfaceFromFd Failed.
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadFunction:247 (propagating)
错误:来自组件 /GstPipeline:pipeline0/GstNvArgusCameraSrc:nvarguscamerasrc0:CANCELLED
额外的调试信息:
Argus Error Status
允许关闭时发出 EOS 信号 —— 发生错误后等待EOS信号
等待 EOS 信号…

hello 1799545238,

may I know what’s the camera you’re working with? for exmaple, is it Bayer camera sensor or USB cameras?

抱歉,现在才回复你,我使用的是imx477 csi相机

hello 1799545238,

please execute $ dmesg | grep IMX477 to check you’ve sensor device register to linux kernel correctly.
you may also running v4l2 utility to check, $ v4l2-ctl -d /dev/video0 --list-formats-ext

是的,我可以读取,相机没有问题,我现在尝试使用nvjpg进行图像的编码,并且用到了multimedia中的编码图像的例子,但是我发现一张19201080的图像需要11毫秒左右,38402160的图像需要21ms左右,并且我看到jtop中的两块NVJPG和VIC使用在运行的,但是CPU的使用率也挺高的,有什么方法可以将编码的时间缩短吗

hello 1799545238,

it looks you’ve able to capture frames,
regrading to performance issues, please submit a new discussion thread to follow-up.

你好,我一直能够捕获帧,并且这个话题一开始就是在讨论性能问题,也许我的表达有误,让你误解了,我想要的是让图像帧能以60帧/秒的速度保存,请问我应该如何做到

Hi,
It should be using software encoder in jetson-utils. For optimal solution, we suggest use jetson_multimedia_api to implement your use-case. Please check the samples in

/usr/src/jetson_multimedia_api/samples

For JPEG encoding, please check the sample

/usr/src/jetson_multimedia_api/samples/05_jpeg_encode

你好,我如何把multimedia中的例程引用到我的代码中,即我应该怎么在我的cmakelists中配置multimedia必要的库,我尝试了多次,但是一直编译失败,感谢你的帮助

Hi,
Argus + hardware JPEG encoding is demonstrated in

/usr/src/jetson_multimedia_api/samples/09_argus_camera_jpeg/

You may run the sample with your camera and check if the JPEGs are saved.

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