Jetson - embedding hardware decoded video stream into Qt
-
Platform: Jetson Orin Nano 8gb dev kit running 22.04.5 LTS Jammy
I’ll going to keep this short and right to the issue.
I'm trying to take a video stream (HLS for now), hardware decode it, fully utilizing Jetsons capabilities, and then display it within a simple Qt GUI.Is there a way to embed a video stream into Qt without leaving GPU memory? I've seen online elements like qml6glsink be mentioned but I am limited to GStreamer 1.20 because NVIDIA's hardware acceleration elements are only available in that version.
My test Gstreamer pipline works no problem:
gst-launch-1.0 souphttpsrc location="https://cdn-004.whatsupcams.com/hls/hr_dubrovnik07.m3u8" ! hlsdemux ! tsdemux ! queue ! h264parse ! nvv4l2decoder ! nvvidconv ! nveglglessingMy question is, what can I do to display my hardware accelerated stream within Qt? The video stream must be embedded within a GUI and not be opened in a separate window.
As I see it, I have a couple of options:Build a newer version of GStreamer to access elements like qml6glsink (will NVIDIA elements still work?)
use nveglglessink + VideoOverlay (kind of a hack + could I add an overly to it?)
Use software decodingJust to note, I am very new with Jetson env, Qt and video signal processing so if you have any resources on how to achieve my goal, I would appriciate it 🙏
-
Platform: Jetson Orin Nano 8gb dev kit running 22.04.5 LTS Jammy
I’ll going to keep this short and right to the issue.
I'm trying to take a video stream (HLS for now), hardware decode it, fully utilizing Jetsons capabilities, and then display it within a simple Qt GUI.Is there a way to embed a video stream into Qt without leaving GPU memory? I've seen online elements like qml6glsink be mentioned but I am limited to GStreamer 1.20 because NVIDIA's hardware acceleration elements are only available in that version.
My test Gstreamer pipline works no problem:
gst-launch-1.0 souphttpsrc location="https://cdn-004.whatsupcams.com/hls/hr_dubrovnik07.m3u8" ! hlsdemux ! tsdemux ! queue ! h264parse ! nvv4l2decoder ! nvvidconv ! nveglglessingMy question is, what can I do to display my hardware accelerated stream within Qt? The video stream must be embedded within a GUI and not be opened in a separate window.
As I see it, I have a couple of options:Build a newer version of GStreamer to access elements like qml6glsink (will NVIDIA elements still work?)
use nveglglessink + VideoOverlay (kind of a hack + could I add an overly to it?)
Use software decodingJust to note, I am very new with Jetson env, Qt and video signal processing so if you have any resources on how to achieve my goal, I would appriciate it 🙏
@luka.ib Hi Luka. You need to take each videoframe of your streaming , convert it to Image and then display It inside the Qt GUi windows in realtime. You will create a separated thread for getting the VideoFrames and converting them, then send the updated Image to the UI. It should be okay that way.
-
Hi and welcome to devnet,
Which exact version of Qt are you using ?
If you are locked to that old version of GStreamer, one option is to use Qt5 which provides the option of starting custom GStreamer pipelines and display them. Taking into account the fact that Qt 5 has reached end of life but it could be a starting point. -
https://github.com/denisgottardello/QtFFmpegPlayer
Works on Qt5 and 6, play a remote file, rtsp, webcam etc. It is based on ffmpeg library and, as explained above, the gpu usage is related at the size and definition of the stream.