Issue Importing HEVC/H.265 Chroma 4:4:4 into Vegas Pro 18

Niz wrote on 3/29/2021, 12:59 AM

Hi All,
I have been trying to import some video to Vegas Post 18 (Vegas Pro) however I get a generic, "failed to import and we don't know error," when I try. The source video is H.265 recorded at Chroma Sub-sampling of 4:4:4 using 1920x1080 FHD resolution into a MKV file. I then use FFMpeg to convert it before importing into Vegas Pro 18.

I have been all up and down the list of options for both the libx265 and hevc_nvec encoders in FFMpeg. I also tried converting the video to 10-bit h.265, however anything that has 4:2:0 doesn't show up as 10-bit when I test the video in VLC. Anything greater then 4:2:0 h.265/hevc will give the import error. I tried changing the project settings for 8-bit limited, 8-bit full, 32-bit float, 32-bit full, but still get the same error during import. I also the file I/O options, enabling Legacy GPU rendering, but the same result.

A few setting examples.
Fails:
-pix_fmt yuv444p10le -profile:v main444-10
-pix_fmt yuv422p10le -profile:v main422-10
-pix_fmt yuv444p -profile:v main444-8

Works:
-pix_fmt yuv420p10le -profile:v main10 (doesn't show as 10-bit)
-pix_fmt p016le -profile:v main10 (doesn't show as 10-bit)

I have an RTX 3070, so 4:4:4 decode/encode is supported by the GPU for H.265.

To be more specific about the info I'm looking for.
Does Vegas support 4:4:4, 4:2:2 in any format for h.265/hevc? I haven't been able to find it in the documentation.
Am I missing some setting in Vegas for 4:4:4 on h.265/hevc imports.
Any examples for FFMpeg to actually get h.265 or hevc_nvec 4:2:0 that is actually 10-bit?

I know h.264 4:4:4 works, but I am really hoping to get the bitrate and quality savings of h.265 into my work flow.
This is a hobby for me. It's been driving me crazy trying to push that extra little step in quality of production.

Thank you in advance for your time and consideration.

Comments

Niz wrote on 3/29/2021, 1:03 AM

Thought I should clarify.

I would be happy with 10-bit 4:2:0 if it is actually 10-bit in h.265/hevc. But I haven't been able to get FFMpeg to do that.
I would prefer to have 4:4:4 for any bit as long as it's h.265/hevc.

JN- wrote on 3/29/2021, 3:44 AM

@Niz ffmpeg based util in my signature VFR2CFR converts to x264 but not hevc, give it a try if that will do. Key ‘C’ toggles the various Chroma options. Also using ffmpeg to Prores here.

”I have an RTX 3070, so 4:4:4 decode/encode is supported by the GPU for H.265I thought that 444 h.264 encode, was limited to 8 bit for nvenc.

@wwaag's HOS Import tools are worth looking at also.

 

”I know h.264 4:4:4 works, but I am really hoping to get the bitrate and quality savings of h.265 into my work flow.

It depends on your data rates. If you are using 70 Mbps and below then you will see savings. From testing I did, UHD, there are extremely small savings, if any, above 100 Mbps

 

Last changed by JN- on 5/13/2021, 5:16 AM, changed a total of 10 times.

---------------------------------------------

VFR2CFR, Variable frame rate to Constant frame rate link to zip here.

Copies Video Converts Audio to AAC, link to zip here.

Convert 2 Lossless, link to ZIP here.

Convert Odd 2 Even (frame size), link to ZIP here

Benchmarking Continued thread + link to zip here

Codec Render Quality tables zip

---------------------------------------------

PC ... Corsair case, own build ...

CPU .. i9 9900K, iGpu UHD 630

Memory .. 32GB DDR4

Graphics card .. MSI RTX 2080 ti

Graphics driver .. latest studio

PSU .. Corsair 850i

Mboard .. Asus Z390 Code

 

Laptop… XMG

i9-11900k, iGpu n/a

Memory 64GB DDR4

Graphics card … Laptop RTX 3080

Niz wrote on 5/13/2021, 12:44 AM

Sorry for the late replay @JN- .

I have been all over the place learning about codecs and experimenting. Life has also been quite interesting lately. Your reply did get me thing on somethings though, and started me down a couple bunny trials.

I have some older videos in my backlog that are only 4:2:0 8-bit, and newer videos that are 4:4:4 8-bit, and 4:4:4 10-bit. I don't think I mentioned this before, but I'm trying to establish a workflow. Exploring the options between, what gives me the best quality, and what is reasonably doable with the hardware/software available to me at this time.


"ffmpeg based util in my signature VFR2CFR converts to x264 but not hevc, give it a try if that will do."

Thank you for the offer of using VFR2CFR. When it comes to converting videos post-recording, but pre-editing, I'm fine with Handbrake CLI or FFMpeg. I actually prefer using those command line options, because then I can script them out and have it run automatically over night. At least that will be the end goal once I have fully established my new work flow. My day job is in I.T. so making CMD/Powershell scripts is a skill that I like to practice.


"Also using ffmpeg to Prores here."

I have since tried ProRes, UTVideo, DNxHD, H.264, H.264 -g 1, H.265, H.265 -g 1 and a few other options. Along with all kinds of color sub sampling options. The -g 1 options is an FFMpeg options to set GOP length. This is their recommendation for setting H.264 and H.265 with the intention of using all I-Frames to make video editing easier for an NLE.


Hopefully the results I got below will help another person when making their choice.

ProRes - Only does 10-Bit, not a deal breaker. Files are big since it is an intermediate format. Uses CPU for decoding. Performance was okay if you are only doing 1 or 2 camera angles in Multi-Cam edit mode.

UTVideo - Only does 8-Bit. Files are about the same as ProRes as it is an intermediate format that is "lossless". I think it is mathematically lossless. Very flexible for resolution and frame rate options. Uses CPU for decoding. Got very good performance out of this. It seems to use multi-threading a bit better then ProRes. Though, there was a multi cam project that I was working on, and some times the video for some of the angles would get messed up and cause VP 18 to crash.

DNxHD - I didn't like this one at all. It has very strict settings for resolution, frame rate, and bit rate. The documentation it is terrible for FFMpeg, and if you don't get those settings right then the encode fails. Since the resolution settings are so limited, I couldn't get the performance needed for the multi-cam project. Dropped this one like a hot potato.

H.264 - Works if you have 1 video. If I remember correctly, anything above 4:2:0 stops using the GPU for decoding, so the performance tanks.

H.264 -g 1 - This "works" but VP 18 will switch over to CPU for decoding. So the performance isn't so good.

H.265 - Gave errors for anything above 4:2:0 when trying to import.

H.265 -g 1 - This "works" but VP 18 will switch over to CPU for decoding. So the performance isn't so good and is way worse then H.264 -g 1 for performance. It also has the same problem of giving an error for anything above 4:2:0 when importing.

 

As of Version 18.0 (Build 527) there was a message before updating that said "HEVC 10-bit 4:2:2 decoding with supported hardware" in the patch notes. This suggest HEVC 10-bit 4:2:2 was not supported before. Two issues here.

1. I really wish they would list what the support for their codecs more then "It totally supports HEVC" on the site. Magix documentation is terrible at best, but mostly non-existant from what I can see.

2. I don't know what I'm doing wrong, but it still doesn't work. I can import HEVC 10-bit 4:2:2 now, but the performance is terrible at 1920x1080 60fps, looks like a slide show. Task manager shows hardly any CPU usage, next to now 3D engine usage on the GPU, and 0% usage for Video Decode on the GPU. I have checked the GPU related options in VP 18 about ten times now. I know they are correct. And that was only one video on a dedicated NVMe SSD.

 

"I thought that 444 was limited to 8 bit for nvenc."

From Nvidia just about every card on Turing or Ampere supports decoding 4:4:4 on 8-bit, 10-bit, and 12-bit H.265(HEVC). You can check that out here on Nvidia's site, and click Decode, then find the GPU.

Nvidia supported decode/encode - https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new

 

"@wwaag's HOS Import tools are worth looking at also."

For what I need, the proxy tool, they want money. Understandably so, they should be compensated for their work. However, I have already spent more then enough on a hobby. Not looking to spend more at this time. If this was making me money, I would consider it as it would pay for it self. I have seen all over the forms people praising HOS.

 

"It depends on your data rates. If you are using 70 Mbps and below then you will see savings. From testing I did, UHD, there are extremely small savings, if any, above 100 Mbps"

Most of the recording are done using StreamFX in OBS Studio. Nvenc H265 in CQP 10. So the files end up being between 25MBps to 50MBps and look pretty good to me. Going from that to a something like ProRes takes a 1.5GB file to like 32GB file, just as an example. Huge difference in space.

 

--Other thoughts--

I haven't tried MagicYUV codec yet. Though they only have the older version for free.

8-Bit or 10-Bit I don't really care about. What I really want is the 4:4:4 in editing. I don't have any 10-bit monitors at my computer. I just wanted a format that would let me edit in 4:4:4 and I was fine going to 10-bit if that is what was required.

 

--Things I have learned and things I'm venting to the void about--

Intermediate codecs are huge.

Intermediate codecs are CPU bound.

Trying to get codecs to work in magix VP is kinda a pain, especially if it needs quicktime like DNxHD.

I really don't like the way VP organizes codecs, its bothersome to try and find them when you install a new one because it's always listed as an option under another native VP supported codec.

VP 18 has multi-cam support, but it doesn't work very well.

VP 18 needs better more detailed documentation for what codecs and containers they support.

 

At any rate. My journey isn't done yet to find that balance of performance, space savings, and work flow time management.

However I wanted to at least acknowledge @JN- that you took the time to reply to my post. And, that it did get me thinking about other options. Thank you.

JN- wrote on 5/13/2021, 4:34 AM

@Niz 

 

“I thought that 444 was limited to 8 bit for nvenc."

From Nvidia just about every card on Turing or Ampere supports decoding 4:4:4 on 8-bit, 10-bit, and 12-bit H.265(HEVC). You can check that out here on Nvidia's site, and click Decode, then find the GPU.”

I wasn’t specific enough with my previous post, I was referring to the h.264 encode limitations. I have updated my previous post to this. “I thought that 444 h.264 encode, was limited to 8 bit for nvenc."

My ffmpeg based util VFR2CFR only outputs x264.

Last changed by JN- on 5/13/2021, 5:15 AM, changed a total of 1 times.

---------------------------------------------

VFR2CFR, Variable frame rate to Constant frame rate link to zip here.

Copies Video Converts Audio to AAC, link to zip here.

Convert 2 Lossless, link to ZIP here.

Convert Odd 2 Even (frame size), link to ZIP here

Benchmarking Continued thread + link to zip here

Codec Render Quality tables zip

---------------------------------------------

PC ... Corsair case, own build ...

CPU .. i9 9900K, iGpu UHD 630

Memory .. 32GB DDR4

Graphics card .. MSI RTX 2080 ti

Graphics driver .. latest studio

PSU .. Corsair 850i

Mboard .. Asus Z390 Code

 

Laptop… XMG

i9-11900k, iGpu n/a

Memory 64GB DDR4

Graphics card … Laptop RTX 3080

Howard-Vigorita wrote on 5/13/2021, 10:49 AM

@Niz if you could snip out a short 15-30 sec sample clip and put it on a cloud drive I'd be happy to give it a shot with ffmpeg myself. And maybe a Magix or other developer might notice it too.

I snipped a 30 clip out of the middle of a longer clip just the other day with this command line in a script:

ffmpeg -ss 00:00:45 -i %infile% -to 00:00:30 -c:v copy -c:a copy %outfile%

 

Niz wrote on 5/13/2021, 9:41 PM

@JN- Ah. Unfortunately Nvidia doesn't list their H.264 options very well. I have about 300 lines in notepad++ of settings of failed and working encodes. So I don't remember everything that I have tried. But, I think you are right. There is some kind of limitations with nvenc for h.264. I think they put more time into make sure H.265 would be compatible with the full codec as a whole.

 

@Howard-Vigorita In standard bad post fashion, I have complained about multiple things. It would be a good help to me to have clarification on what issue you are wanting to look at.

1. Issues with VP 18 when it comes to importing HEVC/H.265 at 4:4:4 and 4:2:2 chroma. (Please note that it technically imports 4:2:2 now, however I still have performance issues) <--- This is what the post was originally about.

2. Disregarding chroma, performance issues in multi-cam edit mode.I was able to decent performance using UTVideo codec at 640x360 resolution. But still not as good as I was hoping. I was only able to get 4 "angles" out of the 7 that I wanted to get loaded.

I'm guessing from the ffmpeg command that you posted, you just want a small copy of the source video as it is?

 

Thanks to both of you in advance for you time and consideration.

Howard-Vigorita wrote on 5/13/2021, 11:20 PM

Thought I should clarify.

I would be happy with 10-bit 4:2:0 if it is actually 10-bit in h.265/hevc. But I haven't been able to get FFMpeg to do that.
I would prefer to have 4:4:4 for any bit as long as it's h.265/hevc.


Got the idea that you were looking to transcode your problem 4:4:4 clip to 10-bit 4:2:0 with ffmpeg. Do that often with other formats but don't have any 444 hevc and don't know if ffmpeg will accept that... I think it does. Here's a command line that I just happened to be working on to convert a 422 mxf file to 10-bit 420 hevc if you want to have at it yourself:

ffmpeg -i "infile.mxf"  -c:v hevc_nvenc -rc:v vbr -cq:v 16 -b:v 25000k -maxrate:v 50000k -s 3840x2160 -pix_fmt p010le -preset slow -an "outfile.mp4"

That generates a roughly 50mbps bit-rate 4K clip with the Nvidia hardware encoder. Works on my lowly 1050ti but it should fly on yours. You probably want to change the "-s 3840x2160" parameter for HD. If you lower the "-cq:v 16" parameter, the bitrate and file size will go up. Remove "-an" if you want to keep the audio. If you want 422 hevc, I think you need to use the slower libx265 codec because Nvidia hardware doesn't support that.

To answer one of your other questions, as of Vegas 18 build 527, Vegas supports hevc 4:2:0 and 4:2:2 but none of the video hardware except Intel Iris claim to support hevc 422 so it'll perform slower in Vegas if you don't have that.