Question / Help Bring back the old h264 nvenc media foundation for local output PLEASE

BranTheWalker

New Member
Bear with me as I try to explain why I want the old NVIDIA NVENC encoder back.

I record my local files in 40mbps variable bitrate, and edit with Premiere Pro. Before the change to NVIDIA NVENC, i could edit my videos smoothly in premiere pro. But ever since the new NVENC, the preview window in premiere lags if i scroll too fast, this is annoying as i deal with large and long videos.

I think this happened during the release of OBS 14 or 15. I checked the changelog here: https://github.com/jp9000/obs-studio/releases?after=0.15.2 and i think it's when you guys removed Media Foundation NVENC where all my issues started to happen.

Any help would be appreciated. The mp4 in Xsplit recorded in h.264 or the mp4 in elgato has no issues when I edit them in Premiere Pro. There's no lag in preview window in Premiere Pro. There's something about the way obs handles the mp4 that makes it difficult to edit in Premiere Pro. For what it's worth, i had the option to choose 3 profile before OBS 14 (15?), x264, nvidia h264 or nvenc media foundation. Now I can only pick x264 and h.264 nvenc.

If you guy's still don't understand what I'm trying to explain, then I can record my desktop and show you my issue in Premiere Pro.

BTW I got top of the lin PC so shouldn't be any pc related. i75960x 32gb Ram, GTX Titan X etc...
 

Fenrir

Forum Admin
You shouldn't ever be recording to mp4 anyway. Record to FLV or MKV and remux after if your editor doesn't understand containers.

Also, it's unlikely that OBS's implementation of NVENC is the issue here. Drivers from NVIDIA may have changed or updated the NVENC encoder.

I've been using NVENC for local recordings before and after the change from Media Foundation implementation (which is, frankly, kinda crap).and haven't had any issues at all. All my recordings are smooth as butter.

Have you tried playing the recording back in VLC to see if you have the same issues? Premiere is known to have very poor format support, so the issue could also be on their side. I don't personally use Premiere, so hard to say.
 

BranTheWalker

New Member
NVENC works perfectly fine here.

The recording and quality etc is perfect, it's just that in Premiere Pro the mp4 file is being difficult compared to the mp4 from xsplit and elgato. When i try to scroll fast trough my videos, the preview window kind of lags. I will record the difference between OBS and elgato in Premiere Pro and share the video here. Give me a few minutes.

You shouldn't ever be recording to mp4 anyway. Record to FLV or MKV and remux after if your editor doesn't understand containers.

Also, it's unlikely that OBS's implementation of NVENC is the issue here. Drivers from NVIDIA may have changed or updated the NVENC encoder.

I've been using NVENC for local recordings before and after the change from Media Foundation implementation (which is, frankly, kinda crap).and haven't had any issues at all. All my recordings are smooth as butter.

Have you tried playing the recording back in VLC to see if you have the same issues? Premiere is known to have very poor format support, so the issue could also be on their side. I don't personally use Premiere, so hard to say.

If it was Nvidia, wouldn't the mp4 in Xsplit and Elgato also have the same issue? My recordings are perfect, it's just in premiere pro, the preview window lags compared to my elgato videos.
 
Last edited:

koala

Active Member
Try if it helps setting the keyframe interval from 0 (auto) to explicit 1 or 2 seconds. If premiere does not only show key (I) frames at fast forward or backward but also tries to display P/B frames in between, this may help, because there are not so many frames to decode (and throw away) between key frames.
 

BranTheWalker

New Member
Try if it helps setting the keyframe interval from 0 (auto) to explicit 1 or 2 seconds. If premiere does not only show key (I) frames at fast forward or backward but also tries to display P/B frames in between, this may help, because there are not so many frames to decode (and throw away) between key frames.

Where do i find that option In OBS Studio? Is it the B-Frames setting? Mine is currently at 2

Here's my settings btw: https://gyazo.com/31c2e49a90c1481786c0e198b70f5813 and https://gyazo.com/d33d71a2f67cc1e4defc04221b8b24e0
 

koala

Active Member
Well, it' the setting below the bitrate in your first picture.

But: you said you do only recording. For recording, you use a quality based rate control mode such as CQP, and no bitrate rate control mode. In the first picture, switch from VBR to CQP and choose a CQP value of 16-20 for quality (16=indistinguishable quality from the original, 20=very high quality, 23=high quality with a few artifacts). The lower the CQP value, the larger the files (and implicitly the bitrate) and the better the quality. For CQP mode, there is also the Keyframe Interval setting available.
And choose the "high" profile. It opens additional encoder features that increase the quality for bitrate-based rate control modes and lowers the file size for quality-based rate control modes.
 

BranTheWalker

New Member
Well, it' the setting below the bitrate in your first picture.

But: you said you do only recording. For recording, you use a quality based rate control mode such as CQP, and no bitrate rate control mode. In the first picture, switch from VBR to CQP and choose a CQP value of 16-20 for quality (16=indistinguishable quality from the original, 20=very high quality, 23=high quality with a few artifacts). The lower the CQP value, the larger the files (and implicitly the bitrate) and the better the quality. For CQP mode, there is also the Keyframe Interval setting available.
And choose the "high" profile. It opens additional encoder features that increase the quality for bitrate-based rate control modes and lowers the file size for quality-based rate control modes.

Wow I'm blind hehe!

I'll try recording tomorrow with keyframe interval 1 or 2 and see how that goes. I'll then try the CQP mode. The thing I like about the variable bitrate is that I can set a maximum bitrate, like I set max bitrate at 40 000 for 1080p recordings, and 130 000 for 4K. I'll see how the CQP works tomorrow :D

Thanks for the help so far! Really appreciate it!
 

koala

Active Member
The problem with bitrate is, that you waste bandwidth on low-motion scenes and have not enough bandwidth for high-motion scenes. low-motion scenes could go with lower bitrates if allowed, because there are not enough changes from frame to frame to warrant a high bitrate. You waste disk space, because the encoder fills the file with useless stuff to maintain the bitrate. On the other hand, high-motion scenes produce much data, bit if this goes higher than the allowed bitrate, it is cut and the quality suffers. With quality-based rate controls, the encoder maintains a constant quality. Every frame gets the same quality. If there is nothing to encode, the bitrate drops, and if there is much to encode, the bitrate is raised as high as it is needed.

In the end, the overall bitrate of your file is not much different than your 40000. It's only that the data is properly distributed to where it belongs - no padding, no cutting. For 1920x1080x60, with NVENC CQP=23, the resulting bitrate of the whole file is about 26000, at CQP=16 it is about 69000.
 

BranTheWalker

New Member
I tried recording with both 1 and 2 keyframe interval, and both are much better in Premiere compared to when it was set at 0! It's still not as smooth as my elgato files in premiere, but it's so much better than the previously that I'll take it.

I really appreciate the explanation for CQP! I just tested a 15 min recording with CQP 18, and got bitrate 54000 for 1920x1080x60. I think I'll set it at 19 or 20 instead. I assume 19 or 20 should be fine for 4K 60fps too.

Also I read Fenrirs post again about how I should use FLV instead of mp4 and then use remux later. I tried that now and the remux part seems fast, so is there really any reason not to use flv? Especially since the file will apparently still work after a crash? I assume the quality of the file in flv is the same as mp4?

Sorry about all the questions, I promise this is the last one :D Once again, thank you so much for the help!
 

BranTheWalker

New Member
I see, well I don't need multiple audio tracks for now, and I read you can do that in MKV, but that's something I'll look into when I need it. Thank you so much everyone for the help!
 

Fenrir

Forum Admin
Also I read Fenrirs post again about how I should use FLV instead of mp4 and then use remux later. I tried that now and the remux part seems fast, so is there really any reason not to use flv? Especially since the file will apparently still work after a crash? I assume the quality of the file in flv is the same as mp4?

flv is just a container, the video inside (regardless of container selection) will be h.264. As others have mentioned, the flv container doesn't support multi-track audio, so if you need that, you would use mkv.

mp4 is a great container for most things, it's just really bad for live recordings, because if the file doesn't get finalized it's basically lost forever.
 
Top