mltframework / mlt

MLT Multimedia Framework
https://www.mltframework.org
GNU Lesser General Public License v2.1
1.47k stars 313 forks source link

Utilizing GPU for rendering #1004

Closed shivamItt closed 1 week ago

shivamItt commented 1 month ago

Hi, I am using mlt to apply multiple filters and transition on different videos and generate a final video. I have an aws ec2 instance that has Nvidia GPU. As the aws ec2 instance does not have any display, we have to use xvfb-run command for virtual display. When I ran xvfb-run -a melt project.mlt I saw my CPU utilization went to 780 percent (I have 8 core systems). If I am running more than one rendering at the same time my ec2 instance is not able to do anything else.

On investigation, I found that mlt is not utilizing GPU at all. Note:- I am mostly using movit filters and transitions.

Can you provide your valuable input on How to enable GPU rendering in mlt?

If you have any alternative to xvfb-run please share that also, from my investigation, I see that due to xvfb CPU utilization is high.

ddennedy commented 1 month ago

Read the 3 questions from the Shotcut FAQ starting with the linked question to better understand the situation (there is no all GPU option in MLT): https://shotcut.org/FAQ/#how-does-shotcut-use-the-gpu-or-not

Obviously the parts about the UI do not apply.

As for xvfb-run, I am not sure it is the cause of high CPU. It is primarily the Qt module that needs X, but the qglsl consumer is also used to setup the OpenGL context for movit services. In other words, you will need to do some development to provide a different means and not include the qt module.