This project has moved and is read-only. For the latest updates, please go here.

How to turn on NVENC

Sep 26, 2015 at 2:45 AM
Hi
I have GTX 980TI and it supports this feature, Is there a way to turn this on?
Sep 30, 2015 at 1:08 AM
To hstorey219,

In order to enable nvenc you must have the latest drivers and have a ffmpeg build that supports nvenc. I recommend cross-compiling in ubuntu using the script here: https://github.com/rdp/ffmpeg-windows-build-helpers. just say y to everything. A while ago I uploaded some test builds to the mcebuddy server. I don't know if they are still there. Once you have your build of ffmpeg you have to replace the files in your "mcebuddy install directory"/ffmpeg folder. Next edit your profiles.conf for the profile you are using. Make sure ffmpeg is first in order and change. -vcodec libx264 to -vcodec nvenc on the line that starts with ffmpeg-video. Run your profile as normal from the mcebuddy gui. I recommend using a free program called gpu-z to make sure this worked for you. Please let me know how this all worked out for you.

from,
andrew
Nov 22, 2015 at 7:22 PM
Marked as answer by rboy1 on 11/22/2015 at 11:22 AM
Nov 22, 2015 at 7:33 PM
@techpro2004 let us know how your nvenc is going, specifically if you can use our build and let us know how it goes (we don't have nvenc machine to test :(
If the build's good we can include in the next release.

Also, we're struggling to find how to detect if the machine has NVENC driver on it. Suggestions are welcome
Nov 22, 2015 at 8:28 PM
Hi Andrew,

Just checking if this will work with X265 too? Since I have 980ti, I will test and let you know about x264

Harry, I also have the Skylake cpu if you need testing with anything too
Nov 22, 2015 at 9:59 PM
congratulations this build works. based on the version number my guess would be ether this is a older build or you download your source from a different place than me. in the past, I have had bad luck running older builds on recent drivers but this one seems ok for now at least as for detecting if a machine has nvenc. all kepler and maxwell gpus have nvenc. I dont know if there is a way to test for that but kepler goes back to 2012 so I would imagine that not too many pre kepler nvidia gpus are still in use

harry: This build should work with h265 also just use -vcodec nvenc_hevc instead of -vcodec nvenc.

also I noticed you enabled quicksync support in this build. anyone who wants to use ffmpeg with quicksync instad of handbrake should replace -vcodec nvenc with -vcodec h264_qsv for h264 or -vcodec hevc_qsv for h265
Nov 22, 2015 at 10:02 PM
@techpro2004 can you test all the various combinations and let us know which codecs works and which don't?
As for drivers, we need to detect if there is Nvidia or not and then nvenc (we can detect quicksync with the help of handbrake)

Nov 22, 2015 at 10:26 PM
just another hackish idea. ffmpeg is opensource. ffmpeg checks if nvenc is available before using it. I found the file that appears to be responsible for it (https://www.ffmpeg.org/doxygen/2.7/nvenc_8c_source.html) maybe that page can give you some ideas. I will get right on checking the different codecs
Nov 22, 2015 at 11:34 PM
They all work except for hevc_qsv. Although it may be my cpu. I am running a haswell refresh and I don't know for sure if quicksync h265 is supported or not
Nov 23, 2015 at 1:21 PM
Edited Nov 23, 2015 at 1:26 PM
rboy: if you are looking for a good cheap card to test nvenc on i would reccomend this one (url removed please see below) It is not that fast but it should give you an idea if nvenc is working or not. also Zotac is a good brand and this card is as cheap as some gtx 950s out there
Nov 23, 2015 at 1:24 PM
Nov 24, 2015 at 1:16 PM
Good insight, I checked it out and it appears to be calling NVidia libraries to figure it out.
Something we can't do in .NET (that I'm aware of)

Dec 2, 2015 at 8:31 PM
Folks we've put a new 2.4.3. BETA build that now automatically enables NVIDIA NVENC if the supported hardware is available for h.264 and h.265 profiles.

Can you try it out and let us know how it goes. 3 specific profiles we're looking for feedback:
  1. MP4 High Quality (2 pass)
  2. MP4 Normal (1 pass)
  3. MP4 HEVC
You will need to make ONLY one edit to the stock profiles.conf, change the order to:
order=ffmpeg

so that it uses the ffmpeg encoder (and not any other).
Dec 4, 2015 at 12:19 AM

Hi Andrew,

I will test this weekend and send you the results

Dec 4, 2015 at 12:09 PM
I have been using the MP4 NVENC profile for the last few days, and it has been rock solid. Will be playing with the quality slider, as at +25% I am getting quite a bit of artifacts from my FHD sources. It is much, much more reliable than QS though, which is a relief.
I am using a 750Ti, and getting ~40 fps for 1080p h.264 converts, which isn't bad at all.
Dec 4, 2015 at 3:51 PM
We've put a new build of ffmpeg with Nvenc in the shared folder. Try it out and let us know your feedback

Dec 5, 2015 at 7:39 AM
Okay now MCEBuddy automatically detects and enables NVENC with ffmpeg encoder.
It also now supports HEVC (H.265) for NVENC and QuickSync
It also now support 2 pass encoding for QuickSync

No need for any more custom profiles (well almost, soon we'll add an option to automatically switch encoders between handbrake and ffmpeg depending upon hardware encoder support)

Enjoy!!
Marked as answer by rboy1 on 12/5/2015 at 12:10 AM
Dec 6, 2015 at 2:57 PM
Hi There,

I tested all three, and QuickSync and NVENC works well for normal MP4, but the quality for H.265 was not up to par with normal preset.
Dec 6, 2015 at 3:06 PM
Okay thanks will tweak the settings / profile

Dec 7, 2015 at 3:29 AM
Thanks @hstorey219, can you try it again and in the profile change the crf (for ffmpeg) and q (for handbrake) values to 18 for the H.265 profiles. That will be the new default of the profiles.
Dec 8, 2015 at 12:37 AM
Hi There,

I tried the values changes to 18 and can't tell the different from normal mp4 and hevc mp4 :).. The file size normal was1,081,056 KB to down to 456,941 KB.
Dec 8, 2015 at 1:49 AM
Fantastic. So that's the new default for hevc.

Dec 11, 2015 at 3:35 PM
Can you try the stock profiles say MP4 Normal and see if that automatically enables NVENC and uses ffmpeg for encode it.
Please use the latest 2.4.3 BETA to test it.
Dec 11, 2015 at 4:04 PM
Hi There,

I tried, and I did not see NVENC working on it.
Dec 11, 2015 at 4:07 PM
Can you upload your conversion log please (hope you're using the latest 2.4.3 beta build)

Dec 11, 2015 at 4:27 PM
Sorry, but is that the MCEBUDDY or actual video name log that you need? Also I noticed some of my personal information is in the logs, would it be ok to delete before sending?
Dec 11, 2015 at 4:43 PM
the video conversion log please.

Dec 11, 2015 at 4:50 PM
ok, I uploaded it to the Upload folder, look for the title that begins with The Girl King 2015. I just picked one from a NewGroup to run through the conversion process
Dec 11, 2015 at 6:44 PM
Great thanks found the bug and fixed it, can try the new build and see if it fixes your issue. USe the stock profile again to try it.

Dec 11, 2015 at 8:29 PM
Hey,

I tested it, and it is now working :) Picked up NCENC for Normal MP4 profile! :)
Dec 11, 2015 at 8:34 PM
great thanks for the feedback!

Dec 16, 2015 at 1:21 AM
Edited Dec 17, 2015 at 11:33 AM
my pc i7 4790k and evga 980ti classified + 16GB ram [edit typo cpu number]
the MP4 profiles are working for me using the nvenc (videocard)

but the [HENC MP4] profile uses the cpu . isn't it supposted to use the videocard too?

[MP4 high quality] 340 fps - is that frame rate people a quote as the encoding rate
2015-12-13T15:07:48 MCEBuddy.AppWrapper.FFmpeg -->   Metadata:
2015-12-13T15:07:48 MCEBuddy.AppWrapper.FFmpeg -->     encoder         : Lavf57.19.100
2015-12-13T15:07:48 MCEBuddy.AppWrapper.FFmpeg -->     Stream #0:0: Video: h264 (nvenc_h264) ([33][0][0][0] / 0x0021), yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=-1--1, pass 1, 1800 kb/s, 25 fps, 12800 tbn, 25 tbc
2015-12-13T15:07:48 MCEBuddy.AppWrapper.FFmpeg -->     Metadata:
2015-12-13T15:07:48 MCEBuddy.AppWrapper.FFmpeg -->       encoder         : Lavc57.16.101 nvenc_h264
2015-12-13T15:07:48 MCEBuddy.AppWrapper.FFmpeg -->     Stream #0:1(eng): Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 384 kb/s
2015-12-13T15:07:48 MCEBuddy.AppWrapper.FFmpeg -->     Metadata:
2015-12-13T15:07:48 MCEBuddy.AppWrapper.FFmpeg -->       encoder         : Lavc57.16.101 libfdk_aac
2015-12-13T15:07:48 MCEBuddy.AppWrapper.FFmpeg --> Stream mapping:
2015-12-13T15:07:48 MCEBuddy.AppWrapper.FFmpeg -->   Stream #0:1 -> #0:0 (mpeg2video (native) -> h264 (nvenc_h264))
2015-12-13T15:07:48 MCEBuddy.AppWrapper.FFmpeg -->   Stream #0:0 -> #0:1 (mp2 (native) -> aac (libfdk_aac))
2015-12-13T15:07:48 MCEBuddy.AppWrapper.FFmpeg --> Press [q] to stop, [?] for help
2015-12-13T15:07:48 MCEBuddy.AppWrapper.FFmpeg --> frame=  132 fps=0.0 q=-0.0 size=     958kB time=00:00:05.26 bitrate=1488.9kbits/s    
2015-12-13T15:07:49 MCEBuddy.AppWrapper.FFmpeg --> frame=  307 fps=307 q=-0.0 size=    2810kB time=00:00:12.24 bitrate=1880.0kbits/s    
2015-12-13T15:07:49 MCEBuddy.AppWrapper.FFmpeg --> frame=  483 fps=322 q=-0.0 size=    4653kB time=00:00:19.28 bitrate=1976.3kbits/s    
2015-12-13T15:07:50 MCEBuddy.AppWrapper.FFmpeg --> frame=  661 fps=330 q=-0.0 size=    6143kB time=00:00:26.41 bitrate=1905.3kbits/s    
2015-12-13T15:07:50 MCEBuddy.AppWrapper.FFmpeg --> frame=  845 fps=337 q=-0.0 size=    7746kB time=00:00:33.77 bitrate=1879.0kbits/s    
2015-12-13T15:07:51 MCEBuddy.AppWrapper.FFmpeg --> frame= 1036 fps=345 q=-0.0 size=    8306kB time=00:00:41.45 bitrate=1641.6kbits/s    
2015-12-13T15:07:51 MCEBuddy.AppWrapper.FFmpeg --> frame= 1214 fps=346 q=-0.0 size=    9887kB time=00:00:48.49 bitrate=1670.4kbits/s    
2015-12-13T15:07:52 MCEBuddy.AppWrapper.FFmpeg --> frame= 1383 fps=345 q=-0.0 size=   11717kB time=00:00:55.33 bitrate=1734.5kbits/s    
2015-12-13T15:07:52 MCEBuddy.AppWrapper.FFmpeg --> frame= 1556 fps=345 q=-0.0 size=   13499kB time=00:01:02.18 bitrate=1778.3kbits/s    
2015-12-13T15:07:53 MCEBuddy.AppWrapper.FFmpeg --> frame= 1736 fps=347 q=-0.0 size=   14396kB time=00:01:09.46 bitrate=1697.8kbits/s    
2015-12-13T15:07:53 MCEBuddy.AppWrapper.FFmpeg --> frame= 1910 fps=347 q=-0.0 size=   15021kB time=00:01:16.39 bitrate=1610.8kbits/s    
Dec 16, 2015 at 4:39 AM
Let me do more testing, but try this,

put ffmpeg first in the order and Techpro2004 suggested this too, replace -vcodec with -vcodec nvenc_hevc and see if that works
Dec 16, 2015 at 2:22 PM
idk what im doing wrong, but its not working.
I tried a few variations , and I reinstalled mcebuddy . and I am on the latest version
 [----------------------]

[HEVC MP4 - custom]
Description=HEVC in MP4 (H.265/AAC) conversion. Creates a smaller file (50% smaller than H.264) with comparable quality but very slow.
order=ffmpeg
ffmpeg-general=-threads 0
ffmpeg-video=-ss 3 -vf yadif=0:-1:1,hqdn3d -vcodec nvenc_hevc libx265 -preset medium -x265-params crf=18 -map 0:v -sn
ffmpeg-audio=-acodec libfdk_aac -ab 128k -cutoff 18000 -map 0:a
ffmpeg-audioac3=-acodec libfdk_aac -ab 160k -cutoff 18000 -map 0:a
ffmpeg-ext=.mp4
ffmpeg-audiodelay=skip
handbrake-general=--decomb --loose-anamorphic --verbose=2 -f mp4
handbrake-video=--start-at duration:3 -e x265 --encoder-preset medium -q 18
handbrake-audio=-E faac -R auto -B 128 -D 0 -a 1,2,3,4,5
handbrake-audioac3=-E faac -R auto -B 160 -D 0 -a 1,2,3,4,5
handbrake-ext=.mp4
handbrake-audiodelay=skip
PreConversionCommercialRemover=true

[----------------------]
Dec 16, 2015 at 2:31 PM
Edited Dec 17, 2015 at 1:05 AM
Lews,

Remove the "libx265" Should on be this "-vcodec nvenc_hevc"
Dec 17, 2015 at 6:52 AM
Mcebuddy will automatically turn on hevc encoder if support for it found.
See the log file and search for h.265 in it to see what mcebuddy detects.

Nvidia hevc encoder requires hardware CUDA capability version 5.2 or greater.
For Nvidia h264 encoder requires hardware CUDA capability version 3.0 or greater.

Dec 17, 2015 at 12:12 PM
Edited Dec 17, 2015 at 12:23 PM
its still not working

rboy1 wrote:
Mcebuddy will automatically turn on hevc encoder if support for it found.
See the log file and search for h.265 in it to see what mcebuddy detects.
2015-12-16T18:16:41 MCEBuddy.Transcode.ConvertWithFfmpeg --> NVENC H.265 Hardware encoder detected, enabling h265 hardware encoder
Nvidia hevc encoder requires hardware CUDA capability version 5.2 or greater.
For Nvidia h264 encoder requires hardware CUDA capability version 3.0 or greater.
-
my pc i7 4790k and evga 980ti classified with 16GB ram
cuda-z said I have V5.2 and dll version 7.50

NVIDIA VIDEO CODEC SDK
NVENC provides high-quality video encoding that is faster and more power efficient compared to CUDA-based or CPU-based encoders
seems to say that nvenc doe not use cuda



anyhow this is the resultant video I get - the cpu is near 100% & GPU-z shows no usage of the gpu.
Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main@L3@Main
Codec ID                                 : hev1
Codec ID/Info                            : High Efficiency Video Coding
Duration                                 : 52mn 46s
Bit rate                                 : 1 047 Kbps
Width                                    : 720 pixels
Height                                   : 576 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 25.000 fps
Standard                                 : PAL
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.101
Stream size                              : 395 MiB (86%)
Writing library                          : x265 1.8+2-1f0d4dee7e3b:[Windows][GCC 4.9.2][64 bit] 8bit
Encoding settings                        : wpp / ctu=64 / min-cu-size=8 / max-tu-size=32 / tu-intra-depth=1 / tu-inter-depth=1 / me=1 / subme=2 / merange=57 / no-rect / no-amp / max-merge=2 / temporal-mvp / no-early-skip / rdpenalty=0 / no-tskip / no-tskip-fast / strong-intra-smoothing / no-lossless / no-cu-lossless / no-constrained-intra / no-fast-intra / open-gop / no-temporal-layers / interlace=0 / keyint=250 / min-keyint=25 / scenecut=40 / rc-lookahead=20 / lookahead-slices=0 / bframes=4 / bframe-bias=0 / b-adapt=2 / ref=3 / limit-refs=0 / weightp / no-weightb / aq-mode=1 / qg-size=32 / aq-strength=1.00 / cbqpoffs=0 / crqpoffs=0 / rd=3 / psy-rd=0.30 / rdoq-level=0 / psy-rdoq=0.00 / signhide / deblock / sao / no-sao-non-deblock / b-pyramid / cutree / rc=crf / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=51 / qpstep=4 / ipratio=1.40 / pbratio=1.30

Dec 17, 2015 at 3:23 PM
Please upload the log file to the server for analysis.

Dec 17, 2015 at 4:39 PM
hi

uploading the log it is called pe.3d
Dec 17, 2015 at 5:07 PM
@Lews you're using an old build. Use the latest 2.4.3 BETA build, this issue has been fixed in this build.

Dec 17, 2015 at 5:19 PM
Got it, thanks for reporting this. Fixed the h.265 encoder issue in today's build, please use the new build and try it out.

Dec 18, 2015 at 4:12 PM
Edited Dec 18, 2015 at 10:24 PM
the new 20151217 version the stock [HEVC MP4 ]profile works for me .

I encoded 136GB/60 videos folder to
  • [HEVC MP4] in 06hr40min (46.5 GB)
    compared to
  • [MP4 high quality] 09hr15min (55.9 GB)
[edit]
  1. that is with 2 concurrent conversions
  2. the HEVC MP4 profile really worked my videocard
    gpu-z showed it 1.2V and 1396mhz (100 above nominated boost) but only 63-64C
Dec 18, 2015 at 5:58 PM
Lews wrote:
its still not working

seems to say that nvenc doe not use cuda

The way I understand it NVENC replaces CUDA.
Just installed the 12/17 build on my laptop. Asus ROG G751JL, i7 4720HQ, 16GB, NVidia GTX965M, 500GBSSD and 1TB HHD
GPUZ shows that MCEbuddy uses the GPU but only 8-9%