Jetson Nano H264 decoder performance

Hi.
Video decode section of the specs for Jetson Nano states: “4x 1080p60”. It confuses me a little and there is no answers on this forum I can find. So here is the questions:

  1. Is it possible to decode only one 1080p h264 stream with 240fps performance?
  2. If 240fps for one 1080p h264 stream is possible, then the time it takes to decode 1 frame should be around 4.16ms average. Is this correct?

Thanks in advance.

Hi,
It is able to achieve 1080p 240fps. Please try

$ sudo nvpmodel -m 0
$ sudo jetson_clocks
$ gst-launch-1.0 filesrc location= jellyfish-5-mbps-hd-h264.mkv ! matroskademux ! h264parse ! nvv4l2decoder enable-max-performance=1 ! fpsdisplaysink text-overlay=0 video-sink=fakesink sync=0 -v

Video file is
https://jell.yfish.us/media/jellyfish-5-mbps-hd-h264.mkv

Log:

/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 169, dropped: 0, current: 336.53, average: 336.53
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 335, dropped: 0, current: 331.75, average: 334.15
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 500, dropped: 0, current: 329.10, average: 332.46
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 657, dropped: 0, current: 313.16, average: 327.64
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 813, dropped: 0, current: 310.31, average: 324.16

Thank you! 300+fps looks pretty decent if not awesome.
But does this means decoder latency is less than 4ms?
I’m trying to build real time h.264 transmitter/receiver complex and looking for a device on a receiver part which able to produce as small decode latency as possible. I’ve conducted a lot of research lately and saw examples where high decoder frame rate doesn’t guarantees low latency. Sometimes it’s quite the opposite. For example ffmpeg software decoder has multi-threading support. Which increases decoding frame rate dramatically, but actually introduces a lot more latency than single-threaded mode. The reason for that is ffmpeg decoder can only process multiple frames in parallel, so for N threads it waits for N packets to be consumed and only after that starts processing them in parallel. Leading to N*frame_duration latency.
So I’m trying to understand how Jetson Nano’s high decoding rate correlates to decoding latency.

PS
I don’t have Jetson device yet. Just checking if it corresponds to my requirements.

Hi,
If the h264 stream is encoded in I P P P… , there is one-frame latency since decoder has to keep at least one reference frame. However, this is an ideal condition. There is buffering mechanism which may increase latency. If you need low latency, suggest you use jetson_multimedia_api instead of gstreamer. I would say it is not guaranteed to have 4ms latency for 1080p 240fps.

Hi again!
Finally got the device on my hands and conducted some h264 decoding tests. Why is there are so big difference between ffmpeg’s h264_nvv4l2dec and gstreamer’s nvv4l2decoder ?
When I run:

gst-launch-1.0 filesrc location= jellyfish-5-mbps-hd-h264.mkv ! matroskademux ! h264parse ! nvv4l2decoder enable-max-performance=1 ! fpsdisplaysink text-overlay=0 video-sink=fakesink sync=0 -v

it gives me 330+ fps
When I run:

ffmpeg -c:v h264_nvv4l2dec -i jellyfish-5-mbps-hd-h264.mkv -f null -

it only decodes 140+ fps. That’s more than 2 time slower which is very strange, because I thought ffmpeg with h264_nvv4l2dec also uses jetson_multimedia_api. Could you explain why is this happens, please?
ffmpeg was installed according to these instructions: https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/multimedia.html#wwpID0E0IB0HA
Both commands was issued after maximizing performance with:

sudo nvpmodel -m 0
sudo jetson_clocks
1 Like