Skip to main content
June 28, 2013
Question

NVidia GPU-accelerated H264-encoder plugin, ready for public testing

  • June 28, 2013
  • 100 replies
  • 389793 views

Hi all,

I have written a 'proof-of-concept' GPU-accelerated H264-encoder for Adobe Media Encoder (CS6).  It requires an NVidia 6xx/7xx series "Kepler" GPU (CUDA capability 3.0), and uses the dedicated GPU's builtin hardware-encoder (NVENC) to offload the H264-encoding process from the host-CPU.  This software is "proof-of-concept", so it's missing some critical features (no interlaced-video support, no AAC-audio or Dolby AC-3 audio), and of course, it could be buggy!  But it's free.

!!!! Disclaimer: NVENC-export is third-party software that is not supported by either Adobe or NVidia.  It comes with no warranty -- use at your own risk.

Software/hardware Requirements:

(1)Adobe Premiere Pro CS6 or Media Encoder CS6 (Windows version)

Sorry, MacOSX is not supported. (NVidia NVENC SDK doesn't support MacOSX.)

(1)NVidia Kepler GPU <GKxxx> with 1GB VRAM or more  (GTX650 or above, GT650M or above)

(Sorry, NVidia Fermi <GFxxx> is NOT supported, it doesn't have the NVENC hardware feature)

Note,if you have MPE-acceleration enabled, keep in mind the NVENC-plugin consumes some additional VRAM because it uses your GPU to perform H264-encoding.

Strongly recommend a 2GB card

(2) Microsoft Visual C++ 2010 SP1 x64 redistributables

          (download this from Microsoft's website)

Installation instructions:

     In Adobe Premiere Pro CS6:

     (1)      On your system, locate the installation-directory for Premiere Pro CS6.

               Usually, this is C:/Program Files/Adobe/Adobe Premiere Pro CS6

    (2)     Copy the included file Plug-ins/Common/nvenc_export.prm

               to <installation dir>/Plug-ins/Common/

     -> To choose the NVENC-plugin in Premiere Pro,

          In the format-menu, select <NVENC_export>

     In Adobe Media Encoder CS6:

     (1)    On your system, locate the installation-directory for Media Encoder CS6.

          Usually, this is C:/Program Files/Adobe/Adobe Media Encoder CS6

     (2)     Copy the included file Plug-ins/Common/nvenc_export.prm

          to <installation dir>/Plug-ins/Common/

     -> To choose the NVENC-plugin in Media Encoder,

          in the format-menu, select <NVENC_export>

Performance & quality notes:

(1) How much faster is NVENC-export than Adobe's built-in Mainconcept H264 encoder?

Depends on your PC system.  On my test-system, which is ordinary desktop PC with Intel i5-3570K (4-core 3.4GHz), NVENC-plugin is roughly 4x faster than Mainconcept. On a dual-socket Xeon Ivy Bridge-E system, NVENC would probably only be 2x faster (in Media Encoder.)

(2)How does the video-quality compare?

Comparing similar settings/video-bitrate, Mainconcept performs better at lower-bitrates(less artifacts).  At medium-high bitrates, NVENC is comparable to Mainconcept.

(3) How does NVENC-export encode the video?

The plugin fetches videoFrames from the Adobe application, then converts the frames from YUV420 to NV12 surface-format (using host-CPU.)  Then it passes the converted frames to the NVENC front-end.  From here, NVENC hardware takes over, and handles all aspects of the video compression. When NVENC hardware is done, it calls the plugin to output write the elementary bitstream (to the selected filepath.) NVENC-hardware does NOT encode audio, nor does not multiplex the A/Vbitstreams -- this is still done in software (on the host-CPU)

The NVENC hardware block has very little CPU-overhead.  But since video-encoding is just 1 step in the entire Adobe rendering path, CPU-usage will likely still be quite high when using NVENC-plugin.

(4) What's the maximum-size video NVENC-export can handle?

H264 High-profile @ Level 5.1, which works out to roughly 3840x2160 @ 30fps. (Note the actual encoding-speed will probably be less than 30fps.)

(5) How fast is the NVENC-export hardware in Kepler GPU?

Assuming the Adobe application host is infinitely fast (i.e. can send video to plugin in zero-time), NVENC-hardware will encode High-profile (CABAC, 2 refframes, 1-bframe) 1920x1080p video @ ~100fps. At 3840x2160p (4k video), the hardware encode-speed drops to roughly 20-25fps.  That is still faster than a desktop PC.

NVENC-speed is generally same across the Kepler family - the high-end Geforce GTX Titan (or GTX780) is no faster than the entry-level Geforce GTX650, because all Kepler models share the same NVENC hardware-block, which is totally separate and independent of the GPU's 3D-graphics engine.

In premiere Pro 6, MPE acceleration will greatly affect how quickly Adobe can render video to the exporter.  So a more powerful Kepler GPU will probalby complete projects faster than a less powerful one (up to NVENC's performance ceiling.)  For more info, please refer to NVidia's NVENC whitepaper at their developer website (public)

(6) I have a multi-GPU setup, can I encode with multiple GPUs?

No, NVENC targets and uses only a single physical GPU.  (You can choose which one.)

Known limitations and problems:

NVENC-plugin is a 'proof-of-concept' program -- it is not a finished product.  So it's missing some features, and other things are known to be broken:

    • Interlaced video encdoing does not work at all (not supported in current consumer Geforce drivers)

    • Audio support is very limited: uncompressed PCM)

no AAC or Dolby-Digital

    • Multiplexer support is very limited: MPEG-2 TS only, using an included third-party tool TSMuxer.EXE

no MPEG-4 muxing (*.MP4)

    • When the muxed MPEG-2 TS file in Windows Media Player (WMP), there is no sound.  This is because WMP doesn't recognize PCM-audio in mpeg-2 ts files.  You have 2 choices; you can use a third-party media-player such as MPC-HC or VLC.  Or you can postprocess the audio-WAV file into a compatible format (Dolby Digital/AC-3)

    • in the pop-up plugin User-interface, the <multiplexer> tab is missing or not shown properly.

(To fix: Select a different codec, then re-select NVENC_export.)

    • Doesn't support older NVidia GPUs (GTX5xx and older, GT630 and lower)

Sorry, NVENC hardware was introduced with NVidia's Kepler family (2012)  Anything older than that will NOT work with the plugin.

This topic has been closed for replies.

100 replies

Zombirate
New Participant
May 5, 2015

Quick FYI, if your file has a "#" in it, MP4Box will fail every time. Found that out the hard way.

MarkWeiss
Inspiring
May 12, 2015

I think that must be it.. because the QT Photo JPEG video I was trying to encode was named "Flagg Coal #75". Well that pretty much nails it then. Luckily, I still have the Premiere CS3 project and the original XDCam footage, so I wound up exporting a much higher quality version without the loss of color subsampling from Photo JPEG.

Thanks for pointing out the "#" compability issue. Now I know.

Michele Cordoni
Participating Frequently
April 27, 2015

Hello, my name is Michele... thanks for your good work... with your plugin my encoding is quite faster! But I've a question for you, to resolve some problems: I've a GTX Titan, with the last nVidia GeForce drivers (350.12 WHQL), on Windows 8.1 Pro x64. I have all the software you link installed (even vcredist x86 and x64).

When I make an encoding from Premiere Pro CC 2014 (original software), the plugin works quite well. Not Adobe Media Encoder CC 2014: this one crashes and shuts down just after playing an encoding. [Premiere->Export Media Files->Queque->AME->Start->some seconds of encoding then crash]. Another little problem: I've done two tests with the same timeline, with the same codec setup... the first without mp4 multiplexing (two files, m2v and m2a that works perfectly); the second with mp4 multiplexing... the resultant mp4 stutters. I attach the encoder setting. Thanks for your help.

Edit: just an update... I've tried about ten encoding... even using the same configuration and the same timeline/effects, sometimes Premiere doesn't work, sometimes AME doesn't work. Premiere says "low-level error".

When the encoder works, it can use the 98% of Video Engine, it loads GPU for about 40% (but this value is quite variable), 11-20% Memory Controller Load, about 2.3 Gb Video Memory load. The CPU max load is about 40%.

New Participant
April 10, 2015

Hello!

I have GeForce 740m. I also want to try this plugin. But

ABrefCe.png

But my videocard is Kepler series!

How can I add support of my videocard?

Cpk1NxN.png

Thank you!

MarkWeiss
Inspiring
April 10, 2015

Mine has 4GB VRAM. I think the minimum is 1.5GB in order for Premiere to recognize it.

New Participant
April 10, 2015

3ZA4Xyi.png

My videocard supports NVENC and have 2 gb.

But I have this error. Why?

n3won8g.png

MarkWeiss
Inspiring
April 5, 2015

I just rendered a window dub draft for my client yesterday and uploaded it to my DropBox account for her to review. I used the NVENC encoder to do this job, with better than expected results.

The minimum bitrate of 1mbs enabled me to bump the frame size from my usual 180x120 to 720x480 with minimal quality loss. I would not have believed 1mbs could look as good as DVD MPEG at 4.5mbs, but it looks almost perfect, even full-screen.

The render time was 2X realtime, even with the 50% performance penalty of using a Quicktime 32-bit video CODEC for the original footage (Atomos Shogun recorder). The fact that it took only 48m to render a 90-minute concert with color correction and titles and time code, from DNxHD MOV files, is impressive. The GPU did much of the work and the main CPU wasn't nailed the ceiling on load.

Whoever said that hardware encodes look bad at low bitrate should take another look. The quality was so good that I could use a large frame size for the draft. The whole 90 minute video fit in under 700mb h.264 file, which uploaded to DB in about 2 hours on a slow DSL connection. In the past, to get a file that small, I had to use 180x120 frame size or else the block artifacts were horrendous. And the render took HOURS, doing it the software way. NVENC has so many uses that improve workflow productivity. This alone makes the $250 I dropped on a GTX680 on eBay well worth the investment.

Zombirate
New Participant
March 31, 2015

Works great, thanks. Render time cut by 400%. Can't get MP4BOX to work though; TSmuxer works fine (even for YouTube) though so it's all good.

Is this still being developed?

MarkWeiss
Inspiring
April 2, 2015

Had that problem too.. fixed by updating Visual Basic and downloading the latest NVENC plugin.

Remaining bug is the profile that allows up to 40mb/s rate has an invalid flag for Blu-ray, and thus gets transcoded when imported into Encore. Using a lower profile produces compatible file, but limited to 20mb/s.

New Participant
March 24, 2015

This is such a good idea, I really don't know why Adobe don't have their own team of developers doing this work, it would make their product so much more effective.

Many thanks to nvenc4everyone for putting his unpaid time and effort in to this plugin.

I'm having a problem rendering PAL 1080p 25 footage though.  I have a 3 minute clip and it renders blisteringly fast compared to my old laptop.  The problem is the video output has a stuttery / slomo quality to it and because of that the audio isn't synched..  My laptop is brand new with raided SSDs, a GTX 980M and 16GB RAM, so hardware spec should be alright.

I'm using AVCHD footage from a Panasonic GH2.  I've followed all the prequisites so far and now I'm wondering if it's something to do with my frame rate

Is anyone else using 1080p 25?

Does anyone have any ideas what might be causing the issue?

MarkWeiss
Inspiring
March 25, 2015

I wonder if nvenc4everyone  is still monitoring this thread?

kfodskfsdfsdfsd
New Participant
March 7, 2015

The NV_ENC_PRESET_BD_GUID with sliceMode=1, sliceModeData=4 (the '4' flag does not exist btw) and level_41 is not Blu-Ray compliant with Encore and forces Encore to transcode the video. Also the final export shows green artefacts and Encore freezes for a while while importing. Any solutions to the problem ? Thank you.

MarkWeiss
Inspiring
March 8, 2015

Not a solution, but a workaround, until the author fixes it, is to use level 40, which is limited to 20mbps, but does load into Encore with "Don't transcode" as the default.

Hopefully the author of the plug in will figure out what the problem with Encore compatibility is and come up with a solution that allows 40mbps BD renders.

kfodskfsdfsdfsd
New Participant
March 8, 2015

Yeah... That doesn't work for me... Still not compliant and still artefacts... Can you please tell me your exact settings ? Thank you.

MarkWeiss
Inspiring
March 6, 2015

Just found a critical problem with the h.264 files encoded by NVENC: Encore CS6 chokes on them. More specifically, Encore won't author them to the disc unmolested.

It INSISTS on transcoding the NVENC encoded files. It leaves the AME encoded h.264 files alone and those show up on the BDMV as AVC, but every NVENC encoded file shows as MPEG2 on the BDMV disc. I noticed something was wrong when Encode was taking forever to author just a few minutes of video test clips. The status shows "transcoding" and the files.

This, despite the master settings being 'h.264'. The AME files show up as 'don't transcode' in the Project Blu-ray Transcode Settings, but the NVENC files show as 'automatic'. Worse still, I cannot select 'don't transcode' if I right click on them. I tried setting them to automatic h.264, but Encore still recompresses them into MPEG2 files.

So for BD authoring, this isn't going to fly. The gains in rendering speed out of Premiere are completely lost in having to re render them and compress them into a less efficient CODEC, and the quality loss kills the deal.

MarkWeiss
Inspiring
March 6, 2015

Delving further into investigation, I find that playing with the levels of h.264 encoding affect this problem of transcoding.

Only files of Level 40 or below are accepted in Encore without transcoding. But the problem here is the max bitrate is limited to 20mbps. If I go to Level 41 (the default for BD profile), Encore forces transcode to MPEG2. Level 41 is a ceiling rate of 50mbps which is ILLEGAL for BD and probably why Encore is rejecting them and transcoding.

There must be some flag being set incorrectly in the h.264 output file by the NVENC encoding process.

MarkWeiss
Inspiring
March 6, 2015

WORKAROUND FOR THE STILL FRAME LOSS OF SYNCH

I've been experimenting with how to solve the synch problem where black screen (or any still frame image) gets only one frame encoded, no matter how many frames in length on the sequence.

First, I tried video, with the transparency set to 0. That worked properly. So that made me think, timecode is present and the encoder needs that to keep things in synch.

So I tried bars and tone and applied "Motion" and set a few keyframes to scale it up and down. That encoded without any time slippage.

Finally, I realized that all I need to do is create ONE keyframe at the beginning of the still frame's Motion effect. No need to actually scale or move. That apparently forces Premiere to generate timecode during the export.

So the way to have still frames and not lose picture/audio synch is to enable motion keyframe.

MarkWeiss
Inspiring
March 2, 2015

I'm doing some testing of the quality of NVENC with various types of footage. At 35mbps, it actually has fewer artifacts than AME does at 30mbps. The output files for a 1 minute test sequence were 211MB and 247MB for AME and NVENC respectively.

The NVENC has some bands of block artifacts in areas of blue skies, but then so does AME. In fact, in one shot the AME rendered sky had some rather distracting and pronounced bands, whereas the NVENC version was more random and less noticed.

Of particular note was the vastly reduced mosquito noise in the NVENC version. Edges of roofs in a downtown scene rendered with few or no visible noise in the abutting sky colors. The AME encode has very obvious random clumps of pixels following the edges of rooftops as that camera pans slowly.

So it's a wash. In some ways NVENC looks better. In others, AME may have a slight edge. But above 30mbps, they both look decent. Of course, I only could view the results in Encore's preview function, by choosing the video chapter and selected 'preview from here' with quality setting at 'high'. My Oppo BDP83 might do a better deblocking job and it might look even better there, especially projected by DLP onto a screen. But this is very encouraging. 2-pass rendering for NVENC is about 2x faster than realtime, and 2-pass AME is about 3.5 times slower than realtime. That's a 7:1 difference in rendering times for similar results.

Participating Frequently
March 2, 2015

But when MP4box starts do it slow down the time of your render? Here in 30min video mp4box slow down all the process.. So here with mp4box the whole process is more slower than Intel QuickSync.

MarkWeiss
Inspiring
March 3, 2015

The render is done before MP4box starts. The render goes about 3X realtime speed for 1920x1080. The problem is MP4box generates a crash report and never MUXes the streams.