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.68k stars 7.81k forks source link

Properties for Video Capture Device dialog does not properly match to output frame rate, or allow choosing input frame rate or custom integer frame rate #7512

Open juj opened 1 year ago

juj commented 1 year ago

Operating System Info

Windows 10

Other OS

No response

OBS Studio Version

Other

OBS Studio Version (Other)

28.0.3 (64bit)

OBS Studio Log URL

N/A

OBS Studio Crash Log URL

No response

Expected Behavior

When user chooses a custom Integer FPS Value in the File->Settings->Video tab, e.g. in my case, I have set it to 70Hz:

image

and then goes to the Properties tab for a Video Capture Device Source, e.g. at

image

there is no possibility to select the same 70Hz as the capture frame rate as the project, or the source video. I use a FPGA based device to generate a 70hz input video capture signal for DOS gaming captures (DOS VGA 320x200 resolutions typically followed a 70hz video frame rate).

There is a setting Match Output FPS (autoselect: 60) which also looks a bit odd. I am having a hard time interpreting what "Output" here should refer to: should it be the project output? In my case that was set to 70 (as seen above), so if that is the case, the "autoselect: 60" seems to have gotten detected wrong.

Or I wonder if "Output" here intends to be referring to the Input video frame rate of the capture device? In my case, that should also be 70Hz since I am generating a VESA CVT standard 70hz HDMI signal using an FPGA.

I wonder if the "Match Output FPS" is being incorrectly calculated here? I would have expected to see this read 70Hz. There is no support for specifying a custom integer value here either, like there was in the File->Settings->Video tab.

Current Behavior

(please see above)

Steps to Reproduce

(please see above)

Anything else we should know?

No response

Fenrirthviti commented 1 year ago

The options exposed are what the device reports it supports. Other than some very obscure capture devices, I don't think 70hz is a commonly supported resolution, so it's likely that your capture device doesn't support it, but you opted not to include a log file with this report, despite the template requesting one so I am just guessing.

This sounds more likely to be a support request rather than a bug report, and we are not currently accepting support requests on GitHub Issues. Please use our forums or Discord for further assistance.

Thank you!

juj commented 1 year ago

The options exposed are what the device reports it supports.

Thanks, so all of those 60, 59.54 NTSC, 50, 48, 40, 30, 29.97 NTSC , 25, 24 Film, 20, 15, 10 and 5 fields are coming directly from the device driver of the capture device?

... , but you opted not to include a log file with this report, despite the template requesting one so I am just guessing.

Thanks, I did not think it was pertinent in this case, my apologies. That being said, the above sentence feels a bit passive aggressive. I am not an adversary but a friend, just trying to solve a problem. I appreciate the help!

The OBS log only reports the following about the video device:

11:18:10.137: [DShow Device: 'Video Capture Device'] settings updated: 
11:18:10.137:   video device: usb video
11:18:10.137:   video path: \\?\usb#vid_534d&pid_2109&mi_00#7&7db0a71&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
11:18:10.137:   resolution: 1600x1200
11:18:10.137:   flip: 0
11:18:10.137:   fps: 60.00 (interval: 166666)
11:18:10.137:   format: MJPEG
11:18:10.137:   buffering: disabled
11:18:10.137:   hardware decode: disabled

Other than some very obscure capture devices, I don't think 70hz is a commonly supported resolution

I agree that 70hz is rare. For digital signals I was hoping that some capture devices would support a direct capture of whatever data in whatever rate was provided (frame rate conversion being more work for the hardware than not doing any FRC or other processing).

If hardware or software is taking the magic 60Hz as a hardcoded assumption/cap, I was hoping I'd be able to at least capture 35hz, since many DOS games like Tyrian or DOOM cap their output to 35 Hz, i.e. a 70/2 frame rate decimation. Though there was no option to choose an integer/halve input by two rate, so targeting 35 Hz does not seem to be possible either.

I'll look into how different capture devices behave here, and if different devices might report different values.

WizardCM commented 1 year ago

OBS only exposes a set defined list of frame rates in the Video Capture Device Source, listed here:

https://github.com/obsproject/obs-studio/blob/77b11c16f1bb6a38abbc8e0e18308aa0c6466e41/plugins/win-dshow/win-dshow.cpp#L1309-L1327

I believe this list is matched against the supported frame rates of the device.

juj commented 1 year ago

Thanks for investigating! The above reads like even if there was a 70 Hz input signal (or some other uncommon number), the DirectShow code would not be prepared to process it?

I appreciate that one man's bug report reads as a feature request to another. I'll submit to your consideration to which way will be best to deal with this.

WizardCM commented 1 year ago

It's technically both, which makes this sort of thing tricky. I personally find it to be more of a bug report as I don't know exactly why we explicitly filter the list of frame rates.