Gstreamer pipeline with splitmuxsink performance degradation

Hello,

I’m using GStreamer on my Jetson device with JetPack 4.4.1 to capture video from cameras. When I run the following pipeline:

gst-launch-1.0 -vvv \
    v4l2src do-timestamp=true device=/dev/video1 ! \
    image/jpeg,framerate=60/1,width=1280,height=960 ! \
    videorate ! \
    image/jpeg,framerate=10/1 ! \
    nvv4l2decoder mjpeg=1 ! \
    nvvidconv flip-method=2 ! \
    video/x-raw(memory:NVMM),format=RGBA,width=1280,height=960 ! \
    fakesink name=LEFT_CAMERA_sink sync=true \

everything works well.
However, when I use the following pipeline to record video:

gst-launch-1.0 -vvv \
    v4l2src do-timestamp=true device=/dev/video1 ! \
    image/jpeg,framerate=60/1,width=1280,height=960 ! \
    videorate ! \
    image/jpeg,framerate=10/1 ! \
    nvv4l2decoder mjpeg=1 ! \
    nvvidconv flip-method=2 ! \
    tee name=t_LEFT_CAMERA ! \
    queue ! \
    video/x-raw(memory:NVMM),format=RGBA,width=1280,height=960 ! \
    fakesink name=LEFT_CAMERA_sink sync=true \
    t_LEFT_CAMERA. ! \
    queue ! \
    nvvidconv ! \
    nvv4l2h265enc ! \
    h265parse ! \
    tee name=t_LEFT_CAMERA_h265 ! \
    queue ! \
    splitmuxsink location="/home/deep/shopic_videos/LEFT_CAMERA_clip_%06d.mp4" \
    max-size-time=5000000000 max-files=1000 async-finalize=true async-handling=true async=false

there is a significant performance drop, with operations on the device slowing down by almost half.

Does anyone have suggestions for optimizing this pipeline or ways to minimize the impact of video recording on overall performance?

Thank you!

Hi,
Please try the items and see if there is improvement:

  1. Configure sync=0 to fakesink
  2. Run $ sudo jetson_clocks
  3. Enable the properties to nvv4l2h265enc:
  insert-vui          : Insert H.265 VUI(Video Usability Information) in SPS
                        flags: readable, writable
                        Boolean. Default: false
  maxperf-enable      : Enable or Disable Max Performance mode
                        flags: readable, writable, changeable only in NULL or READY state
                        Boolean. Default: false

If there is no further improvement, suggest break down the pipeline to clarify which plugin triggers it.

And you can run sudo tegrastats to check system status.

1 Like

Hello,

Thank you very much for your detailed response. I apologize for any confusion, but could you provide a more in-depth explanation on a couple of points?

  • How can I configure sync=0 for a specific module within the pipeline or for the entire pipeline?
  • On my Jetson device, when I run $ sudo jetson_clocks, I don’t see any output. Additionally, when I execute:
    $ sudo jetson_clocks --show
    SOC family:tegra194  Machine:NVIDIA Jetson Xavier NX Developer Kit
    Online CPUs: 0-5
    CPU Cluster Switching: Disabled
    cpu0: Online=1 Governor=schedutil MinFreq=1420800 MaxFreq=1420800 CurrentFreq=1420800 IdleStates: 
    C1=0 c6=0 
    cpu1: Online=1 Governor=schedutil MinFreq=1420800 MaxFreq=1420800 CurrentFreq=1420800 IdleStates: C1=0 c6=0 
    cpu2: Online=1 Governor=schedutil MinFreq=1420800 MaxFreq=1420800 CurrentFreq=1420800 IdleStates: C1=0 c6=0 
    cpu3: Online=1 Governor=schedutil MinFreq=1420800 MaxFreq=1420800 CurrentFreq=1420800 IdleStates: C1=0 c6=0 
    cpu4: Online=1 Governor=schedutil MinFreq=1420800 MaxFreq=1420800 CurrentFreq=1420800 IdleStates: C1=0 c6=0 
    cpu5: Online=1 Governor=schedutil MinFreq=1420800 MaxFreq=1420800 CurrentFreq=1420800 IdleStates: C1=0 c6=0 
    GPU MinFreq=1109250000 MaxFreq=1109250000 CurrentFreq=1109250000
    EMC MinFreq=204000000 MaxFreq=1600000000 CurrentFreq=1600000000 FreqOverride=1
    Fan: speed=170
    NV Power Mode: MODE_15W_6CORE
    
    and also
    $ sudo jetson_clocks --help
    Maximize jetson performance by setting static max frequency to CPU, GPU and EMC clocks.
    Usage:
    jetson_clocks.sh [options]
      options,
      --show             display current settings
      --fan              set PWM fan speed to maximal
      --store [file]     store current settings to a file (default: ${HOME}/l4t_dfs.conf)
      --restore [file]   restore saved settings from a file (default: ${HOME}/l4t_dfs.conf)
      run jetson_clocks.sh without any option to set static max frequency to CPU, GPU and EMC clocks.
    

I still don’t fully understand how to enable the properties for nvv4l2h265enc.

Additionally, here is the result from inspecting the plugin:

$ gst-inspect-1.0 nvv4l2h265enc
...
  maxperf-enable      : Enable or Disable Max Performance mode
                        flags: readable, writable, changeable only in NULL or READY state
                        Boolean. Default: false
...
  insert-vui          : Insert H.265 VUI(Video Usability Information) in SPS
                        flags: readable, writable
                        Boolean. Default: false

Thank you in advance for your support.

Hi,
You can enable the properties like:

... ! nvv4l2h265enc maxperf-enable=1 insert-vui=1 ! ...

Thank you for the response. I’ll test it and update you with the results. It may take a couple of days, as I have other tasks to complete.