Monochrome NVJPEGENC low framerate on Jetson NX

Hello everyone,

I have been trying to record a video stream from an IMX252 monochrome camera using a Jetson NX and developer board. I am using gstreamer to record this camera. Prior to running my gstreamer pipeline, I use v4l2-ctl to set the camera settings. These are the settings I set:

v4l2-ctl -d /dev/video0 --set-ctrl frame_rate=60 --set-ctrl gain=50 --set-ctrl exposure=1000

This is one of the gstreamer pipelines I am using:

gst-launch-1.0 -v v4l2src device=/dev/video0 ! 'video/x-raw, width=2048, height=1536, format=GRAY8' ! nvvidconv ! videoconvert ! nvjpegenc ! qtmux name=mux ! filesink location=test.mov sync=false -e

In this pipeline I am able to encode a video using nvjpegenc into an mov file. When I launch the mov file on VLC and open the codec information I get:

fps52

As you can see the camera is not recording at 60 FPS and the colorspace is not GRAY8.

The second pipeline I have tried is this:

gst-launch-1.0 -v v4l2src device=/dev/video0 ! 'video/x-raw, width=2048, height=1536, format=GRAY8' ! nvvidconv ! videoconvert ! 'video/x-raw, format=GRAY8' ! nvjpegenc ! qtmux name=mux ! filesink location=test2.mov sync=false -e

In this pipeline I am forcing the NVJPEGENC to use GRAY8 as the colorspace but the video only records at 10FPS.

I am aware that nvarguscamerasrc will not work with a monochrome camera because that src does not support grayscale. Actually, not much from nvidias libraries support grayscale, that is the reason why I am using v4l2src. Does anyone know why I cannot encode at 60FPS? The camera driver supports up to 120fps so 60fps should be no problem. Any help or advice is greatly appreciated.

Thank you,
Frank

Since I am a new user, I was not allowed to post more than one picture. Here is the other picture that shows 10fps:

10fps

The colorspace is most certainly gray8.

Any idea why I cannot record at 60FPS? I even tried setting the framerate in my caps to 60/1 but all I get us an internal data stream error. Any help us greatly appreciated!

Hi,
It is constraint of hardware jpeg encoder. Suggest you use hardware h264/h265 encoder to have better compression ratio and performance.

Interesting. I ran a different Jetson NX with two IMX477 cameras and I am able to encode both streams at 3840X2160 @30FPS and 1920X1080 @60FPS using NVJPEGENC.

Hi,
GRAY8 is not supported by hardware jpeg encoder and h264/h265 encoder. You would need to convert to YUV420(I420 or NV12) for encoding. The performance bottleneck could be in format conversion.

I have tried this as well but I still cannot get it to record at 60FPS. It gets to about 50-55 FPS but never 60. I also tried 30FPS but that also does not work.

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