Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 4th July 2023, 10:43   #1  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,580
NVEnc as plugin?

I am reading the NVEnc parameters and it has so many level functions in hardware that it is at least awesome.

Unfortunately the only way to unlock its power now is to go to an intermediate lossless and then encode with software encoder.

What about using the available source to have a powerful plugin for AVS?

It would do 3D LUT tetrahedral transformations, high quality resizing and so on. It is similar to zlib but way faster.

That would be great.

Pinterf? DTL2020? Anyone?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 5th July 2023, 06:27   #2  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,070
Possibly the most interesting denoise on very advanced (?) AI-models from NVIDIA still do not show good details saving - https://github.com/NVIDIA/MAXINE-VFX-SDK . Also require at least Turing GPU or later. Possibly it is only for cheap webcams and simple web conferences where no best quality is required.
DTL is offline   Reply With Quote
Old 5th July 2023, 09:07   #3  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,580
Quote:
Originally Posted by DTL View Post
Possibly the most interesting denoise
Thanks for your experience.

Would be anyway possible to translate NVEnc as an AVS plugin?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 5th July 2023, 09:11   #4  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Originally Posted by DTL View Post
Possibly the most interesting denoise on very advanced (?) AI-models from NVIDIA still do not show good details saving - https://github.com/NVIDIA/MAXINE-VFX-SDK . Also require at least Turing GPU or later. Possibly it is only for cheap webcams and simple web conferences where no best quality is required.
While it shows loss of details it also gives a prominent color cast. But other features may be interesting and useful though.

Here a request about degrain/Mvtools:
https://github.com/rigaya/NVEnc/issues/243

Last edited by anton_foy; 5th July 2023 at 09:15.
anton_foy is offline   Reply With Quote
Old 5th July 2023, 11:26   #5  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,070
"Would be anyway possible to translate NVEnc as an AVS plugin?"

Yes - there are several ways possible. As 'filters' in NVenc application are implemented as separate processing units (though with only fixed order) it is possible 2 ways:
1. Make it as a single plugin with all filterchain fixed and single input and single output and passing a long string of arguments as it implemented in NVenc.
2. Assume NVenc project Vpp-features as a collection of several filters separated and extracted as separate filters to AVS (ported to CUDA).

Solution 1 may be faster to implement and may be faster in dispatching several filters enabled because I assume they keep all data in accelerator memory. Also if there were added new filters to NVenc (including mvtools on CUDA) they may be used in a more easy way in AVS.

The only thing I not like in all this project is strict dependence on a single hardware vendor (and maybe Windows only too and possibly not very old Windows. So maybe the small residual freeware open source developers for AVS will not be of great interest in making such work. You may try to ask Asd-g if he can put some time into this.

"Unfortunately the only way to unlock its power now is to go to an intermediate lossless and then encode with software encoder."

To use its output in x26x encoder you may try to ask NVenc or x26x developers to make compatible output to feed into x26x command line directly. I think there are many more active developers still exist for x26x projects.

Last edited by DTL; 5th July 2023 at 11:39.
DTL is offline   Reply With Quote
Old 5th July 2023, 11:47   #6  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
Asd-g won't make Cuda plugins

Last edited by kedautinh12; 5th July 2023 at 12:18.
kedautinh12 is offline   Reply With Quote
Old 5th July 2023, 11:52   #7  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,070
If NVIDIA will see some market benefit from having AVS plugin - may be we can get AVS plugin from professional NVIDIA developers. So some request may be sent to NVIDIA/CUDA development (e-mail or forums and so on).
DTL is offline   Reply With Quote
Old 5th July 2023, 12:14   #8  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Solution 1 may be faster to implement and may be faster in dispatching several filters enabled because I assume they keep all data in accelerator memory. Also if there were added new filters to NVenc (including mvtools on CUDA) they may be used in a more easy way in AVS.
This sounds great. Your version of mvtools can make use of this too?
anton_foy is offline   Reply With Quote
Old 5th July 2023, 18:03   #9  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,070
There were some attempts to put MAnalyse on CUDA - https://github.com/pinterf/AviSynthC...MC/MVKernel.cu . Other filters like MCompensate or MDegrainN are much more simple. But it looks old developers are lost and no other can take it and continue development. Again it is a subject to ask NVIDIA as current still alive manufacturer of CUDA hardware.

"Your version of mvtools can make use of this too?"

No.
DTL is offline   Reply With Quote
Old 5th July 2023, 20:50   #10  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,580
Quote:
Originally Posted by kedautinh12 View Post
Asd-g won't make Cuda plugins
The code is there in Rigaya repo, almost all that is needed. That said, my programming competence is just some Finite Elements Analysis in Fortran.

If not a CUDA plugin, perhaps a pipe or something like that, not to have to write to disk but the output can be used directly inside AVS.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 5th July 2023, 21:42   #11  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,070
If NVenc is expected to be an interface to hardware onboard encoder - I think it can not simply bypass the encoder after the Vpp stage and output uncompressed frame data to host memory from onboard memory. So the main part to implement for AVS plugin - downloading uncompressed frames after Vpp chain from accelerator board into host memory so it can be presented to the next AVS filter at the GetFrame() function. About input from AVS - it looks close to being implemented in the NVenc.
DTL is offline   Reply With Quote
Old 5th July 2023, 21:45   #12  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
Quote:
Originally Posted by tormento View Post
perhaps a pipe
Considering that, aside from .avs scripts, it can take y4m pipes, I think adding --y4m support in output wouldn't be such a big deal for Rigaya.
I think it's worth opening a feature request on Rigaya's Github.

This would lead to:

Avisynth (indexing and post-processing) .avs -> NVEnc (cuda accelerated filtering/LUT application) y4m pipe -> x265 (encoding) .h265 file

Quote:
Originally Posted by DTL View Post
If NVenc is expected to be an interface to hardware onboard encoder - I think it can not simply bypass the encoder after the Vpp stage and output uncompressed frame data to host memory from onboard memory.
Oh... I didn't know... bummer...

Quote:
Originally Posted by DTL View Post
About input from AVS - it looks close to being implemented in the NVenc.
It's already (finally) there, actually.
That's what Tormento and I have done yesterday and today: straight from Avisynth to NVEnc.

Last edited by FranceBB; 5th July 2023 at 21:48.
FranceBB is offline   Reply With Quote
Old 6th July 2023, 11:37   #13  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,070
Quote:
Originally Posted by anton_foy View Post
While it shows loss of details it also gives a prominent color cast. But other features may be interesting and useful though.

Here a request about degrain/Mvtools:
https://github.com/rigaya/NVEnc/issues/243
It was old state. So developers not like to port full mvtools to CUDA. At least MSuper (with sub sample calculation) + complex enough MAnalyse + simple enough MDegrainN.

Now NVIDIA provide hardware ME and it replaces MAnalyse. So developers of temporal degrain filter only need to implement much more simple MDegrainN. At least in the state of 2.7.45 version. Also the interpolated overlap is not hard to port to accelerator I hope - with some dependance between blocks processing shaders. So at the 2023 may be developers of NVenc will not be as afraid to port only small part of mvtools to make full hardware accelerated motion compensated temporal denoise filter on NVIDIA board. Also hardware ME not required MSuper with subsample calculated data and also some shader example available how to do required subsample shifting for MDegrainN. To keep full precision provided by hardware ME (up to qpel).

Last edited by DTL; 6th July 2023 at 11:40.
DTL is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:21.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.