H.265, x265, and Available Hardware Decode Support

CogDiv wrote on 3/17/2017, 8:38 AM

What have others here learned about the progress of supporting H.265/HEVC decoding? There appears to have been quite a few advances on the hardware front for supporting the codec, according to this article.

Are H.265 and x265 fully compatible with each other? In other words, if I was to use x265 encoding, would the hardware H.265 decoders properly decode it?

What are the hurdles to enabling the use of the hardware H.265 decoders many of us already have on both Nvidia and AMD GPUs? Are there any hurdles? Do the drivers properly implement support in the OS (so, Windows Media Player support, for example)?

If you purchase the x265 encoder, you can also get the DirectShow decoder (UHDcode). Problem is, I would like to test the hardware decoder already built into the GPU. I do NOT expect clients/endusers to purchase a decoder to playback content, especially over the internet!

Has anyone else done some tests for hardware h.265 decoding? How well do the h.265 files encoded through VEGAS Pro 14 playback? Are they using the built-in hardware decoder if played through a media app?

Anyone know of future 4:2:2 10-bit support for the VEGAS H.265 encoder?

(NOTE: MulticoreWare could be just who to contact for some CODEC performance wrappers, hint hint.)

EDIT: The first article linked above answers some of these questions as it posits VLC Media Player as the solution for those with older systems that need to playback an HEVC file, although I don't see H.265/HEVC listed as one of the "formats" supported (is it one of the DivX versions?). Although, they do link to the x265 project's source code.

The article also goes into detail about ripping copyrighted products and encoding them in HEVC/H.265. If this is a legit use of the "personal backup" exception to copyright law, fine. I won't be doing it, and just want to note that may be a violation of copyright law (gray area).

Comments

CogDiv wrote on 3/17/2017, 5:24 PM

The x265 Documentation!

So far, the lower quality / smaller file Rate Factor and more efficient / slower Encoding Efficiency settings in Basic Mode do not utilize an R9 290 for any encoding acceleration. I'll have to dig deeper into the settings later to see if the encoder will utilize the GPU at all.

The 240Mbps MainConcept H.264 output works okay (8-bit color depth, 4:2:0), but I would like a way to push the x265 encoder to its limits of quality through the use of YUV raw, which it accepts, but apparently must be in an h.264 container (with an MP4 extension). A YUV4MPEG2 (y4m) file can be used as input also . . .

Any plans for MainConcept H.264 Broadcast (10-bit color depth, 4:2:2), H.264/AVC/MP4 YUV raw, or YUV4MPEG2 (Y4M) encoding/rendering for VEGAS Pro in the future?

Cineform and Acrovid are looking more and more unavoidable . . . and then there is v210 AVI and FFmpeg.

NormanPCN wrote on 3/17/2017, 10:03 PM

Any plans for MainConcept H.264 Broadcast (10-bit color depth, 4:2:2), H.264/AVC/MP4 YUV raw, or YUV4MPEG2 (Y4M) encoding/rendering for VEGAS Pro in the future?

Cineform and Acrovid are looking more and more unavoidable . . . and then there is v210 AVI and FFmpeg.

XAVC-I export supports AVC 422 10-bit.

As for something like y4M (uncompressed yuv). Sony YUV is uncompressed 422 setup. There is a 10-bit option. The "Uncompressed" selection is an RGB format but once you lose the chroma subsample, fully uncompressed, then why use YUV/YCbCr. Both of these items are in the Video for Windows render as templates (AVI files).

CogDiv wrote on 3/17/2017, 10:49 PM

I have to work with Apple ProRes 422 HQ 10-bit as that is the best my recorder offers, but I am still researching the intermediate possibilities. I don't yet have a solution for converting the ProRes to a viable 4:2:2 10-bit uncompressed/raw intermediate. I'm trying to avoid purchasing Acrovid for now, though it looks like an excellent solution for converting between ProRes, Cineform, and then from Cineform to whatever. FFmpeg can convert the ProRes to the Sony YUV 10-bit (v210) AVI. After the VEGAS Pro 13 edit I can output a v210 AVI and use FFmpeg to convert to Y4M. Many large files to write, and even though many along the way are not compressed, this is still taking a very long time. Note that I am also at UHD resolution with all of these.

The raw/uncompressed formats mentioned above, that you quoted, are for the highest quality input to the x265 encoder.

Edit: So, even though I am only working with 4:2:2 10-bit data, I should use YUV 4:4:4 10-bit or RGB 10bit as an intermediate to avoid more data loss? Also, I have not tested FFmpeg and the Y4M conversion yet. It is likely that Y4M will not support UHD resolution. So, another YUV raw may be the path . . . (x265 encoder insists on YUV)

For instance, from a 39.1GB 6:21 Apple ProRes 4:2:2 (HQ) 10-bit file to . . .

Video
Count                                    : 277
Count of stream of this kind             : 1
Kind of stream                           : Video
Kind of stream                           : Video
Stream identifier                        : 0
ID                                       : 0
ID                                       : 0
Format                                   : YUV
Commercial name                          : YUV
Codec ID                                 : v210
Codec ID/Hint                            : AJA Video Systems Xena
Codec                                    : v210
Codec                                    : v210
Codec/CC                                 : v210
Duration                                 : 381248
Duration                                 : 6mn 21s
Duration                                 : 6mn 21s 248ms
Duration                                 : 6mn 21s
Duration                                 : 00:06:21.248
Bit rate                                 : 5303106396
Bit rate                                 : 5 303 Mbps
Width                                    : 3840
Width                                    : 3 840 pixels
Height                                   : 2160
Height                                   : 2 160 pixels
Pixel aspect ratio                       : 1.000
Display aspect ratio                     : 1.778
Display aspect ratio                     : 16:9
Frame rate                               : 29.970
Frame rate                               : 29.970 fps
Frame count                              : 11426
Resolution                               : 10
Resolution                               : 10 bits
Color space                              : YUV
Chroma subsampling                       : 4:2:2
Bit depth                                : 10
Bit depth                                : 10 bits
Compression mode                         : Lossless
Compression mode                         : Lossless
Bits/(Pixel*Frame)                       : 21.333
Delay                                    : 0
Delay                                    : 00:00:00.000
Stream size                              : 252724838400
Stream size                              : 235 GiB (100%)
Stream size                              : 235 GiB
Stream size                              : 235 GiB
Stream size                              : 235 GiB
Stream size                              : 235.4 GiB
Stream size                              : 235 GiB (100%)
Proportion of this stream                : 0.99956

The encoding took about an hour! I have over an hour to edit. For an hour of video I am looking at 10 hours of encoding time for only one part of the process.

Marco. wrote on 3/18/2017, 8:19 AM

I think FFmpeg could also transcode ProRes to CineForm.

Wolfgang S. wrote on 3/18/2017, 8:20 AM

One way would be to export as Cineform or ProRes use Tmpgenc to encode to both 10bit H.264 or 10bit H.265. Works fine.

Desktop: PC AMD 3960X, 24x3,8 Mhz * RTX 3080 Ti (12 GB)* Blackmagic Extreme 4K 12G * QNAP Max8 10 Gb Lan * Resolve Studio 18 * Edius X* Blackmagic Pocket 6K/6K Pro, EVA1, FS7

Laptop: ProArt Studiobook 16 OLED * internal HDR preview * i9 12900H with i-GPU Iris XE * 32 GB Ram) * Geforce RTX 3070 TI 8GB * internal HDR preview on the laptop monitor * Blackmagic Ultrastudio 4K mini

HDR monitor: ProArt Monitor PA32 UCG-K 1600 nits, Atomos Sumo

Others: Edius NX (Canopus NX)-card in an old XP-System. Edius 4.6 and other systems

CogDiv wrote on 3/18/2017, 4:03 PM

Both Acrovid Footage Studio 4K and Pegasys TMPGenC Video Mastering Works 6 appear to be about the same cost (due to a current Acrovid special) and comparably equipped.

The MulticoreWare version of x265 encoder linked above actually comes with FFmpeg built with the following feature set:

PS C:\program files\x265 hevc upgrade\x265 encoder\addons\ffmpeg> ./ffmpeg -h full
ffmpeg version 2.3.git Copyright (c) 2000-2014 the FFmpeg developers
  built on Sep 12 2014 12:53:50 with gcc 4.8.1 (GCC)
  configuration: --prefix=build/ --disable-yasm --disable-everything --enable-encoder=libx264 --enable-encoder=rawvideo --enable-decoder=rawvideo --enable-decoder=h264 --enable-muxer=rawvideo --enable-muxer=mp4 --enable-muxer=h264 --enable-muxer=yuv4mpegpipe --enable-muxer=avi --enable-muxer=matroska --enable-demuxer=rawvideo --enable-demuxer=mov --enable-demuxer=h264 --enable-demuxer=yuv4mpegpipe --enable-demuxer=avi --enable-demuxer=matroska --enable-parser=h264 --enable-protocol=file --enable-protocol=pipe --disable-iconv --enable-filters
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  3.100 / 56.  3.100
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  0.103 /  5.  0.103
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
Hyper fast Audio and Video encoder

Notice "--enable-demuxer=mov" and "--enable-demuxer=avi". So, I tried a couple of Cineform renders from VEGAS using each wrapper and found that neither were recognized using the default configuration through the x265 encoder GUI. However, the v210 AVI file was recognized just fine and accepted as input.

While this saves me an encoding step (10 hours for 1 hour of video) using the current tool set at my disposal, 1 hour of UHD 4:2:2 YUV lossless 10-bit video in v210 AVI is going to be >2TB. I wonder if a render of this size is possible in VEGAS Pro 13.

CORRECTION: With the v210 AVI the x265 encoder errors out (with "Some error occurred") AFTER reading what appears to be the entire file. Not good.

As far as transcoding the ProRes file to Cineform with FFmpeg, I have not had a chance to try that yet.

NormanPCN wrote on 3/18/2017, 6:45 PM

ffmpeg does not have a Cineform encoder last I tried. ffmpeg does have a Cineform decoder.

Marco. wrote on 3/18/2017, 7:00 PM

Yes, you are right. I messed this about, sorry.

CogDiv wrote on 3/18/2017, 7:52 PM

Now I'm really trying to research transcoders that are not subscription based.

Pegasys TMPGenc does specify DivX HEVC output and advertises it on its product home page.

I also like that Acrovid mentions SSE3 128-bit processing for Footage Studio 4K and that it supports processing the videos with 16-bit color depth (though, in the fine print they actually say 16-bits per pixel, and that is very different! Marketing error?). Processing one video per core as specified on Acrovid's page linked above does not look appealing.

Starting to veer off my own original topic somewhat, but are there any other transcoder recommendations?

I suppose I'll have to just use DaVinci Resolve to convert from ProRes to Cineform and after edit in VEGAS Pro 13 from Cineform to uncompressed/lossless until I am no longer testing the workflow.

>>> Until you hit the HDR limit for the trial/personal edition of Resolve <<<

Acrovid Footage Studio 4K Trial works, though it is definitely not optimized for performance. Microsoft:Sysinternals' Process Explorer reveals the application loads the Windows cache databases, which is not necessary for its intended functionality. I'll pass on that one.

Pegasys TMPGenC Mastering Works 6 not only supports SSE3, but also SSSE3, SSE4.1, SSE4.2, AVX, and AVX2 according to the configuration options. You can manually configure the read-ahead cache for the video and audio to potentially increase encoding performance. However, even this one could use some serious optimizing, as it uses < 20% of the CPU (and not the GPU at all for Cineform AVI encoding). Microsoft:Sysinternals' Process Explorer reveals the application loads Windows cache databases and a handle to a Terminal Services Ready event. Why do so many apps muck around with things they shouldn't . . .

Low CPU utilization must have something to do with the GoPro Cineform codec, as the x265 output from TMPGenC pegs the CPU utilization.

Wolfgang S. wrote on 3/19/2017, 4:40 AM

Low performance is due to the Cineform codec. But what you can do is to run several instances of TMPGenc at the same time.

Desktop: PC AMD 3960X, 24x3,8 Mhz * RTX 3080 Ti (12 GB)* Blackmagic Extreme 4K 12G * QNAP Max8 10 Gb Lan * Resolve Studio 18 * Edius X* Blackmagic Pocket 6K/6K Pro, EVA1, FS7

Laptop: ProArt Studiobook 16 OLED * internal HDR preview * i9 12900H with i-GPU Iris XE * 32 GB Ram) * Geforce RTX 3070 TI 8GB * internal HDR preview on the laptop monitor * Blackmagic Ultrastudio 4K mini

HDR monitor: ProArt Monitor PA32 UCG-K 1600 nits, Atomos Sumo

Others: Edius NX (Canopus NX)-card in an old XP-System. Edius 4.6 and other systems

CogDiv wrote on 3/19/2017, 5:48 PM

I'll stick with the trial of TMPGenC for now, and may just have to buy it at the end.

To be fair, Acrovid Footage Studio 4K trial also opened a handle to a Terminal Services Ready event. The potentially privacy-invading handles mentioned can actually be closed through Process Explorer without any apparent malfunction of the respective app. Evidence they are not needed for the intended functionality. In fact, this is now showing up system wide, so I apparently have some malware my anti-virus software cannot detect. Anyone else see these handles when you "View -> Lower Pane" for the given app through Process Explorer? These handles were not present in other common executables yesterday.

I cannot find a way to test H.265/x265 encoding with the Acrovid trial, as that option does not show up in the conversion menu.

Marco. wrote on 3/19/2017, 6:00 PM

FootageStudio offers H.265 input but not H.265 output.

astar wrote on 11/23/2017, 11:37 AM

"if I was to use x265 encoding, would the hardware H.265 decoders properly decode it" -- testing is the only way to determine this. If you are referring to GPU/CPU hardware playback, this determined by the version of ASIC (quicksync,NVENC,VCE) on the system/GPU.

trekz wrote on 12/1/2017, 3:10 AM

I currently have a problem previewing and editing 4K, h.265 DJI Phantom 4 Advanced/Pro files in vegas 14, but my other 4k files from another camera are perfectly fine for editing. Can you please recommend how I can edit my HEVC files in vp14?

-Thomas
 

NickHope wrote on 12/1/2017, 4:41 AM

I currently have a problem previewing and editing 4K, h.265 DJI Phantom 4 Advanced/Pro files in vegas 14, but my other 4k files from another camera are perfectly fine for editing. Can you please recommend how I can edit my HEVC files in vp14?

-Thomas

@trekz As I told you by PM, HEVC is difficult to decode, and 4K HEVC in particular is really asking a lot of the computer. And Vegas does not excel at decoding it.

Here are 2 options:

  1. Try transcoding to a more Vegas-friendly format such as Sony XAVC Intra 4096x2160-29.97p. That's nearly lossless and should play much smoother than 4k HEVC. You can do it from the Vegas timeline using the script in Tools > Scripting > Batch Render. The files will be much larger than your HEVC files so storage could be a concern.
  2. Use a proxy workflow. You would switch back to the originals for your final render. See section 9 of this post. The whole post is also worth a read.