-
-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
obs-ffmpeg: Linux NVENC texture encoder #10133
Conversation
ddfba60
to
09f93f4
Compare
Does it have av1? |
867e42f
to
88b01a6
Compare
Short AV1 clip recorded using the Flatpak build on openSUSE with the new texture sharing encoder: control_nvenc_av1.mp4 |
68fdadf
to
3ab4df1
Compare
With #8312 merged I'll take this out of draft. It works and the PR can now be reviewed independently. |
3ab4df1
to
98a52ef
Compare
Fallback encoders dont appear to be private and can be seen in the options, also the default encoder doesnt fallback and just fails with an error when using the wrong gpu. (couldnt actually get obs to load on the gpu atm so ill test the working path later). |
Yep, I haven't implemented an automatic fallback yet so I left the non-texture encoders visible. Gotta figure out how to determine if OBS and the CUDA context run on the same GPU. |
98a52ef
to
739388b
Compare
Updated with a commit adding a check on startup to see if mapping an OpenGL texture created by the OBS graphics context succeeds on any CUDA device. If not, only fallback encoders will be supported, otherwise the CUDA device where mapping succeeded will be used when starting a texture encoder. This also hides the fallback encoders by default on Linux as well. |
f614193
to
b99a1b3
Compare
b99a1b3
to
a5d154a
Compare
31363d8
to
6e1f0e5
Compare
38593ed
to
840c342
Compare
823fb04
to
f758db4
Compare
f758db4
to
79e8e5a
Compare
79e8e5a
to
701ba0b
Compare
Did some more testing, this time with recording. There is a noticeable change in the bitrates used. I set up OBS with and without this patch the same way and used a VLC source with the same lossless video playing for reproducible input For example when recording NVENC H264 in Simple Mode / "High Quality, Medium File Size"... Same with HEVC ~ 75 % increase in file size Also in "Advanced" Output Mode with same CQP Levels Didn't really expect that, not sure if this is supposed to happen or a bug |
The encoder implementations are different, but nothing should have been touched in relation to the bitrate regulation. That's likely just a pre-existing difference between the ffmpeg and texture encoders. In order to get useful results, this texture encoder PR must be tested against the current texture encoder available on Windows. |
@Bleuzen Could you provide details about each of the resulting files, for example using a tool like "mediainfo"? I wonder if there are unintended technical differences like e.g. chroma subsampling (4:2:0 vs. 4:4:4). |
Applied on top of 30.1.0 and it works fine for me. I can record AV1 with NVENC and it's fast too! Now if we only had CQ support instead of CQP, that would make OBS the perfect capture tool for image quality. |
I was curious and compared stock OBS 30.1 under Linux, stock 30.1 under Windows, and 30.1 + texture encoder under Linux (H.264, CQP 20, with as similar settings as possible). The resulting file sizes were: Stock 30.1 Linux: 109.1 MiB So there seems to be a difference before and after the patch under Linux, but the larger file size is actually comparable to what the Windows version already produces. (As far as I could tell, the metadata of all videos is identical by the way, except for the video bitrates.) |
I'm not sure if there are any differences with CQP handling in FFmpeg vs OBS, but I also don't think that's worth investigating/worrying about at this time. For now we don't want to break anything on the Windows side, but this PR is a stepping stone to a larger rework that may change things. |
701ba0b
to
9726308
Compare
9726308
to
989af07
Compare
Description
WIP NVENC texture encoder for Linux, based on software encoder introduced in #10122 and OpenGL texture encoding libobs changes in #8312.
This PR really is just the last commit.
Superseedes/closes #4974
Motivation and Context
Gotta go fast.
How Has This Been Tested?
OBS Flatpak on openSUSE Tumbleweed with NVIDIA 545 drivers.
Types of changes
Checklist: