-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add dependencies to allow for HandBrake QSV support #356
base: main
Are you sure you want to change the base?
Conversation
Thanks for the first commit There are no specific rules setup for the ARM dependencies I will check this on my machine to check it doesn't break containers with no QSV cards. Wont get to this till after Christmas Thanks for helping the community |
First of all, don’t forget that the GPU needs to be passed into the container using a device= directive either on the command line when starting the container or in the Docker Compose file. I’ve attached the Docker Compose I use for reference.
In the device block, the /dev/dri/render and the /dev/dri/card entries point to a specific card (the first GPU). The /dev/dri entry alone points to the folder containing references to ALL the GPUS and it seems that entry pick up both my cards – renderD128/card0 and renderD129/card1 respectively. This works for me and was gleaned from a lot of research and google searches. Yours may vary.
devices:
- /dev/sr0:/dev/sr0
- /dev/sr1:/dev/sr1
- /dev/sr2:/dev/sr2
- /dev/sr3:/dev/sr3
- /dev/dri:/dev/dri
- /dev/dri/renderD128:/dev/dri/renderD128
- /dev/dri/card0:/dev/dri/card0
Interesting situation. I hadn’t considered systems without QSV hardware.
My only thought would be that the container currently doesn’t have QSV support and runs fine on systems that both do and do not have QSV support.
It seems Handbrake coordinates all that using either the older Media-SDK or the newer OneVPL SDK. If it detects QSV hardware, it will check to see if QSV support packages are installed. If they are fine, it offers QSV enabled encoders as an option. If it does not detect QSV hardware OR if it detects hardware but it does not detect QSV support packages, QSV enabled encoders are not offered as an available option. This seems to be a coordination between Handbrake and the OneVPL support that handles all this.
Basically, if there is no QSV hardware, Handbrake should work fine, just offering no QSV enabled encoders.
But I hadn’t thought of that. So, your testing will be great. Thanks for those ideas.
In addition, if this QSV all tests fine, the block of code I added for QSV support would also likely work for AMD and NVidia accelerated support, placing appropriate blocks of code there. I do not have that hardware available to test.
I actually have 2 QSV enabled GPU’s in my system, the integrated GPU with the CPU and a discreet QSV enabled GPU card. Handbrake chooses the more capable GPU to use. No problems with that configuration.
Good luck with the testing.
This does work for me. I’m using QSV to re-process/re-encode a bunch of disks and I’m using QSV. I’m re-encoding at a much higher video quality and using QSV to cut the processing time down significantly. Basically, a standard Bluray movie can be pulled off the disk in about 40 minutes and encoded by Handbrake using H.265 at a 1080p SuperHQ setting and the encoding takes about 20 to 25 minutes for the entire disk, both movie and extras. About an hour for the whole thing. So, it’s working for me.
If there’s anything that will help, let me know. I can give you logs from a processing run for a BluRay and you can see how Handbrake sees both QSV enabled GPUs and seems to choose the more capable to use.
Anything you need, let me know.
If this passes muster, let me know if you’d like me to update the docs/wiki to show exactly what’s required – support on the host, commandline/compose settings, what to pick in handbrake, etc. Maybe I can pass on useful info.
Good luck and have a happy and safe holiday with friends and family.
Thanks.
From: Mtech ***@***.***>
Sent: Friday, December 20, 2024 5:39 PM
To: automatic-ripping-machine/arm-dependencies ***@***.***>
Cc: DZaremba14600 ***@***.***>; Author ***@***.***>
Subject: Re: [automatic-ripping-machine/arm-dependencies] add dependencies to allow for HandBrake QSV support (PR #356)
Thanks for the first commit
There are no specific rules setup for the ARM dependencies
I will check this on my machine to check it doesn't break containers with no QSV cards.
Wont get to this till after Christmas
Thanks for helping the community
—
Reply to this email directly, view it on GitHub <#356 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/A4MFQVKGTOJ3HIVVY7AVUVL2GSMCBAVCNFSM6AAAAABTT45AXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNJXHA2DINJSGY> .
You are receiving this because you authored the thread. <https://github.com/notifications/beacon/A4MFQVPM2ADJCE2DRQL2CXL2GSMCBA5CNFSM6AAAAABTT45AXCWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUYOWOC4.gif> Message ID: ***@***.*** ***@***.***> >
|
Pulled this PR and ran a quick test, the new image takes a little longer to build and is ~700MB larger, which is ok, noting users are ripping DVD and Bluray images 10x as large. Initial test on my non QSV machine, the rip appeared to take over a day for a DVD, which would typically take 4-5 hours (not the fastest machine). Need to re-run the test again because they were different discs. $ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
automaticrippingmachine/arm-dependencies 1.2.2 2ec395155423 2 days ago 3.3GB
automaticrippingmachine/arm-dependencies 1.2.1 5172bfb8ec35 2 days ago 2.63GB |
I just saw this. Let me shoot over a quick response – I need to get going. Let me review this when I get home.
Image size looks the same as what I had. 3.3 gig.
The only thing this should affect is encoding. Ripping is via MakeMKV and these GPU packages should not affect that. Odd.
I did not test on DVD’s. I have 2 I need to rip. Let me test.
I did not see any noticeable increase in ripping a BluRay disk.
Let me run some testing with a known disk, timing tests, and see what I get.
The Handbrake processing should be MUCH faster using QSV. Again let me benchmark and get you the hardware I’m using.
It could be the higher memory footprint affected ripping time.
Let me do some benchmarking and report back.
Let me see if I can see where QSV would affect ripping. That doesn’t make any sense. MakeMKV rips, Handbrake encodes, and QSV is related to encoding/Handbrake, not MakeMKV.
I’ll do some testing and report back. I’ll try a suite of testing on DVD, Bluray, using just stand alone MakeMKV and Handbrake and then the two of those in this Docker container, both with QSV and without.
Might take me some time.
Thanks for your time with this.
Thanks for this info.
I’ll report back as soon as I can.
From: Mtech ***@***.***>
Sent: Saturday, December 28, 2024 6:52 AM
To: automatic-ripping-machine/arm-dependencies ***@***.***>
Cc: DZaremba14600 ***@***.***>; Author ***@***.***>
Subject: Re: [automatic-ripping-machine/arm-dependencies] add dependencies to allow for HandBrake QSV support (PR #356)
Pulled this PR and ran a quick test, the new image takes a little longer to build and is ~600MB larger, which is ok, noting users are ripping DVD and Bluray images 10x as large.
Initial test on my non QSV machine, the rip appeared to take over a day for a DVD, which would typically take 4-5 hours (not the fastest machine). Need to re-run the test again because they were different discs.
However, if enabling QSV on a non-supported system increases the ripping time 2-3 times that is definitely not ideal.
$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
automaticrippingmachine/arm-dependencies 1.2.2 2ec395155423 2 days ago 3.3GB
automaticrippingmachine/arm-dependencies 1.2.1 5172bfb8ec35 2 days ago 2.63GB
—
Reply to this email directly, view it on GitHub <#356 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/A4MFQVOH4SNVU5MSQG5IZJD2H2GHRAVCNFSM6AAAAABTT45AXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRUGMYDKNZZGM> .
You are receiving this because you authored the thread. <https://github.com/notifications/beacon/A4MFQVON25HXAGKKJDILQMT2H2GHRA5CNFSM6AAAAABTT45AXCWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUY3AZYC.gif> Message ID: ***@***.*** ***@***.***> >
|
Any update on this? I recently got an Arc GPU and would love to be able to use it to encode everything in AV1. |
Sorry for the delay on this. Holidays and then work. I'll be responding to this in the next day or so. I'm going to pull the lastest ARM, build the Docker image. Add in my updates, build a 2nd Docker image, and then run a test run between the two - I'll do a DVD, a Bluray, and a UHD disk both with and without QSV. I'll log the results and submit that. I realize the Docker image will be larger, it was to be, its installing all the packages to support Handbrake using QSV. The time to rip the disk should not change, that's MakeMKV and I'm not touching that, and I'm not changing anything in the actual Handbrake build either. I'm installing a set of packages to allow Handbrake to use QSV, that's it.. I see that processing a DVD took longer. I actually have a DVD I need to rip. SO I'll be doing a run as described. All of this will be done on the same system, no hardware will change. All I can say is that I can rip and process a Bluray with a with Handbrake setting of Ultra High Quality, CRF set to 18, and I can do the job, from inserting the disk to completion in about an hour. Its using a Sparkle Intel ARC A310 to transcode and it flies. I've done a few AV1 and they fly too. Let me run this and I'll report back hopefully tomorrow or Wednesday. Again, sorry for my recent absence. |
No issues, we all have lives and this is open source so people are contributing for free. Thanks for understanding and running the tests |
Well, an update and a question. I wanted to run a test suite for this QSV enhancement. I was particularly curious as to what may have been causing an issue with processing DVD's. It was reported that the proposed enhancements actually made DVD processing slower. Very odd. The test suite I set up was this: One container using the latest ARM Docker code. I would clone the repository and build the Docker image unchanged. Using the stock Docker container, I would process a Bluray disk, an UHD4K disk, and a DVD movie disk using a non-QSV preset. Use the logs for timing baseline and other info. Using the QSV-enabled Docker container, I would process a Bluray disk, a UHD4K disk, and a standard DVD movie disk in two sets, one using the same non-QSV preset as the stock container, and then the same preset, but using a corresponding QSV encoder, with all else being identical. Basically stock non-QSV enabled container with non-QSV preset, QSV-enabled container with non-QSV preset, and QSV-enable container with QSV-enabled preset. I figure that should give a good comparison between a stock baseline and a QSV-enabled baseline. I was going to present a matrix of the relative information for these 6 combinations. Everything seems to work fine EXCEPT when I try to process a DVD using QSV enabled h.265 HEVC encoder. The job rips the DVD but bombs almost instantly when the Handbrake processing begins. It even bombs Handbrake when I try to process the DVD MKV manually using standalone Handbrake installed on the host. It seems to process fine except when I select QSV h.265 HEVC. Any thoughts? There is an error thrown in the logs, I'll try to post it tonight. I've read that h.265 HEVC is not really good with DVD material. I've read its better suited for HD material. I tried QSV h.264 codec and that seemed to start running ok. I did not let it complete. When I say bombs, its almost instantly terminates. Any DVD experiences that might be helpful? With HD Blurays, HD and 4K TV's I wasn't personally planning on processing a lot of DVD material, but I know others will. The Bluray and HDR4K disks process fine in all instances and the QSV processing is fast. Any thoughts or suggestions? I'll try to post the errors in the logs for the DVD processing that failed. I'd like to give this a final push Sunday and Monday if I hear back, Any input would be appreciated. Just let me know. Thanks in advance and thanks for your patience. |
Thanks for running those tests. I am no Handbrake expert, maybe @1337-server or @shitwolfymakes could help? |
Update - The pull request I submitted originally for this QSV support utilized the latest Handbrake at that time, which was 1.9.0. That's when I began testing DVD's, up to that point I was only testing with Bluray and 4K disks, and was seeing no issues. Testing against DVD's was where I was seeing issues. That didn't make a lot of sense. Even manually running Handbrake using a QSV-enabled preset against an MKV ripped straight from a DVD was terminating almost instantly. The logs indicated it was when an audio stream was being processed. I suspected it might be something with HandBrake or even with ffmpeg. Low and behold I was the other day a newer Handbrake was released, version 1.9.2 and it specifically mentions improvements with ffmpeg processing (although only E-AC3 streams were specifically mentioned in the info I saw. Anyway, last night I rebuilt the newer version HandBrake from source on my host (as a baseline), I sync'd my fork of ARM and the ARM-dependencies, I sync's my local copy of the forks on my system, I deleted the ARM and ARM-dependencies images in Docker and rebuilt my docker images so I'd have the latest HandBrake used as part of the build. I currently have an ARM Docker image that is 'stock' and using the lastest HandBrake. This will act as a control and a baseline. This should give me a good matrix of results as for performance and reliablity. I'll be running DVD, Bluray, and 4K disk jobs. Tonight I'll start by running Handbrake on an MKV ripping from a DVD on the host to make sure that generic presets don't terminate like they were. If those succeed, I'll assume there was some issue with the upgrade from 1.8.x to 1.9.0 and then proceed to run tests using ARM in these containers. I'll report the results and the test bed. I wanted to update this thread since I've been tinkering with this without report on the thread. I'll let everyone know how it went. Thanks. |
Oh boy, spoke too soon - I just noticed Intel updated their website with regards to packages to install for Ubuntu 22.04 for GPU support and corresponding compute-related and media-related packages. Of note is that the number of packages has been significantly decreased. Perhaps there has been some streamlining and consolidation. Hopefully that also means smaller images. I'll make appropriate changes, rebuild the images and verify that the encoder support is there. If that's the case, I'll go ahead with the testing. Fingers crossed. |
This is my first git/github submission ever.
I apologize if I miss any protocols, my intent is not to irritate.
I tried to comment appropriately, if its too much/not enough just let me know.
If the project maintainers would prefer other protocols or policies be followed, just let me know.
An earlier version of these changes was used by me to process close to 60 BluRay movies and they processed very quickly (less than 2 hours per disk average over parts of 4 days (on 2 machines) and without error. I tweaked the code, cleaned up the comments, and ran several Docker Image builds to make sure there weren't any errors in the builds. I had to get up on how git worked. So here's my submission.
Added support for Handbrake to support use of QSV.
The only file changed is scripts/install_mkv_hb_deps.sh
Added code to add repository for Intel graphics GPU support. This will allow latest packages to be pulled.
Added an update/upgrade step to get latest packages index list and upgrade all existing packages.
Added step to install packages for OneVPL Compute Runtime, Media, and Mesa packages, misc utils, for QSV use in HandBrake.
Added step to install specific QSV packages as called for by HandBrake's website.
Added step to install new HandBrake version 1.9 dependencies. These seem identical to the previously included HandBrake dependencies installed at line 21. Identical packages will be upgrade/skipped; any different packages will be installed (this being the case, line 21 could actually be removed/merged with line 78. I decided to code this way to ensure everything is shown to be working through widespread use, and in the next update these redundant lines could be merged or line 21 removed/replaced.
Added step to include GTK library packages (used in HandBrake GUI). Even though this is CLI only, there is functionality in place to allow easy use of custom PRESETS on the handbrake args line using .json files exported from the GUI version. During testing there seemed to be issues unless these were included. They can be removed if further use show them to be unnecessary.
Testing shows this builds and the Docker Container comes up and runs. Obviously I didn't test every function of ARM, but I did run ARM and processed the BluRay of 'Unforgiven', using latest Handbrake 1.9, a custom preset that utilizes QSV, and the job completed without errors.
Thank you.