Recording h264 videos from 3840x2160@30fps camera

I want to record a h264 videos from my 4K ( 3840x2160@30fps) camera on Jetson nano. But the fps is low(17fps). I think, the nvjpegdec is slower than nvv4l2h264enc. How can I up the fps?

My gstreamer’s pipeline is

gst-launch-1.0 -e v4l2src device=/dev/video1 io-mode=2 ! ‘image/jpeg,width=3840,height=2160,framerate=30/1’ ! nvjpegdec ! ‘video/x-raw’ ! nvvidconv ! nvv4l2h264enc ! h264parse ! queue2 ! qtmux ! filesink location=4K_h264HW_nvjpeg.mp4 -e

But, full HD ( 1920x1080@30fps) was fine(29.394fps).

gst-launch-1.0 -e v4l2src device=/dev/video1 io-mode=2 ! ‘image/jpeg,width=1920,height=1080,framerate=30/1’ ! nvjpegdec ! ‘video/x-raw’ ! nvvidconv ! nvv4l2h264enc ! h264parse ! queue2 ! qtmux ! filesink location=FHD_h264HW_nvjpeg.mp4 -e

My environment is

  • R32 (release), REVISION: 4.3, GCID: 21589087, BOARD: t210ref, EABI: aarch64, DATE: Fri Jun 26 04:38:25 UTC 2020
  • IMX317 USB camera. 3840x2160@30fps. ‘MJPG’ (compressed).

Thank you for your help.

You may try:

  • Removing the copy to/from standard memory between nvjpegdec and h264 encoder. nvjpegdec can output into NVMM memory:
gst-launch-1.0 -e v4l2src device=/dev/video1 io-mode=2 ! image/jpeg, width=3840, height=2160, framerate=30/1 ! nvjpegdec ! 'video/x-raw(memory:NVMM), format=I420' ! nvv4l2h264enc ! h264parse ! queue2 ! qtmux ! filesink location=4K_h264HW_nvjpeg.mp4
  • Try nvv4l2decoder instead of nvjpegdec:
gst-launch-1.0 -e v4l2src device=/dev/video1 io-mode=2 ! image/jpeg, width=3840, height=2160, framerate=30/1 ! nvv4l2decoder mjpeg=1 ! 'video/x-raw(memory:NVMM), format=NV12' ! nvv4l2h264enc ! h264parse ! queue2 ! qtmux ! filesink location=4K_h264HW_nvjpeg.mp4

Thank you for your support!

1st pipeline could not perform on my Jetson nano. 2nd pipeline was to faster than yesterday! The fps was 29.644!

But, there are a RGB bug in libnvtvmr.zip. So I attached this patch libnvtvmr.zip, the RGP problems was solved.