• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
10

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

Guest
Jun 27, 2013 Jun 27, 2013

Copy link to clipboard

Copied

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.

TOPICS
Hardware or GPU

Views

362.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
replies 421 Replies 421
Contributor ,
Mar 01, 2015 Mar 01, 2015

Copy link to clipboard

Copied

I don't know anything about that. I thought Visual C++ was a programming/coding environment. How do I tell if I have it installed?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 01, 2015 Mar 01, 2015

Copy link to clipboard

Copied

I went to MSFT and downloaded the latest Visual C++ and then reinstalled the newer NVENC plugin.

The plugin now appears in Premiere and it launches MP4box, but a popup says "mp4box.exe has stopped working" and the underlying window shows an error "possible variable frame rate... fixed frame rate flag absent"

??

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 04, 2015 Feb 04, 2015

Copy link to clipboard

Copied

So, I followed the video and got this using Premiere CS6...

Screenshot_1.png

Specs:

i7-2600

GTX 970

32gb RAM

Any clue?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 05, 2015 Feb 05, 2015

Copy link to clipboard

Copied

to            Community Member

I  got similar error for timeline with black screen at the begining. If black video to replace with empty space no error.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 02, 2015 Mar 02, 2015

Copy link to clipboard

Copied

What do you mean? Do you mean a black screen in general?  I have a title sequence that has a black background...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 02, 2015 Mar 02, 2015

Copy link to clipboard

Copied

I mean when I render a video clip. No black screen, just a clip of an orchestra. It renders the video and then the Nero AAC renders the audio, and then MP4box starts and I get a crash report for it. I don't have variable frame rate selected, but MP4box thinks I do and can't process the file.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 02, 2015 Mar 02, 2015

Copy link to clipboard

Copied

Try set NV_ENC_PRESET to NV_ENC_PRESET_BD_GUID
and MP4box from gpac-0.5.2-DEV-rev58-ge59cb02-master-x64.exe is working for me.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 03, 2015 Mar 03, 2015

Copy link to clipboard

Copied

BINGO! It works! And the quality is surprisingly good with an avg br of only around 5mbs. In fact, it looks almost indistinguishable from 35mbs. This will be very usable for banging out quick 1080P Youtube videos, being it's 7X faster than using AME. Thanks for that hint!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 03, 2015 Mar 03, 2015

Copy link to clipboard

Copied

I do notice one problem though.. if there is black video, such as a fade to black for a few seconds, that black is reduced to a single frame in duration in the output file, throwing the video and audio out of synch from that point forward.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 04, 2015 Mar 04, 2015

Copy link to clipboard

Copied

Is it 7 times faster before or after mp4box?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 04, 2015 Mar 04, 2015

Copy link to clipboard

Copied

Either way. MP4Box takes about 1/2 second to do its thing at the end of the rendering. I see a command box open and close. Happens so fast I could miss it if I blink.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 05, 2015 Mar 05, 2015

Copy link to clipboard

Copied

Thank you for reply. Here in a 10min fullHDvideo, mp4box takes 3min, it is happening only with me?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 05, 2015 Mar 05, 2015

Copy link to clipboard

Copied

You're probably using a mechanical hard drive to store the files, right? I'm using an SSD. The difference between 50MB/s and 535MB/s can be pretty dramatic.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 05, 2015 Mar 05, 2015

Copy link to clipboard

Copied

The big problem is this, mp4 box read and write on same drive.. It slow down the process. I'm using a laptop, so only 1tb option is a hybrid ssd, but i will try with a usb3.0 external ssd. Maybe this go better.. The logical solution would be if mp4box read from one HD and write on another...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 05, 2015 Mar 05, 2015

Copy link to clipboard

Copied

When you need fast read/write times, avoid any device with the letters "USB" in it. Get a good fast internal SSD and work in that space. It makes a huge difference in MUXing, which is disc intensive.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 06, 2015 Mar 06, 2015

Copy link to clipboard

Copied

Ok, im sorry but i feel really dumb.. Now i installed nvenc on another PC (gtx970) but multiplexing MP4 doesn't apper mp4box change path option, when i hit OK it says: MP4BOX path is invalid: C:\TEMP\MEGUI\TOOLS\MP4BOX\MP4BOX.EXE

What i did wrong?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 06, 2015 Feb 06, 2015

Copy link to clipboard

Copied

Greetings, i have tested this preset and i love it! It uses 80-100% of Gpu when it used 0-30%

But it is useful when u use ONLY GPU ACCELERATED EFFECTS.

If i use an effect like the Noise Reduction or from the Magic Bullet Suite, Mojo or Denoiser for exaple, this preset does not work at all!
I can encode, but the GPU is at 0% and it takes the same time as the h264 premiere's preset and the CPU is at 100% as usual

I love the idea to encode with the combination of GPU and the CPU, because as it is now, if u encode a timeline that has effects that do not support GPU Acceleration you must use only the CPU.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 08, 2015 Feb 08, 2015

Copy link to clipboard

Copied

Hi, mp4box worked first time, but now it is stopping working, it says: Possible Variable Frame Rate: VUI "fixed_frame_rate_flag" absent.MP4box seems not work with codec anymore. Anyone with same problem?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 13, 2015 Feb 13, 2015

Copy link to clipboard

Copied

Fury3D написал(а):

Hi, mp4box worked first time, but now it is stopping working, it says: Possible Variable Frame Rate: VUI "fixed_frame_rate_flag" absent.MP4box seems not work with codec anymore. Anyone with same problem?

02.jpg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 13, 2015 Feb 13, 2015

Copy link to clipboard

Copied

Thank you, now it works. I think mp4box slowly very much render times.. The video render time was same time as mp4box process.. Mp4box double rendertimes 😕 In this case Intel Quick Sync won, it was 25% faster.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 01, 2015 Mar 01, 2015

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 02, 2015 Mar 02, 2015

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 02, 2015 Mar 02, 2015

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 05, 2015 Mar 05, 2015

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 05, 2015 Mar 05, 2015

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines