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

Woot! NVENC is working for FFMPEG!!!

Dec 8, 2015 at 10:36 PM
MCEBuddy just transcoded a one hour 1080i show in 13:02 and a 1 hour 720p show in 10:38! My overall CPU load never went over 28% on an i7 (3440) with an NVidia GT640.

Thanks for the update to fully support NVENC in FFMPEG! This is awesome.
Dec 9, 2015 at 3:02 AM
Curious, did you use the stock profile to automatically enable NVENC through MCEBuddy or did you write a custom profile?

Dec 9, 2015 at 3:53 PM
I was already using a custom FFMPEG profile. It doesn't appear that presets work with nvenc_h264 encoder, so now I am writing a specific profile. So far, this is what I'm testing:
-vf yadif=0:-1:1,hqdn3d,scale=1280:720 -vcodec nvenc_h264 -b:v 3M -bufsize:v 6M -maxrate 5M -bf 3 -refs 5 -b_strategy 2 -me_method umh -me_range 16 -sc_threshold 40 -subq 8 -trellis 1 -chromaoffset -2 -i_qfactor 1.40 -g 250 -keyint_min 25 -qcomp 0.60 -qmin 0 -qdiff 4 -r 30000/1001 -profile:v high -level 4.0 -sn -acodec ac3 -ab 384k

Note: I've also set ffmpeg-VideoOptimized=true for this profile so MCEBuddy doesn't try to mess with any of my settings (like adjust the -b parameter according to scaling).
Dec 9, 2015 at 5:44 PM
Presets work with the latest build of MCEBuddy. Generic and there are nvenc specific presets also

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:06 PM
I'm running the 12/9/15 version of beta. A quick test using the MP4 Normal profile setting has it choosing Handbrake. It detects NVENC support with a PASS and then chooses Handbrake without hardware acceleration. Let me know if you want me to test anything else. I'm currently installing the 12/11 release, but it doesn't look like anything changed that would affect hardware acceleration.
Dec 11, 2015 at 4:45 PM
Can you please upload the video conversion log, would like to analyze it.

Dec 11, 2015 at 5:50 PM
I uploaded to your FTP with the filename "Discussion 648531.log". I didn't let the conversion finish since it was obviously not using NVENC. Let me know if I can do any other testing.
Dec 11, 2015 at 6:41 PM
Perfect thanks. Just put a patch for auto selection of the tool, there was a bug. Can you try the new build and stock profiles and let us know.

Dec 16, 2015 at 4:01 PM
I swear I replied to this last week, but I don't see my reply now. Here is what I've found using the latest beta build. MCEB does correctly detect NVENC and now selects FFMPEG over Handbrake. That part seems to work great. I did notice that the test for NVENC was run an additional time, which seems redundant.

What still doesn't seem to work, is setting the proper parameters for NVENC. MCEB is still passing to FFMPEG the x264 options (which don't work with NVENC). Since the default profiles do most of their settings in x264 options, the encode uses "default" NVENC parameters for most things and this results in a lower quality than the profile would achieve using x264. I know that NVECN is never going to be comparable to x264, but letting all the parameters default definitely results in lower quality. This is the FFMPEG video options I've decided on for me in a custom profile that give pretty good results:
ffmpeg-video=-vf yadif=0:-1:1,hqdn3d,scale=1280:720 -vcodec nvenc_h264 -b:v 3M -bufsize:v 6M -maxrate 5M -preset hq -bf 3 -refs 5 -b_strategy 2 -me_method umh -me_range 16 -sc_threshold 40 -subq 8 -trellis 1 -chromaoffset -2 -i_qfactor 1.40 -g 250 -keyint_min 25 -qcomp 0.60 -qmin 0 -qdiff 4 -r 30000/1001 -profile:v high -level 4.0

In my custom profile I've also set ffmpeg-VideoOptimized=true so MCEB doesn't mess with any of my settings or else it tries to scale my bitrate when going from 1080i to 720p (my desired output size).

I've uploaded my new log file to the FTP site with this name: Discussion 648531-FFMPEG_NVENC.log
Dec 17, 2015 at 6:37 PM
@bmaaske could you help us out and let us know which options from x264 aren't compatible with nvenc and we'll put some intelligence in to strip/replace them with the eq. nvenc options.

Dec 17, 2015 at 8:03 PM
Here is how I translated the libx264 options for use with NVENC:

libx264 AVoptions:
me=hex becomes ffmpeg -me_method hex
trellis=2 becomes -trellis 1
subq=8 becomes ffmpeg -subq 8
partitions=all doesn't translate to NVENC: -partitions all doesn't work
8x8dct=1 doesn't translate to NVENC: -flags2 +dct8x8 doesn't work
ref=5 becomes ffmpeg -refs 5
rc-lookahead=50 doesn't translate to NVENC: -rc-lookahead 50 doesn't work (NVENC doesn't support lookahead)
keyint=25 becomes ffmpeg -g 25
min-keyint=20 becomes ffmpeg -keyint_min 20
bframes=3 becomes ffmpeg -bf 3
weightb=1 doesn't translate to NVENC: -flags2 +wpred doesn't work
level=4.0 becomes ffmpeg -level 4.0
b-pyramid=normal doesn't translate to NVENC: -flags2 +bpyramid doesn't work
direct=auto doesn't translate to NVENC: -directpred auto doesn't work
mixed-refs=1 doesn't translate to NVENC: -flags2 +mixed_refs doesn't work
deblock=-1,-1 doesn't translate to NVENC: -deblockalpha 1 & -deblockbeta 0 don't work
no-fast-pskip=1 doesn't translate to NVENC: -flags2 -fastpskip doesn't work
no-dct-decimate=1 doesn't translate to NVENC: there is no ffmpeg equivalant
b-adapt=2 becomes ffmpeg -b_strategy 2
threads no equivalant

I also found it helpful to specify these:
-preset hq
-me_range 16
-sc_threshold 40
-chromaoffset -2
-i_qfactor 1.40
-qcomp 0.60
-qmin 0
-qdiff 4
-profile:v high

This is my complete video options from my custom profile I'm testing. I'm getting really good quality with this. I pretty much just translated the options from the x264 "slow" profile into ffmpeg options, where I could, to come up with these options.

ffmpeg-video=-vf yadif=0:-1:1,hqdn3d,scale=1280:720 -vcodec nvenc_h264 -b:v 3M -bufsize:v 6M -maxrate 5M -preset hq -bf 3 -refs 5 -b_strategy 2 -me_method umh -me_range 16 -sc_threshold 40 -subq 8 -trellis 1 -chromaoffset -2 -i_qfactor 1.40 -g 250 -keyint_min 25 -qcomp 0.60 -qmin 0 -qdiff 4 -r 30000/1001 -profile:v high -level 4.0
Dec 17, 2015 at 11:19 PM
curious, these are ffmpeg options, I guess using them can apply to libx264 also right?