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
58.91k stars 7.84k forks source link

Missing RGB24 video format/low FPS on XRGB. #4176

Open wow-rambler-project opened 3 years ago

wow-rambler-project commented 3 years ago

Platform

Operating system and version: Windows 10 Pro 20H2 19042.746 OBS Studio version: 26.1.1 2021-01-30 16-53-35.txt

AverMedia CL511HN frame grabber.

Two machines:

  1. Ryzen 5900X, 32GB RAM, RTX 3090, NVMe SSD.
  2. i5 9400F, 8GB RAM, RTX 3060 Ti, NVMe SSD.

Expected Behavior

RGB24 should be available on the frame grabber's video format list. Alternatively, XRGB video format provides 60 FPS.

Current Behavior

Available options: ARGB, XRGB. Using XRGB video format causes FPS drop to 48 instead of requested 60.

Steps to Reproduce

  1. Go to "Video Capture Device" properties.
  2. Select "XRGB" as video format.
  3. Observe FPS drop on both preview and recordings.

Additional information

Also tested with XSplit where RGB24 mode worked well at 60 FPS.

An example log attached.

Snuggle commented 3 years ago

I'm having a very similar issue. When I have my video format set to YUYV 4:2:2 on Linux, I get a max of 5 FPS and OBS changes the framerate shown in v4l2-ctl to 5 FPS as well.

image image

v4l2-ctl-yuyv.txt

As soon as I switch to any other video format such as BGR3 (Emulated), I have all my framerate options. image image

v4l2-ctl-brg3.txt

OBS Log - 2021-02-02 18-45-27.txt

derrod commented 3 years ago

That's an unrelated issue. You're using some USB 2.0 device that simply can't push more than 5 FPS of uncompressed video. It will use MJPEG for anything higher but if that's not an option in OBS then I guess our v4l2 source doesn't support that. Using the emulated modes should be fine though.

derrod commented 3 years ago

As far as the issue at hand is concerned, I guess that it might be due to XRGB corresponding to RGB32, and PCIe 2.0 x4 is probably just not enough bandwidth to actually transfer a 2160p60 stream with 32 bits per pixel. I don't have that device on hand so it's hard to test, but I imagine that adding a mode that uses RGB24 internally is probably not too difficult.

Snuggle commented 3 years ago

Ah, that makes a lot of sense and also explains why it worked fine in guvcview, it was setting the format to MJPEG. Thank you, @derrod.

wow-rambler-project commented 3 years ago

As far as the issue at hand is concerned, I guess that it might be due to XRGB corresponding to RGB32, and PCIe 2.0 x4 is probably just not enough bandwidth to actually transfer a 2160p60 stream with 32 bits per pixel. I don't have that device on hand so it's hard to test, but I imagine that adding a mode that uses RGB24 internally is probably not too difficult.

I have similar thoughts. Though PCIe 2.0 x4 is capable of transferring 2 GB/s. An 3840x2160 image at 60 FPS is exactly 15,925,248,000 bits per second. So barely below the limit. Nevertheless, it is suspicious as 48 FPS is a "nice looking" number.

As for the solution - I found an old PR which has added BGR3 support. Does not look too complicated. Though I am not familiar with the code base and I might be quite wrong in my assessment.

EtherealAO commented 2 years ago

Same problem with avermedia GC573 on OBS 27.2.3, recording's framerate was obviously lower than nv12.