guihkx / flatpak-app-obs-studio-nvidia-legacy

Flatpak build of OBS Studio for legacy NVIDIA GPUs / NVIDIA Video Codec SDK 11.1 / 470xx drivers series on Linux
GNU General Public License v2.0
1 stars 0 forks source link

Still not able to use Nvidia NVENV codec #2

Closed Yorisoft closed 5 months ago

Yorisoft commented 5 months ago

image

image

Still getting this error when using this OBS :/

Using driver 470. Nothing else running besides webcam and capture card.

guihkx commented 5 months ago

Can I have a look at your encoder settings in OBS? I'm pretty sure you'll have to turn off some options there for this to work. I should probably document this as well...

Yorisoft commented 5 months ago

What settings would you recommend changing?

Im outputting at 1080@60.

image

guihkx commented 5 months ago

Im outputting at 1080@60.

That's only the resolution, and it shouldn't matter much, I think.

Also, that screenshot seems to be from a much older version of OBS?

Anyway, I'm talking specifically about these options:

image

Try to match yours with these and try again. If that still doesn't work, please run OBS from the terminal, try to record/stream, and share the output here:

$ flatpak run com.obsproject.Studio
...
Yorisoft commented 5 months ago

You're right! Sorry about that, forgot I went live with another OBS

This is my settings for your project version: image

Going to try to match those settings now.

Yorisoft commented 5 months ago

It worked! Thanks a ton!!

I changed my setting to match those you showed and now it works as intended.

guihkx commented 5 months ago

Awesome! :)

I'll leave this open until I properly document this somewhere.

Yorisoft commented 5 months ago

Would there be any issues when using this with multi-rtmp?

My stream keeps crashing now but I cant tell whats the cause.

guihkx commented 5 months ago

Would there be any issues when using this with multi-rtmp?

I'm not sure, I never used that plugin.

Can you share the output from running OBS in the terminal? There might be something useful there.

Also, does it crash with local recordings?

Yorisoft commented 5 months ago

When using these plugins my workflow is, start streaming through OBS controls start multi streams through plugin controls Finally, stop main stream from obs controls

info: libfdk_aac encoder created
info: libfdk_aac bitrate: 320, channels: 2
info: Output 'Replay Buffer': stopping
info: Output 'Replay Buffer': Total frames output: 2
info: Output 'Replay Buffer': Total drawn frames: 11 (12 attempted)
info: Output 'Replay Buffer': Number of lagged frames due to rendering lag/stalls: 1 (8.3%)
info: ==== Replay Buffer Stop ============================================
info: libfdk_aac encoder destroyed
info: [rtmp stream: 'multi-output'] Connecting to RTMP URL rtmp://iad03.contribute.live-video.net/app/...
info: [rtmp stream: 'multi-output'] Connection to rtmp://iad03.contribute.live-video.net/app/ (52.223.224.170) successful
info: [rtmp stream: 'multi-output'] Connecting to RTMP URL rtmps://fa723fc1b171.global-contribute.live-video.net...
info: No application or playpath in URL!
info: [rtmp stream: 'multi-output'] Connection to rtmps://fa723fc1b171.global-contribute.live-video.net (52.223.224.100) successful
info: [rtmp stream: 'adv_stream'] User stopped the stream
info: Output 'adv_stream': stopping
info: Output 'adv_stream': Total frames output: 360
info: Output 'adv_stream': Total drawn frames: 548 (549 attempted)
info: Output 'adv_stream': Number of lagged frames due to rendering lag/stalls: 1 (0.2%)
info: ==== Streaming Stop ================================================
error: [NVIDIA NVENC H.264 (FFmpeg) encoder: 'advanced_video_stream'] Encoding queue duration surpassed 5 seconds, terminating encoder
error: Error encoding with encoder 'advanced_video_stream'
info: [rtmp stream: 'multi-output'] Encoder error, disconnecting
info: [rtmp stream: 'multi-output'] Encoder error, disconnecting
info: Output 'multi-output': stopping
info: Output 'multi-output': stopping
info: Output 'multi-output': Total frames output: 654
info: Output 'multi-output': Total frames output: 534
info: Output 'multi-output': Total drawn frames: 1062
info: Output 'multi-output': Total drawn frames: 913
error: [obs-multi-rtmp] Release output while it is active.
error: [obs-multi-rtmp] Release output while it is active.
info: ==== Streaming Stop ================================================
[aac @ 0x55fafdb37d00] Qavg: 64305.039
[aac @ 0x55fafdb37d00] 2 frames left in the queue on closing
info: Video stopped, number of skipped frames due to encoding lag: 772/904 (85.4%)
error: [NVIDIA NVENC H.264 (FFmpeg) encoder: 'vertical_canvas_video_encoder'] Encoding queue duration surpassed 5 seconds, terminating encoder
error: Error encoding with encoder 'vertical_canvas_video_encoder'
info: Output 'Vertical Backtrack': stopping
info: Output 'Vertical Backtrack': Total frames output: 894
info: Output 'Vertical Backtrack': Total drawn frames: 1196 (1197 attempted)
info: Output 'Vertical Backtrack': Number of lagged frames due to rendering lag/stalls: 1 (0.1%)
warning: [Vertical Canvas] record stop error -8
info: Video stopped, number of skipped frames due to encoding lag: 776/904 (85.8%)
info: libfdk_aac encoder destroyed
info: [source-switcher: 'Source Switcher'] transition to 'Sub Goal' using 'Transition' for 1000 ms, resize {800,600}
guihkx commented 5 months ago

Judging by the logs, and if I had to guess, I'd say you're suffering from VRAM exhaustion.

Are you streaming some type of heavy, 3D game?

Anyway, if you want to be sure that's the root cause of the problem, open NVIDIA X Server Settings, start recording on OBS, and monitor VRAM/Video Engine Utilization, i.e.:

image

If that's indeed the cause, I'm afraid you'll have to try t lower your encoder settings further.

Yorisoft commented 5 months ago

It doesnt look like the consumption is going past 65%

image

Yorisoft commented 5 months ago

I did lower the encoder settings. That seems to help but it didnt resolve completely. It lasted a few seconds longer but eventually also crashed.

image

guihkx commented 5 months ago

I see... What about Video Engine Utilization, though? In your screenshot it's already at 0%, which doesn't tell me much.

Start recording/streaming, and then immediately look at NVENC usage.

I'm guessing the encoder is bottle-necking at 100%, and then OBS stops the stream because many frames were lost.

Yorisoft commented 5 months ago

Yes, that seems to be the case

image

guihkx commented 5 months ago

Yeah, that's unfortunate.

It seems like your native screen resolution is way larger than 1920x1080 (perhaps 4K?), and so the encoder grabs the frame in the original resolution, and then downscales it to 1920x1080, which might be contributing to the bottleneck.

I'm not sure what would be the best option for you, but if you can, perhaps set your display's resolution to 1920x1080 when you're streaming/recording.

But we have to keep our expectancies in check, too. We're talking about a GPU from 2012 here... :P

guihkx commented 5 months ago

What if you didn't do any downscaling in OBS at all?

Wouldn't Twitch (and other streaming services) downscale it automatically to lower resolutions? That could reduce the bottleneck in the encoder, maybe.

Yorisoft commented 5 months ago

Just tried doing that. No luck.

Seems that the GPU can support multiple rtmp feeds but it cant handle the Vertical Canvas. It alone pushes the Video Engine Utilization to 95%.

guihkx commented 5 months ago

it cant handle the Vertical Canvas. It alone pushes the Video Engine Utilization to 95%.

Oh, damn. I don't know what that plugin does, but I assume it must be important for you.

Did it use to work just fine with previous versions of OBS on that same GPU?

Yorisoft commented 5 months ago

This Vertical Plugin allows you to create a Vertical Scene and Stream it to platforms at the same time you do your normal stream.

Tbh, Ive never got it working on this GPU. The OBS version that supports this plugin did not support dedicated encoding on my GPU so I stuck to OBS 27 and not use to plugin. But would love to.