obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
59.13k stars 7.86k forks source link

UHD output performance to UltraStudio 4K Mini is unusable on macOS Intel, perfect on M1 #7549

Open PhotoJoseph opened 1 year ago

PhotoJoseph commented 1 year ago

Operating System Info

macOS 12

Other OS

No response

OBS Studio Version

Other

OBS Studio Version (Other)

27

OBS Studio Log URL

https://obsproject.com/logs/9PmYBd-le9uIxrSR

OBS Studio Crash Log URL

No response

Expected Behavior

Smooth rendering of key/fill playback on output

Current Behavior

Stuttered output that drops in performance quickly. Set to 29.97 it's playing maybe 20 fps but quickly drops to 1 fps and lower.

Steps to Reproduce

  1. macOS 12.4 Intel Mac Pro, OBS 27.2.4
  2. install thunderbolt Blackmagic UltraStudio 4K Mini,
  3. Set OBS to 3840x2160 29.97 canvas and output, enable RGB in advanced settings
  4. enable keyed output for UltraStudio. Play something that has alpha channel, and motion
  5. Performance starts slow, and gets worse. Totally unusable.

Anything else we should know?

  1. Exact same setup (Intel Mac Pro) but using Decklink 8K card instead of UltraStudio works perfectly fine
  2. Exact same setup (UltraStudio 4K Mini) but using M1 MacBook Air instead of Mac Pro works perfectly fine
PatTheMav commented 1 year ago

Just to point out the inevitable: Given that reproducing this issue requires access to pretty expensive hardware, it might take some time before someone with the exact same setups available might be able to tackle this issue - hence there might be quite some inactivity before this might be fixed.

PhotoJoseph commented 1 year ago

Understood. I could potentially allow remote access to my system for testing if someone knows what to look for.

derrod commented 1 year ago

I believe @Fenrirthviti has both an UltraStudio 4K Mini and an Intel Mac (but no M1 machine).

Fenrirthviti commented 1 year ago

I do have the UltraStudio, but as mentioned, I only have access to an Intel mac at present.

PhotoJoseph commented 1 year ago

That is where the problem is; on Intel. It works fine on M1.

Fenrirthviti commented 1 year ago

I'm testing the other issue in the next week or so, so I'll run through this one at the same time.

polyh3dron commented 1 year ago

Can confirm this issue also exists in some form in Windows with the Ultrastudio 4K Mini. 1080p60 Decklink output works perfectly, but 2160p60 results in a garbled picture. Rolled all the way back to OBS 29.0.2 and the issue is still present.

polyh3dron commented 1 year ago

Approaching a year since this issue was introduced. Still no movement?

Fenrirthviti commented 1 year ago

Apologies, I thought I had provided an update but got pulled away on other issues and forgot about this.

I wasn't able to replicate this issue, but I also don't have enough understanding on what is actually expected to happen, or how to investigate further myself. I am either doing something wrong in the test that I don't understand, or am not experiencing this issue myself.

polyh3dron commented 1 year ago

Are you saying you are able to use the Decklink Output at 2160p60 with version 29.1.3? Version 28.1.2 technically "works" for me, albeit with an insane amount of encoding lag even though neither CPU or GPU are under full load. Version 29.1.3 outputs a corrupted image through the Decklink Output at 2160p60, although the encoding lag is no longer a problem. 1080p60 works fine. 2160p60 Decklink Output seems to have been broken after version 28. Every Decklink Output Mode up to 2kp60 DCI works, 2160p60 and 4kp60DCI output a corrupted image.

polyh3dron commented 1 year ago

Here's the image with the Decklink Output setting at 1080p60:

https://i.imgur.com/NeZEAwD.jpg

Here's the same image with the Decklink Output setting at 2160p60:

https://i.imgur.com/5w8xhkZ.jpg

Fenrirthviti commented 1 year ago

I've tested again, and I can't get 2160p60 to work in any version of OBS, it always shows a garbled output.

1080p60 appears to work ok.

My input source is a PS5, just for reference.

polyh3dron commented 1 year ago

I've tested again, and I can't get 2160p60 to work in any version of OBS, it always shows a garbled output.

1080p60 appears to work ok.

My input source is a PS5, just for reference.

Try rolling back to OBS 28.1.2. You should get a proper image, but also get crippling encoding lag.

polyh3dron commented 1 year ago

Now that we've confirmed this is a real issue, how do we get the necessary attention to get it fixed?

Fenrirthviti commented 1 year ago

As with anything, someone with the requisite experience and knowledge, time, and desire to work on it. Unfortunately, that is not me, as I don't have any experience with the DeckLink SDK or development in this space of the program.

polyh3dron commented 1 year ago

Apparently @DDRBoxman is the author of this part of OBS Studio. Tagging him here for some visibility.

polyh3dron commented 1 year ago

2160p60 Decklink Output with an Ultrastudio 4K Mini is still broken in OBS 30 Beta 1. Tagging @jpark37

DDRBoxman commented 1 year ago

I have an Intel Mac Pro but not a 4K studio mini so I can’t test this setup.

polyh3dron commented 1 year ago

I have an Intel Mac Pro but not a 4K studio mini so I can’t test this setup.

I've also repro'd this on a Windows PC. @Fenrirthviti has repro'd it as well as seen in the messages here.

kallegrabowski69 commented 12 months ago

I also have an Ultra Studio 4K Mini and cannot get it to output a 2160p60 signal. The display on the device shows a distorted image. 1080p60 works as mentioned before. I get the same result with a MacBook Pro M2 Pro, a Mac Studio M1 Max or a Lenovo Thinkpad X1 Carbon. The OBS versions I tried are 29.1 and 28.1. What can I do to help solve this issue?

P.S. I also tried a different software (Mimolive) with a similar result, so this might be connected to the BMD driver itself. Unfortunately I have tested a few driver versions but never had any success and since my Ultra Studio is rather new I have never seen a working combination that I can revert to.

miagg commented 6 months ago

Same issue here! I don't understand how it can work on other programs (like pro tools, premiere, Final Cut, etc.) and not on others. I can only guess OBS and other broken apps use an older BMD SDK version that did not support 2160p30 and above.

@polyh3dron seems totally weird to have it work on v28.1.2. Others including me had no luck with it.

miagg commented 6 months ago

Sadly OBS 30.1.0 does not include a fix. I'm pretty convinced the culprit is ffmpeg library which is used to output to decklink devices. Maybe different flags are needed to switch to quad link SDI (12G) or even a new binary?

DDRBoxman commented 6 months ago

Okay so this has turned into two issues, I'm making a new issue for the distorted image: https://github.com/obsproject/obs-studio/issues/10380

Performance issues should stay on this existing thread.

DDRBoxman commented 6 months ago

We're hitting a performance bottleneck here when we download the texture after the GPU scale which shows up with larger resolutions.

https://github.com/obsproject/obs-studio/blob/21f1c155ef33f176c4065868a6edc7951708ee49/UI/frontend-plugins/decklink-output-ui/decklink-ui-main.cpp#L420

DDRBoxman commented 6 months ago

I'm going to try to see if I can get some sort of texture ping pong setup working here so we aren't blocking on this call

DDRBoxman commented 6 months ago

We're already doing that, not sure why but the texture download off the GPU seems to be blocking when it should be async 🤔