-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
[Feature Request] Hardware encoders (hevc_qsv, nvenc_hevc, hevc_amf, vaapi) #109
Comments
Editing my top comment for newer overview: FastFlix now supports AMD and Nvidia hardware encoding through both ffmpeg and Rigaya's encoders (which support HDR10) Supported: Not supported, but possible / accepting PRs: Original responseThat is not currently high priority for me to add any of the hardware accelerated options as they:
|
Just another addition to this: Hardware encoding is great for real-time streams. However it is ill-advisable to use it for files, like FastFlix is designed for, due to their much lower quality vs bitrate. Not saying it's a total waste, as some people have situations where their GPU is really only thing powerful enough to bother encoding with, just not the normal or recommended path. |
yes you're probably right |
...what about hwaccel auto ? Check out similar discussion @ Axiom: MattMcManis/Axiom#42 |
I have been getting more inquiries into this lately, and after looking at figures with the more recent nvidia options https://unrealaussies.com/tech/nvenc-x264-quicksync-qsv-vp9-av1/6/#Final-thoughts-on-Maxwell-and-Pascal-H264-AVC it seems they are not so bad if using the newest generation. I will probably start off with adding the nvenc_hevc encoder first after the 4.0 release. |
First thing that is being added currently is HEVC NVENC included in FFMpeg builds. However I am looking to add https://github.com/rigaya/NVEnc/tree/5.25 as part of the standard include, as it provides support for HDR10 and HDR10+! |
* Fixing that returning item back from queue of a different encoder type would crash Fastflix
Yes, I've been using Rigaya's nvenc for many months in a batch file so a gui is very welcome. I won't use staxrip, it's just too big just to create a command line. |
* Adding #109 NVENC HEVC support based on FFmpeg * Adding NVEenC encoder for HEVC and AVC * Adding #166 More robust queue that is recoverable * Adding ability to extract HDR10+ metadata if hdr10plus_parser is detected on path * Adding #178 selector for number of autocrop positions throughout video (thanks to bmcassagne) * Adding Windows 10 notification for queue complete success * Adding #194 fast two pass encoding (thanks to Ugurtan) * Fixing German translations (thanks to SMESH) * Fixing #171 Be able to select encoder before selecting video * Fixing #176 Unable to change queue order or delete task from queue since 4.1.0 (thanks to Etz) * Fixing #185 need to specify channel layout when downmixing (thanks to Ugurtan) * Fixing #187 cleaning up partial download of FFmpeg (thanks to Todd Wilkinson) * Fixing #190 add missing chromaloc parameter for x265 (thanks to Etz) * Fixing that returning item back from queue of a different encoder type would crash Fastflix * Fixing HDR10 details to be track specific (thanks to Harybo)
I manage to use Fastflix to create the command line and to use it in ffmpeg with hevc_qsv using 90 % of my GPU on an INTEL(R) CORE(TM) I3-8109U CPU @ 3.00GHZ |
1st of all: encoding with hevc_qsv is at least twice as fast on my i7-7700 CPU, so it would be really great if FF will exploit it...
I'm testing too, but for 2-pass (need specific target size) AVC to HEVC 10bit... So how to modify this FF-generated commandline (1st pass): in order to correctly integrate these (and maybe other) parameters ? I also found some interesting resources that may help:
Thanks in advance to anyone that can/would help ! |
@forart I don't have a intel chip to test with, but should just need to replace the existing options there and remove all the
|
Thanks a lot @cdgriffith, but hevc_qsv works with "p010le" (instead of "yuv420p10le") as pix_fmt... ...anyway, if you check those links above, many puts "load_plugin hevc_hw" parameter also in the command line, but I haven't understand exactly what it does. Last but not least, it would be great to use qsv filters too:
|
Just found this interesting insight @ StackExchange: Notes on encoding with the QSV encoders:
See how the hardware device for use with MFX sessions has been initialized ( Recommended for further reading: The Advanced Video options section on FFmpeg wiki. The example above demonstrates the use of the Another example, showing the use of the
Take note that both examples above will use the constant bitrate control (CBR) method in MFX, as shown in the console log: Rate control, similar to how the VAAPI implementation governs it, is driven by the parameters Observe how we call up the
The error message may seem ambiguous at first, but it stems primarily from mapping invalid options to the underlying MFX library, such as an unsupported pixel format. The extra argument Hope that helps/inspires ! |
* Adding #109 NVENC HEVC support based on FFmpeg (thanks to Zeid164) * Adding NVEenC encoder for HEVC and AVC * Adding #166 More robust queue that is recoverable * Adding ability to extract HDR10+ metadata if hdr10plus_parser is detected on path * Adding #178 selector for number of autocrop positions throughout video (thanks to bmcassagne) * Adding Windows 10 notification for queue complete success * Adding #194 fast two pass encoding (thanks to Ugurtan) * Adding Confirm dialogue for cancel encode and replace currently working on video * Changing AVC defaults and recommendations for CRF to higher values * Changing VP9 to default to mkv instead of webm format to support more audio codecs * Fixing German translations (thanks to SMESH) * Fixing #171 Be able to select encoder before selecting video * Fixing #176 Unable to change queue order or delete task from queue since 4.1.0 (thanks to Etz) * Fixing #185 need to specify channel layout when downmixing (thanks to Ugurtan) * Fixing #187 cleaning up partial download of FFmpeg (thanks to Todd Wilkinson) * Fixing #190 add missing chromaloc parameter for x265 (thanks to Etz) * Fixing #209 Double spaces were removed in incoming filenames, causing no file found (thanks to stilicrafter) * Fixing that deinterlace detection could crash program due to CPython bug issue #43423 (thanks to macx) * Fixing that returning item back from queue of a different encoder type would crash Fastflix * Fixing HDR10 details to be track specific (thanks to Harybo) * Fixing returning from queue works with duplicated audio tracks Co-authored-by: SMESH <4199206+smesh109@users.noreply.github.com> Co-authored-by: TGMais <2453844+tgmais@users.noreply.github.com>
First wave of hardware encoding done for NVENC with AVC and HEVC if you have https://github.com/rigaya/NVEnc/releases Added in 4.2.0 https://github.com/cdgriffith/FastFlix/releases/tag/4.2.0 |
With this announcement, I will probably just wait a few months and see if this takes off fast for both AMD and Intel that could simplify the whole ecosystem: https://www.phoronix.com/scan.php?page=news_item&px=Vulkan-Video-Provisional-Spec |
This appears to be a high demand for this type of encoding and im pretty shock that its not already a standard. |
OK, by metioning FF I just asked in the Intel community if is possible to take advantage of QuickSynch for the 1st of 2 passes. Let's see if something comes out. |
Any update on VAAPI support? |
@sourpatched I have opened a separate issue #109 for vaapi as it's a lot more re-work than other encoders. The filters will have be done specifically for that encoder which will be...fun. However it's a great multipurpose option for linux so I think it's worth it long term. I will be adding support for QSV encoding with rigaya's encoder and Apples Videotoolbox in the next 4.9.0 release and close this ticket then. I am not planning in near term to add ffmpeg's |
Nice, thanks for the valuable work you are donating your time on. It will be interesting to side-to-side benchmarking FF <> HB in QSV (multipass ?) encoding approach... ...but does @rigaya 's QSVEnc relays on Intel oneAPI/VPL too ? |
The backend of QSVEnc has moved from MediaSDK to oneVPL from QSVEnc 6.00. QSVEnc utilize DirectX(d3d11) on Windows and VAAPI on Linux for QSV encode (and decode) via oneVPL interface. |
Cool, so this means that - in terms of encoding performances - should be equal to the HandBrake implementation ? Another question: is multipass achiveable with QSVE ? Thanks for your work and time you're spending.
@cdgriffith: seems that QSVE does support quicksynch deinterlacing/filtering/etc too... ...it would be great if FF could exploit them ! |
Should be equivalent as the base is the same (= oneVPL), but it might differ, by the difference in the actual implementation, and the handling of encoding parameters might also differ between HandBrake and QSVEnc.
If you mean multipass like the one x264 or x265 does, I think QSV (via oneVPL) encoding does not have that feature. |
Yeah, (unfortunally) we know, but - if the video codec respects its own (HEVC, but AVC too) standard - it should be possible to generate compliant 1st pass .log file "analisis" to be used for x265 (or x264) second pass. As previously reported, we 3aded a [FFMPEG] Hybrid HEVC encoding (QuickSynch 1st pass) @ Intel Communities Product Support Forums Visual Computing Media (Intel® oneAPI Video Processing Library, Intel Media SDK) and "they" claims We are working on this internally and we will get back to you soon with an update in Jan '22... Dunno if is technically realizable, but hw-accellerated 1st pass can improve 2-pass encodings at least for 40% and even more - depending on usable hw computing power too, of course - for the 1st pass. Thanks again for your constructive efforts. |
* Adding #109 Support for AVC and HEVC QSV encoding with rigaya's QSVEncC (thanks to msaintauret) * Adding #196 Support for AVC and HEVC Apple Videotoolbox encoder (thanks to Kay Singh) * Adding #323 ignore errors options options for queue (thanks to Don Gafford) * Adding #331 NVEncC API v10 Quality presets: P1 to P7 (thanks to Wontell) * Fixing #321 dhdr10_opt not added for x265 commands (thanks to GizmoDudex) * Fixing #327 FastFlix Duplicates encoding task and encodes same movie to infinity (thanks to Wontell) * Fixing #324 NVEncC wrong Interlace Value set by FastFlix (thanks to Wontell) * Fixing #278 FastFlix occasionally getting stuck on a single video in a queue (thanks to kamild1996) * Fixing #330 "Remove Metadata" only removes video metadata for Rigaya's hardware encoders (thanks to wynterca) * Fixing level was not being passed to hardware encoders
Finally added QSV and Mac's hardware encoding in https://github.com/cdgriffith/FastFlix/releases/tag/4.9.0 Closing this issue just as the major effort is over (with #109 tracking VAAPI). Please feel free to keep commenting here or anything thoughts on Hardware encoding things. Also please feel free to open separate issues for any individual features wanted! It's a lot easier to track a lot of single feature requests than a lot in a single issue 😄 |
@cdgriffith ...trying 4k encode but: where to select QSV encoder ? (portable version) |
@forart Need to download https://github.com/rigaya/QSVEnc/releases/tag/7.01 , extract it, and link the executable in the Setting page. I need to also update Readme for adding this, as well as better instructions for that, thanks for reminder. |
@cdgriffith ...why not FFMPEG-like automatic download ? |
No technical reason, just would have to detect if you have that capability somehow to bother downloading it, or just having it hidden away in Help or something to click manually. Basically very low on the list of improvements, but would love to add simplicity and clarity wherever possible! |
OK, found another problem: cannot set custom bitrate in GUI-QSVenc settings. |
@forart seems to work for me on HEVC, I see there is an issue with the build command for AVC that I need to fix Edit: In the drop down make sure to select "Custom" for bitrate |
OK, 1st FF-commandline-generated 4K - SDR - QSVenc (both audio and video) @6000kbs/1pass-VBR done. Found custom setting, sorry (but what about to put in on top of list ?). @rigaya |
Here are the two encodings (note that, in the end, both performed at the same speed): Handbrake:
FastFlix:
Quality: to my eyes FF encode have a bit more fidelity, due to better grain preservation (and it's - lightly - smaller !). Let me know if I have to post side-by-side framerips for a visual compatison. |
will it be added ?
The text was updated successfully, but these errors were encountered: