Bug 378832 - use of vaapi in transcoding and rendering
Summary: use of vaapi in transcoding and rendering
Status: RESOLVED WORKSFORME
Alias: None
Product: kdenlive
Classification: Applications
Component: Video Display & Export (show other bugs)
Version: 18.04.1
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords:
: 370480 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-04-16 09:13 UTC by Anton Gubarkov
Modified: 2022-09-25 04:48 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Gubarkov 2017-04-16 09:13:11 UTC
I can use a command line below to create a proxy clip at 7x speed, thanks to VAAPI based h264 decoding and resizing. 
ffmpeg  -vaapi_device /dev/dri/renderD128   -hwaccel vaapi -hwaccel_output_format vaapi -i input.MTS -an -vf 'format=nv12|vaapi,hwupload,scale_vaapi=w=1280:h=720:format=yuv420p,hwdownload,format=nv12' -c:v  dnxhd -b:v 36M  1.mov

In order to be able to achieve the same in the encoding profile, I would need to inject -vaapi_device /dev/dri/renderD128   -hwaccel vaapi -hwaccel_output_format vaapi before the "-i input-file.MTS" part.  The UI doesn't allow me to do it.
Comment 1 Jean-Baptiste Mardelle 2017-04-18 05:45:41 UTC
Git commit 456635ac2c5e15d3445d9889cdb0e42b5d984811 by Jean-Baptiste Mardelle.
Committed on 18/04/2017 at 05:45.
Pushed by mardelle into branch 'Applications/17.04'.

Allow passing pre-parameters using "-i" to specify where the input file name should go in ffmpeg parameters
Should work in proxy and transcoding, for example:
-vaapi_device /dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -i -an -c:v dnxhd
Will insert source file name after "-i".

M  +1    -1    src/mainwindow.cpp
M  +18   -7    src/project/cliptranscode.cpp
M  +6    -1    src/project/jobs/cutclipjob.cpp
M  +11   -3    src/project/jobs/proxyclipjob.cpp
M  +0    -2    src/ui/projectsettings_ui.ui

https://commits.kde.org/kdenlive/456635ac2c5e15d3445d9889cdb0e42b5d984811
Comment 2 Anton Gubarkov 2017-04-18 07:28:06 UTC
Can you merge to master branch too so I could test?

Thanks.
Comment 3 Anton Gubarkov 2017-04-18 07:28:16 UTC
Can you merge to master branch too so I could test?

Thanks.
Comment 4 Anton Gubarkov 2017-04-18 15:19:27 UTC
I was able to patch manually. I confirm this is working for me. Thanks a lot!
Comment 5 José JORGE 2018-04-03 18:43:00 UTC
(In reply to Anton Gubarkov from comment #4)
> I was able to patch manually. I confirm this is working for me. Thanks a lot!

Can you please paste the proxy clip line you are using. I got no success with adding "-vaapi_device /dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -i" before the existing parameters in default MPEG2 proxy clips.
Comment 6 Anton Gubarkov 2018-04-04 10:44:14 UTC
I use the following line for decode&rescale with subsequent encode to DNxHD

-vaapi_device /dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -i -vf format=nv12|vaapi,hwupload,scale_vaapi=w=1280:h=720:format=yuv420p,hwdownload,format=nv12 -c:v dnxhd -b:v 60M -c:a aac
Comment 7 José JORGE 2018-04-04 18:55:50 UTC
(In reply to Anton Gubarkov from comment #6)
> I use the following line for decode&rescale with subsequent encode to DNxHD
> 

Thanks, I was able to get fast proxy file with this setting. Now I have another problem : the proxy clip is used when reading directly the clip, but is not used anymore when the clip is in the timeline. I think I will open a bug report about that.
Comment 8 Anton Gubarkov 2018-05-26 18:45:57 UTC
The commit message and wording of this bug both suggest that VAAPI should work for rendering too, however it is not clear how to specify vaapi ffmpeg options in rendering profile. It seems that melt is taking these options and there are no melt options documented for vaapi and avformat consumer. 

I do confirm again that transcoding/proxy clips work with vaapi OK.
Comment 9 emohr 2018-11-10 14:41:43 UTC
*** Bug 370480 has been marked as a duplicate of this bug. ***
Comment 10 farid 2022-08-26 14:33:29 UTC
Can you please test the latest version and see if you can still reproduce?
Comment 11 Bug Janitor Service 2022-09-10 04:36:33 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 12 Bug Janitor Service 2022-09-25 04:48:39 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!