How to accelerate decoding speed by gstreamer?

I used the command below to decode a 265 file to a yuv file:

gst-launch-1.0 filesrc location=s4k_video.h265 ! h265parse ! omxh265dec ! filesink location=s4k_video_decode.yuv -e

it spent 52 seconds decoding the file(4096*2160), but the original file is just 10s, so is there any method(command or cuda command) to accelerate the decoding speed? I always think it is hard decoding because I used gstreamer…
Thank you very much!!! Hope your help.

Hi Sea_Otter, how large does the uncompressed YUV file turn out? If you are saving that volume of uncompressed 4K video to eMMC, perhaps it is being I/O (write) limited. Seeing as you are already using the hw-accelerated omxh265dec element, you could try saving the data to an SSD or changing the filesink to nveglglessink for testing purposes. See this example H.265 decoding pipeline from the L4T Accelerated GStreamer User Guide:

gst-launch-1.0 filesrc location=<filename.mp4> ! qtdemux name=demux demux.video_0 ! queue ! h265parse ! omxh265dec ! nvoverlaysink -e

Thank you very much dusty_nv! Actually, I have already used this command, but it gave me an error like this:

ERROR: from element /GstPipeline:pipeline0/GstQTDemux:demux: This file is invalid and cannot be played.

I don’t know how to solve it. At the same time, I am confused: 1. It is a decoding command, why the input file is .mp4? 2. what’s the meaning of nvoverlaysink (and what is changing the filesink to nveglglessink, the output file path will change to the other place?)

The uncompressed yuv is 4.0 G, and I used the command below to compress it. The compressed file(.h265) is 6.0 Mb and it just used 34 seconds.

gst-launch-1.0 filesrc location=4k_video.yuv ! videoparse format=i420 width=4096 height=2160 ! omxh265enc ! 'video/x-h265, stream-format=(string)byte-stream' ! filesink location=4k_video.h265 -e

When I decoded this h.265 file to .yuv file, it cost me 52 seconds.

4GB could take the extra time to write to eMMC. Displaying the video with one of the nvoverlay or nvegl sinks avoids the I/O overhead for testing.

The decoding example references .MP4 input because it expects a compressed format before doing the decompression.

Please try nvoverlaysink or nveglglessink as @dusty_nv suggests.

You may refer to user guide also

Yes,I tried it and it will cost me just 10 seconds, the problem is…where can I find the decoded file? It’s not in the current path.Overlay it? So if I want to make h.265 file to .yuv, it seems failed.

Thanks a lot, finally I knew how to use nvoverlaysink, nvoverlaysink is used to preview video on monitor. There is no encode/decode file. If I decode 1080p, it will play xx.h265 on monitor, but maybe it doesn’t support 4k so I did not know what happend at first.