jeanslack / Videomass

Videomass is a free, open source and cross-platform GUI for FFmpeg and yt-dlp
https://jeanslack.github.io/Videomass/
GNU General Public License v3.0
1.06k stars 49 forks source link

NVIDIA hardware acceleration #236

Closed robouden closed 1 year ago

robouden commented 1 year ago

Thanks for taking the time to ask a question!

Wondering how to make a preset with Videomass and NVIDIA RTX3070 hardware to speed up the encoding. Any suggestions welcomed.

Regards, rob Oudendijk

jeanslack commented 1 year ago

Hello @robouden

Have you looked at the NVidia Accelerated Video Coding presets? You may also find useful information on the FFmpeg wiki.

I hope these links are useful to you. I can't give you any more info because I don't use hardware acceleration.

johannesdedoper commented 1 year ago

Try something like this:

-vcodec hevc_nvenc -b:v 2000k -preset fast -c:a aac -b:a 128k -c:s copy (video-encoding to H265 using NVENC, bitrate video set on 2000kb and preset fast, audio encoding to aac at 128kb, copying all subtitles if any present.)

-vcodec hevc_nvenc -cq 23 -preset medium -c:a aac -c:s copy (video-encoding to H265 using NVENC, Constant quality setting on 23 and preset medium, audio encoding to aac best quality, copying all subtitles if any present.)

Go to presets -> click on "ADD" en copy-paste one of the above in the "One pass" window. Type in "mkv" for the file output format. Ready to go.

Cheers, J.

robouden commented 1 year ago

J,

Yess!!! That worked after I install the nvidia-uvm-init.sh script from https://matthieu.yiptong.ca/tag/plex/

Regards, Rob Oudendijk

On Sun, Jun 18, 2023 at 8:43 PM johannesdedoper @.***> wrote:

Try something like this:

-vcodec hevc_nvenc -b:v 2000k -preset fast -c:a aac -b:a 128k -c:s copy (video-encoding to H265 using NVENC, bitrate video set on 2000kb and preset fast, audio encoding to aac at 128kb, copying all subtitles if any present.)

-vcodec hevc_nvenc -cq 23 -preset medium -c:a aac -c:s copy (video-encoding to H265 using NVENC, Constant quality setting on 23 and preset medium, audio encoding to aac best quality, copying all subtitles if any present.)

Go to presets -> click on "ADD" en copy-paste one of the above in the "One pass" window. Type in "mkv" for the file output format. Ready to go.

Cheers, J.

— Reply to this email directly, view it on GitHub https://github.com/jeanslack/Videomass/issues/236#issuecomment-1596113766, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKSVNQIMBJKKGPPPHCK3A3XL3SUFANCNFSM6AAAAAAZJ6FDWU . You are receiving this because you were mentioned.Message ID: @.***>

johannesdedoper commented 1 year ago

Great! Nice to hear.

This video encoder is the best and has features no other encoder has. Also the tool has a great developer who is very involved and open to useful changes!

Have fun encoding. Groetjes ;) J.

robouden commented 1 year ago

J,

Would be nice if I could get the same acceleration for VP8 or VP9 and export to webm. You know if that’s possible?

Regards, Rob Oudendijk

On Mon, Jun 19, 2023 at 0:21 johannesdedoper @.***> wrote:

Great! Nice to hear.

This video encoder is the best and has features no other encoder has. Also the tool has a great developer who is very involved and open to useful changes!

Have fun encoding. Groetjes ;) J.

— Reply to this email directly, view it on GitHub https://github.com/jeanslack/Videomass/issues/236#issuecomment-1596182173, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKSVNT2AM3QVF6BRS5MHN3XL4MC3ANCNFSM6AAAAAAZJ6FDWU . You are receiving this because you were mentioned.Message ID: @.***>

jeanslack commented 1 year ago

Try something like this:

-vcodec hevc_nvenc -b:v 2000k -preset fast -c:a aac -b:a 128k -c:s copy (video-encoding to H265 using NVENC, bitrate video set on 2000kb and preset fast, audio encoding to aac at 128kb, copying all subtitles if any present.)

-vcodec hevc_nvenc -cq 23 -preset medium -c:a aac -c:s copy (video-encoding to H265 using NVENC, Constant quality setting on 23 and preset medium, audio encoding to aac best quality, copying all subtitles if any present.)

Go to presets -> click on "ADD" en copy-paste one of the above in the "One pass" window. Type in "mkv" for the file output format. Ready to go.

Cheers, J.

@johannesdedoper Could it be helpful if I add these presets to the ones you've already created? Or create new ones?

johannesdedoper commented 1 year ago

@jeanslack Sure, will send you my new list of presets in a few days.

@robouden Why use VP9? But if you want to you can use something like this: -vcodec libvpx-vp9 -b:v 2000k -preset fast -c:a libvorbis -b:a 128k -c:s copy Put as extension "webm" However this is not hardware accelerated (runs about 1:1 when encoding). I would not know how hardware accelerate vp9 within ffmpeg.

Cheers all. J.

robouden commented 1 year ago

J,

Thanks for the fast replies. I was just impressed with the speed of the hardware acceleration. But I really wanted a fast way to get a small in file size and reasonable quality webm formatted video file. What would be your suggestion?

Regards, rob

robouden commented 1 year ago

J,

Very interesting information, I will dig into it later. So much to learn.. BTW.. Great program you made.. :)

Regards, rob

On Sun, Jun 18, 2023 at 7:20 PM Gianluca Pernigotto < @.***> wrote:

Hello @robouden https://github.com/robouden

Have you looked at the NVidia Accelerated Video Coding https://github.com/jeanslack/Videomass-presets/tree/master/NVidia%20accelerated%20video%20encoding presets? You may also find useful information on the FFmpeg wiki https://trac.ffmpeg.org/wiki/HWAccelIntro.

I hope these links are useful to you. I can't give you any more info because I don't use hardware acceleration.

— Reply to this email directly, view it on GitHub https://github.com/jeanslack/Videomass/issues/236#issuecomment-1596086619, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKSVNRYZPXQFIFQZ5VH2PLXL3I2RANCNFSM6AAAAAAZJ6FDWU . You are receiving this because you were mentioned.Message ID: @.***>

johannesdedoper commented 1 year ago

I would always go for h265/x265 as it's hardware accelerated, good quality per MB and widely accepted. Therefore I convert all files to h265 in a mkv container as this accepts multiple (audio and video) streams en multiple subtitles.

BTW, this great little program is developed by Jeanslack, not me :) I'm just a great fan of him and his program! You can do much more with this great program, e.g. conversion of the audio only, normailzation of the audio only, or ripping the audio to a wav/mp3 file etc. without touching the video. You can also select streams (e.g. one of the 2 audio languages embedded in one video file) to convert.

I attached all my personal encoder settings to try. Just unpack and put it the Videomass preset folder. Cheers, J.

-h265videomass.prst.zip

jeanslack commented 1 year ago

Thanks a lot Johannes! I will update the Videomass-presets repo with your presets.

johannesdedoper commented 1 year ago

@jeanslack : You're are very welcome.

These are my own personal presets so there is a sort of overlap in presets but with minor tweaks. E.g. tweaked for copying one specific subtitle stream or different bit-rates, quality settings, with audio normalization or not etc.
So maybe too much?

cheers. J.

jeanslack commented 1 year ago

I'll take a look at it then I'll make a selection based on what I think will be useful for some users. In any case these presets will not be part of those normally distributed with Videomass, but will be available as additional optional presets for specific use cases. Anyway thanks again!

Ciao

robouden commented 1 year ago

I made a preset for converting MP4 files to MOV files (without getting a lot bigger) on a Linux system to be used in Davinci Resolve. Can I share that preset here?

Regards, Rob

jeanslack commented 1 year ago

@robouden

Sure!

If you think it could potentially be useful to someone, we could add it to the presets repo https://github.com/jeanslack/Videomass-presets.

In the future, if you want to share other presets, it would be better to send them directly to that repo.

Thank you!

johannesdedoper commented 1 year ago

@jeanslack I will. thnks.

Cheers, J.