Can I use QSV HW Accel from Linux GUI or command line ?
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Can I use QSV HW Accel from Linux GUI or command line ?
Description of problem or question:
I want to test QSV Intel HW encoding HEVC and H264.
If not from.the gui, from the command line at least ...
I'm using Ubuntu with 4.19.13 kernel.
Already installed Intel Media SDk and vainfo reports correctly the video/card subsystem.
Thanks in advance
I want to test QSV Intel HW encoding HEVC and H264.
If not from.the gui, from the command line at least ...
I'm using Ubuntu with 4.19.13 kernel.
Already installed Intel Media SDk and vainfo reports correctly the video/card subsystem.
Thanks in advance
Re: Can I use QSV HW Accel from Linux GUI or command line ?
For instructions on building HandBrake for Linux with experimental QSV support, see https://handbrake.fr/docs/en/latest/dev ... linux.html
Re: Can I use QSV HW Accel from Linux GUI or command line ?
I have the same question. I have a dual boot computer with mint 19 and windows 10. On windows qsv works perfectly. On linux qsv is missing.
Why should I have to compile my own copy of handbrake???????
I really don't like loading up my fresh install of mint with all the crap needed to build just a copy of handbrake.
Why should I have to compile my own copy of handbrake???????
I really don't like loading up my fresh install of mint with all the crap needed to build just a copy of handbrake.
-
- Veteran User
- Posts: 4859
- Joined: Wed May 04, 2011 11:06 pm
Re: Can I use QSV HW Accel from Linux GUI or command line ?
Indeed, in fact why should you have to do anything.gene308 wrote: ↑Thu Feb 21, 2019 5:27 pm I have the same question. I have a dual boot computer with mint 19 and windows 10. On windows qsv works perfectly. On linux qsv is missing.
Why should I have to compile my own copy of handbrake???????
I really don't like loading up my fresh install of mint with all the crap needed to build just a copy of handbrake.
Perhaps someone from the HB team could come and do your laundry, maybe even empty your garbage if they’re not too lazy.
- JohnAStebbins
- HandBrake Team
- Posts: 5726
- Joined: Sat Feb 09, 2008 7:21 pm
Re: Can I use QSV HW Accel from Linux GUI or command line ?
QSV on linux is a [Censored] show. It requires specific drivers with specific versions of various libraries that are not available from most linux distribution repositories.
In addition, I can't run QSV on a single one of my machines. So as of now, HandBrake's QSV on linux is completely untested. Nobody, to my knowledge, has ever built and run it. If somebody knows otherwise, please correct me. So, it is *highly* experimental and unsupported.
If you scan for issues users are having with QSV on windows, you'll see that even there it is problematic. I expect QSV on linux will have all the same problems plus many more.
In addition, I can't run QSV on a single one of my machines. So as of now, HandBrake's QSV on linux is completely untested. Nobody, to my knowledge, has ever built and run it. If somebody knows otherwise, please correct me. So, it is *highly* experimental and unsupported.
If you scan for issues users are having with QSV on windows, you'll see that even there it is problematic. I expect QSV on linux will have all the same problems plus many more.
Re: Can I use QSV HW Accel from Linux GUI or command line ?
Thank you John for an honest answer. I have also discovered that ffmeg is also a mess when it comes to qsv support. The intel cpu family that has built in hardware decode and encode are now approaching three years since launch. Once again, linux the "superior" operating system is 3 years and 3 steps behind windows. I understand now that is not a handbrake issue, but a linux issue.
Looks like I will reworking my bash encoding scripts to windows batch files.
Thanks to all the handbrake people for creating a quality, easy to use program.
Looks like I will reworking my bash encoding scripts to windows batch files.
Thanks to all the handbrake people for creating a quality, easy to use program.
- JohnAStebbins
- HandBrake Team
- Posts: 5726
- Joined: Sat Feb 09, 2008 7:21 pm
Re: Can I use QSV HW Accel from Linux GUI or command line ?
This thread spurred me to have another look at it. I got it working (both CLI and GUI) and have posted a PR for review https://github.com/HandBrake/HandBrake/pull/1922. You still have to build and install Intel's MediaSDK separately and you have to have all the proper libva*.so libraries installed from your repository for it work. But I might try enabling this in the Ubuntu nightly builds just to see what breaks. Whether this ever makes it to a release build will depend on how many problems pop up.
-
- Posts: 5
- Joined: Thu Mar 07, 2019 5:36 pm
Re: Can I use QSV HW Accel from Linux GUI or command line ?
First question - does QSV negatively impact quality?
I am trying to make QSV work in Ubuntu 18.04, but it doesn't seem to be working. What I've done so far:
- I built Media SDK according to these instructions, chose no optional items, used libva 2.4.0: https://github.com/Intel-Media-SDK/Medi ... -on-Ubuntu - it was placed in /opt/intel/mediasdk/
- I built Handbrake according to this manual https://handbrake.fr/docs/en/latest/dev ... linux.html and appended --enable-qsv
QSV doesn't seem to be used when I encode - just to be sure, what is the proper -e parameter when I want to use it for HEVC?
I am trying to make QSV work in Ubuntu 18.04, but it doesn't seem to be working. What I've done so far:
- I built Media SDK according to these instructions, chose no optional items, used libva 2.4.0: https://github.com/Intel-Media-SDK/Medi ... -on-Ubuntu - it was placed in /opt/intel/mediasdk/
- I built Handbrake according to this manual https://handbrake.fr/docs/en/latest/dev ... linux.html and appended --enable-qsv
QSV doesn't seem to be used when I encode - just to be sure, what is the proper -e parameter when I want to use it for HEVC?
- JohnAStebbins
- HandBrake Team
- Posts: 5726
- Joined: Sat Feb 09, 2008 7:21 pm
Re: Can I use QSV HW Accel from Linux GUI or command line ?
QSV is lower quality in general than the equivalent software encoder, but it's much faster. If you've been using the 'ultrafast' preset in a software encoder, then QSV might result in better quality than you've been getting. But if you use pretty much any other preset in a software encoder, you will have to live with either lower quality or larger files with QSV.
Regarding building with QSV support on linux, are you using the branch of the code that my QSV PR comes from? That branch fixes a few things that are necessary for QSV on linux to work.
Next, Intel's default install directory for mediasdk won't be found by the linux dynamic library loader. When running HandBrake, you'll have to set LD_LIBRARY_PATH=/opt/intel/mediasdk/lib64. You can either permanently add this to your environment, or you can specify it on the command line before the HandBrake exe name. e.g. when testing, I run it like this:
Once my PR gets approved and committed, we should be able to make HandBrake with QSV support available in the nightly builds.
Regarding building with QSV support on linux, are you using the branch of the code that my QSV PR comes from? That branch fixes a few things that are necessary for QSV on linux to work.
Next, Intel's default install directory for mediasdk won't be found by the linux dynamic library loader. When running HandBrake, you'll have to set LD_LIBRARY_PATH=/opt/intel/mediasdk/lib64. You can either permanently add this to your environment, or you can specify it on the command line before the HandBrake exe name. e.g. when testing, I run it like this:
Code: Select all
LD_LIBRARY_PATH=/opt/intel/mediasdk/lib64 ghb
-
- Posts: 5
- Joined: Thu Mar 07, 2019 5:36 pm
Re: Can I use QSV HW Accel from Linux GUI or command line ?
Nah, using slow.JohnAStebbins wrote: ↑Thu Mar 07, 2019 6:43 pmIf you've been using the 'ultrafast' preset in a software encoder
How much larger are we talking?
No, can you tell me how to do that?JohnAStebbins wrote: ↑Thu Mar 07, 2019 6:43 pmRegarding building with QSV support on linux, are you using the branch of the code that my QSV PR comes from? That branch fixes a few things that are necessary for QSV on linux to work.
Right now, this starts Handbrake GUI, but there is nothing about QSV in video encoders.JohnAStebbins wrote: ↑Thu Mar 07, 2019 6:43 pmCode: Select all
LD_LIBRARY_PATH=/opt/intel/mediasdk/lib64 ghb
Re: Can I use QSV HW Accel from Linux GUI or command line ?
When I last tested QSV vs. x264, I used "similar" settings for both. By that I mean simply changing the encoder used, leaving other settings the same, even though there isn't an exact match between quality settings between the two encoders.
My results were a 5% increase in size for the QSV-encoded file, consistent across several sources. The encode speed was phenomenal, on the order or 8-10 times the frames rate of x264, because I was not using any "slow" filters (slow filters reduce QSV frame rates). The quality difference was not significant to me. But the increased file size was.
My results were a 5% increase in size for the QSV-encoded file, consistent across several sources. The encode speed was phenomenal, on the order or 8-10 times the frames rate of x264, because I was not using any "slow" filters (slow filters reduce QSV frame rates). The quality difference was not significant to me. But the increased file size was.
- JohnAStebbins
- HandBrake Team
- Posts: 5726
- Joined: Sat Feb 09, 2008 7:21 pm
Re: Can I use QSV HW Accel from Linux GUI or command line ?
amateur_ripper wrote: ↑Fri Mar 08, 2019 12:14 pmNo, can you tell me how to do that?JohnAStebbins wrote: ↑Thu Mar 07, 2019 6:43 pmRegarding building with QSV support on linux, are you using the branch of the code that my QSV PR comes from? That branch fixes a few things that are necessary for QSV on linux to work.
Code: Select all
git clone https://github.com/jstebbins/HandBrake.git HandBrake.jstebbins
cd HandBrake.jstebbins
git checkout origin/qsv -b qsv
mkdir build.qsv
cd build.qsv
../configure --enable-qsv
make -j8
- JohnAStebbins
- HandBrake Team
- Posts: 5726
- Joined: Sat Feb 09, 2008 7:21 pm
Re: Can I use QSV HW Accel from Linux GUI or command line ?
Oh, but that is no longer necessary since the PR got committed to the master branch yesterday Now you can do the same thing, but 'git clone' the official repo and no need to checkout a branch.
- JohnAStebbins
- HandBrake Team
- Posts: 5726
- Joined: Sat Feb 09, 2008 7:21 pm
Re: Can I use QSV HW Accel from Linux GUI or command line ?
We will hopefully be building our nightlies with qsv enabled soon. With the flatpak nightlies there will be a mediasdk plugin so that you don't have to build and install that yourself. My suggestion would be to install flatpak and use our nightly flatpak bundles when they become available.
- JohnAStebbins
- HandBrake Team
- Posts: 5726
- Joined: Sat Feb 09, 2008 7:21 pm
Re: Can I use QSV HW Accel from Linux GUI or command line ?
I just enabled qsv in the Ubuntu nightly builds and kicked off a build. Should be available on the PPA shortly, assuming I didn't fat-finger anything
Re: Can I use QSV HW Accel from Linux GUI or command line ?
Let us know when it hits the Ubuntu PPA, I will gladly test it on a couple 8th Gen i5's, one with an i630 one with an 655Plus.
- JohnAStebbins
- HandBrake Team
- Posts: 5726
- Joined: Sat Feb 09, 2008 7:21 pm
Re: Can I use QSV HW Accel from Linux GUI or command line ?
It hit the PPA about 20 minutes after I posted. So it's there now.
Re: Can I use QSV HW Accel from Linux GUI or command line ?
https://launchpad.net/~stebbins/+archiv ... e-releases is showing the last upload from 2/19, is the qsv in a differnet PPA?
Re: Can I use QSV HW Accel from Linux GUI or command line ?
I installed from that PPA and I am not seeing qsv at all in the codec list, is there some prereq that I need to fulfill for this to work?
- JohnAStebbins
- HandBrake Team
- Posts: 5726
- Joined: Sat Feb 09, 2008 7:21 pm
Re: Can I use QSV HW Accel from Linux GUI or command line ?
You still have to install Intel MediaSDK separately and make sure the shared libraries it creates are somewhere the system can find them.
Re: Can I use QSV HW Accel from Linux GUI or command line ?
MediaSDK is installed in /opt/intel/mediasdk/lib, and I have added that to my /etc/ld.so.conf.d/msdk.conf so it should be found., but when I apt install from the PPA I don't see what I expect.
- JohnAStebbins
- HandBrake Team
- Posts: 5726
- Joined: Sat Feb 09, 2008 7:21 pm
Re: Can I use QSV HW Accel from Linux GUI or command line ?
This is why I made the previous comment here viewtopic.php?f=13&t=38624&p=183248#p182870
There are many things can go wrong in setting this up. Start out by showing us an activity log of HandBrake starting up. There might be some clue in that.
This is also why I created a MediaSDK plugin for our flatpak builds. We can distribute a known working tested and complete qsv environment this way. The best way for most people to have QSV on linux will ultimately be to use our flatpak builds once they become available. I think scott is still working on some build server issues to get this fully functioning.
There are many things can go wrong in setting this up. Start out by showing us an activity log of HandBrake starting up. There might be some clue in that.
This is also why I created a MediaSDK plugin for our flatpak builds. We can distribute a known working tested and complete qsv environment this way. The best way for most people to have QSV on linux will ultimately be to use our flatpak builds once they become available. I think scott is still working on some build server issues to get this fully functioning.
Re: Can I use QSV HW Accel from Linux GUI or command line ?
if the flatpaks will be the best way, then I can wait for them
- JohnAStebbins
- HandBrake Team
- Posts: 5726
- Joined: Sat Feb 09, 2008 7:21 pm
Re: Can I use QSV HW Accel from Linux GUI or command line ?
One thing, did you run ldconfig after adding /etc/ld.so.conf.d/msdk.conf? /etc/ld.so.cache is what's actually looks at to load libs and ldconfig updates this file.