Hardware acceleration / vaapi

B.M. b-misc at gmx.ch
Thu Aug 10 12:36:16 UTC 2017


Hi,

Foreword: I just did the upgrade to the testing package (17.04.3) to get this 
"bug fix".

I'm really sorry, but I don't get it:

What you've sent me is the rendering parameter, as set in the render dialog. 
You changed is from vcodec=hevc to vcodec_nvenc to get hardware encoding 
working with your nvidia card.

What I want is just the same, but for vaapi because I've only the integrated 
intel graphics. I can use libx264_vaapi as like with the ffmpeg command, but 
there are more parameter required (vaapie_device, hwaccel, ...) - that's what 
Anton mentions in his bug report, and he asks for both proxy clips and 
"encoding profile" which I take as rendering profile. JBM's answer and the 
commit are only talking about proxy clips and transcoding, not about 
rendering, so this leaves me unsure.

From my understanding, I've the same problem as Anton: I need to inject the 
additional parameters needed for vaapi (but not for nvenc) for the rendering 
command, but so far I didn't find out how I have to do this. If I generate a 
render script, I get something like

PARAMETERS_0="-kuiserver -pid:8839 in=0 out=1139 $MELT uhd_2160p_25 avformat - 
$SOURCE_0 $TARGET_0 properties=x264-medium f=mp4 vcodec=libx264 acodec=aac 
g=120 crf=23 ab=160k preset=faster threads=1 real_time=-1"

Now, where do I have to insert these parameter (beside changing libx264 to 
libx264_vaapi)?

Unfortunately I don't have Anton's e-mail address, so I cannot ask him 
directly ;-)

Best,
Bernd


On Donnerstag, 10. August 2017 07:54:18 CEST Evert Vorster wrote:
> Hi there, Bernd
> 
> Have a look at this bug:
> https://bugs.kde.org/show_bug.cgi?id=378832
> 
> With the fixed bug there is also an example on how to make a vaapi profile
> from JBM
> 
> Kind regards,
> -Evert-
> 
> On 9 August 2017 at 20:55, B.M. <b-misc at gmx.ch> wrote:
> > Hi,
> > 
> > Coming back regarding my attempts to get encoding using vaapi-hardware
> > acceleration to work...
> > 
> > First, Vincent, concerning your point of ffmpeg not being compiled with
> > vaapi
> > enabled in Debian - well, that's correct and not correct somehow: it's not
> > compiled with enable-vaapi, but vaapi is still working (at least in
> > stretch),
> > see this Debian bug
> > report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=830880
> > 
> > For me, a command like
> > ffmpeg -vaapi_device /dev/dri/renderD128 -i infile.MP4 -vf
> > 'format=nv12,hwupload' -c:v h264_vaapi outfile.mp4
> > works fine and encoding 4K video runs about 4x faster!
> > 
> > What I struggle with is adding these options into the rendering profile or
> > to
> > begin with into the rendering script. I created the rendering script which
> > contains the line PARAMETERS_0. But how can I add these vaapi-related
> > options?
> > Which one goes where? Any hints are very welcome ;-)
> > 
> > Thanks a lot.
> > 
> > Best,
> > Bernd
> > 
> > On Dienstag, 8. August 2017 14:31:13 CEST Vincent Pinon wrote:
> > > Hello,
> > > 
> > > Note that you need to have FFmpeg built with vaapi or nvenc support,
> > 
> > which
> > 
> > > is not the case of Debian package. I don't know what's needed for Intel,
> > > but for NVidia you have to download a SDK linked to closed-source
> > > driver,
> > > providing personal information: showstopper for me (and many packagers)
> > :
> > :\
> > :
> > > Please let us know of any progress on your side.
> > > 
> > > Evert, did you try to share your custom profiles using "HotNewStuff"
> > > function in Kdenlive? ;)
> > > 
> > > Vincent
> > > 
> > > Le mardi 8 août 2017, 12:47:31 CEST Evert Vorster a écrit :
> > > 
> > > 
> > > Hi there, Bernd.
> > > 
> > > 
> > > 
> > > Kdenlive supports hardware encoding through custom encoding profiles.
> > > 
> > > 
> > > This is my profile for hardware hevc encoding with nvidia:
> > > 
> > > 
> > > properties=x265-medium f=matroska vcodec=hevc_nvenc acodec=aac
> > 
> > crf=%quality
> > 
> > > ab=%audiobitrate+'k'
> > > 
> > > 
> > > It would have been awesome if mlt and ffmpeg used the same format in
> > 
> > command
> > 
> > > lines, but this is not the case. At least they are close.
> > > 
> > > 
> > > Unfortunately I only have intel cards, so I cannot test the intel vaapi
> > > acelleration for you.
> > > 
> > > 
> > > Kind regards,
> > > 
> > > 
> > > On 8 August 2017 at 10:35, B.M. <b-misc at gmx.ch[1]> wrote:
> > > 
> > > 
> > > Dear all,
> > > 
> > > After some years without I'm getting back to video editing... I already
> > > searched quite a lot but it's really hard to find "realiable"
> > 
> > information,
> > 
> > > so I decided to ask here:
> > > 
> > > - It seems that hw accel is not available in kdenlive
> > > 
> > > - As far as I understand kdenlive uses mlt which uses ffmpeg. ffpmeg can
> > 
> > use
> > 
> > > hardware acceleration for de- and encoding. So is mlt to "blame" for
> > > missing hw accel. in kdenlive?
> > > 
> > > - There has been a patch (bug 378832) "use of vaapi in transcoding and
> > > rendering" which seems to tackle my question. But what did it really
> > 
> > change
> > 
> > > -/ what is it for? I didn't find more info on that and it's in kdenlive
> > > 17.04, while Debian is at 16.12. and before I compile myself I'd like to
> > > get more info.
> > > 
> > > - Furthermore I found a thread on this list back in April "kdenlive and
> > 
> > mlt
> > 
> > > nvenc enabled" covering the same topic but for nvidia instead of Intel
> > > graphics; unfortunately nobody reported back if it really works. For me
> > 
> > it
> > 
> > > reads like the patch I mentioned above.
> > > 
> > > So regarding the current state of hw accel in kdenlive I'm still
> > 
> > uncertain.
> > 
> > > Thank you for your inputs.
> > > 
> > > Kind regardsBernd
> > > 
> > > 
> > > Evert VorsterIsometrix Acquistion Superchief
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > --------
> > > [1] mailto:b-misc at gmx.ch




More information about the kdenlive mailing list