Power Consumption of Hardware Encoder

Hello,

I have been doing some tests with the various hardware accelerated encoders on my Xavier NX (with gstreamer). For example I would encode using nvv4l2h264enc:

gst-launch-1.0 filesrc location=testt.raw ! 'video/x-raw, width=(int)1440, height=(int)1080, framerate=(fraction)60/1' ! rawvideoparse width=1440 height=1080 format=gray8 framerate=60 ! nvvidconv ! nvv4l2h264enc control-rate=0 qp-range=0,1:0,1:0,1 quant-i-frames=0 quant-p-frames=0 MeasureEncoderLatency=true ! qtmux ! filesink location=test.mp4

I would notice 8W of power consumption. The GPU was at 0% and the CPU, according to tegrastats was on average (per core):

22.88% , 23.21% , 24.79% , 25.91% , 24.58% , 19.58%

The same happens if I used OpenMax, or if I test with H265. Where’s the 8W coming from if both the CPU and GPU are not being stressed out? Is the Hardware Encoder that power hungry?

Hi,
It should be from CPU and hardware encoder NVENC. In the pipeline the frames are from a file, so it needs to read data from a file and copy to NVMM buffer. Also encoding engine consumes power.

Please check the encoding framerate by running:

gst-launch-1.0 filesrc location=testt.raw ! 'video/x-raw, width=(int)1440, height=(int)1080, framerate=(fraction)60/1' ! rawvideoparse width=1440 height=1080 format=gray8 framerate=60 ! nvvidconv ! nvv4l2h264enc control-rate=0 qp-range=0,1:0,1:0,1 quant-i-frames=0 quant-p-frames=0 MeasureEncoderLatency=true ! fpsdisplaysink text-overlay=0 video-sink='filesink location=a.264 sync=0' -v

If you read data from a file, the encoding framerate may not be steadily 60fps, since it continuously reads frames. It is not same as a live source.

Dear @DaneLLL I have tried your pipeline, but it does not run, and gives me the following error:

Setting pipeline to PAUSED ...
Opening in BLOCKING MODE
Opening in BLOCKING MODE 
gst_v4l2_video_enc_open: open trace file successfully
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstAutoVideoSink:fps-display-video_sink/GstNvOverlaySink-nvoverlaysink:fps-display-video_sink-actual-sink-nvoverlay: sync = true
/GstPipeline:pipeline0/GstRawVideoParse:rawvideoparse0.GstPad:src: caps = video/x-raw, format=(string)GRAY8, width=(int)1440, height=(int)1080, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)1:4:0:0, framerate=(fraction)60/1
ERROR: from element /GstPipeline:pipeline0/GstRawVideoParse:rawvideoparse0: Internal data stream error.
Additional debug info:
gstbaseparse.c(3611): gst_base_parse_loop (): /GstPipeline:pipeline0/GstRawVideoParse:rawvideoparse0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

Hi,
Looks like there is a typo. It should be video-sink instead of videosink. I have corrected the pipeline and please give it a try.

Hi @DaneLLL Running the test, gstreamer outputed the following FPS:

  • 63.61
  • 61.87
  • 61.27
  • 60.89
  • 60.73
  • 60.6
  • 60.53
  • 60.46
  • 60.30
  • 60.36
  • 60.33
  • 60.32
  • 60.29

These values seem steady