HW accelerated video decode on Jetson family of product

114 views
Skip to first unread message

Vincent Nguyen

unread,
Jun 30, 2022, 9:50:47 AM6/30/22
to Kivy users support

Good morning/afternoon,

Kivy is used as the underlying media framework for a pinball framework called MPF.

I managed to get MPF installed on a Jetson AGX Xavier (although this would apply to any Jetson), and it works fine for displaying widgets, dot matrix content, etc.

However, it crashes when it starts to play a video file (I'm using simply the demo machine provided with MPF for MC testing).

I can only infer it does so because of an improper gstreamer pipeline, not applicable on Jetson (and it's probably using RPI libraries anyway).

Also I'm pretty sure that even if it was working, it would be using CPU decode, since the proper pipeline would need to be as follow (as an example, the sink might be different):

gst-launch-1.0 filesrc location= ! \ qtdemux ! queue ! h264parse ! nvv4l2decoder ! nv3dsink -e  

Note the nvv4l2decoder node in the graph, which is actually the node responsible for HW decoding.

Hence my questions:
- I'd like to identify the part of the code use in Kivy responsible for video playback. From what I understand, this would be this file:

Is this correct ? Any pointer on how the code is architectured so I could replace the pipeline with the pipeline above ?

- My sole usage of Kivy is really through MPF, I don't really need to learn Kivy to use MPF in the first place. However for convenience of testing, I would welcome a pointer to be able to test individual capabilities of Kivy, specifically around video and audio playback

From what I could gather in the github, that would be here
(for audio)

But... could not find something equivalent for video, anyone would have a pointer ?

To note: I'm not really a SW dev, more of a HW guy. I do manage my way around playing with dependencies, simple modification of sample code to fit my needs, so hopefully the fix to enable HW acceleration on Jetson using Kivy is simple


 Thanks and regards

Elliot Garbus

unread,
Jun 30, 2022, 10:12:12 AM6/30/22
to kivy-...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/5b06a0cc-9cec-4dfc-bd3a-31bd81a31b17n%40googlegroups.com.

 

Vincent Nguyen

unread,
Jul 1, 2022, 9:46:48 AM7/1/22
to Kivy users support
Interesting, ffmpeg seems a good alternative, as there is a binary compiled version of ffmpeg which supports natively decoding.
However when reading this source code here:

It states :
This abstraction requires ffmpeg python extensions. We have made a special extension that is used for the android platform but can also be used on x86 platforms.
"

This implies I need to build from source and merge patches for HW acceleration and this particular extension, am I correct ?

Elliot Garbus

unread,
Jul 1, 2022, 12:08:32 PM7/1/22
to kivy-...@googlegroups.com
A number of the kivy devs are often on the kivy discord. I recommend asking there. 

Sent from my iPhone

On Jul 1, 2022, at 6:46 AM, Vincent Nguyen <vnguyen...@gmail.com> wrote:

Interesting, ffmpeg seems a good alternative, as there is a binary compiled version of ffmpeg which supports natively decoding.

纳尔瓦尼莫希特

unread,
Jul 1, 2022, 12:12:43 PM7/1/22
to kivy-...@googlegroups.com
Could you send link of discord group

Robert

unread,
Jul 1, 2022, 12:59:56 PM7/1/22
to Kivy users support
> This implies I need to build from source and merge patches .....

I don't know about your implication, but the is the referenced code, the page has a source download link.

https://pypi.org/project/ffpyplayer/

Elliot Garbus

unread,
Jul 1, 2022, 2:53:22 PM7/1/22
to kivy-...@googlegroups.com

From the kivy help page:

You can also try to contact us on Discord (online chat), but make sure to read the Discord rules before joining. Connect to Discord

Reply all
Reply to author
Forward
0 new messages