Skip to content
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

High CPU usage, sped up video & additional ideas #14

Open
JustCryen opened this issue Sep 5, 2021 · 3 comments
Open

High CPU usage, sped up video & additional ideas #14

JustCryen opened this issue Sep 5, 2021 · 3 comments

Comments

@JustCryen
Copy link

So first of all thank you for your work, I really appreciate it.

High CPU usage and sped up video

I installed the package from AUR on Archlinux system and after trying it out I experienced high cpu usage.
The process was using 100% of one cpu core and it was switching periodically between cores.
Furthermore the video was sped up and because of this it was desyncing from the audio.

Feature ideas

It would be great if the program could record Mic audio and System audio to separate audio tracks.

If I may suggest something for the high cpu usage, I use Nvidia GPU with NvFBC patched driver.
https://github.com/keylase/nvidia-patch
This is what nvidia actually uses for shadowplay on Windows.
It allows for screen recording with low resource usage, I tested this with OBS and it works great.
If you could add support for this patch it would greatly improve performance.

System info

OS: Archlinux
Kernel: linux-zen 5.13.13.zen1-1
Nvidia driver: nvidia-dkms 470.63.01-1
DM: gnome-shell 1:40.4-1

@GhostDog98
Copy link
Contributor

GhostDog98 commented Jan 12, 2022

The first idea should be possible with a simple change to the ffmpeg options, I'll see if my pull request goes through without throwing errors on others machines, and if so you should be able to fix this through the configuration file. I'll look into the second suggestion too if I have time 👍

@atagen
Copy link

atagen commented Jan 17, 2022

I have also experienced gradually sped up video, significant desyncs, etc with the script. I have experimented a fair bit around this and not come up with a solution. I don't think it will really amount to much, but could I ask what refresh rate and fps you're using?

recording mic and system audio: ffmpeg is capable, but it would be a config issue. pulling system audio is "obvious" since it should always have the same source, but mics are a wild west and would need manual config - which in turn either requires a config file or GUI. there's not really a simple default you can pick that is sane. @GhostDog98's PR could help in this regard, but users still need to learn some ffmpeg syntax, and adjust it if their peripherals change.

cpu use: you can just use normal NVENC without any driver patching. you need to change the codec options in the script, see my fork.

FBC: interesting, reduces the amount of handling, switching to a less scuffed capture method could help the aforementioned sync issues with x11grab too, but two issues:

  • first, the only OBS NvFBC patch I can find compiles directly against NvFBC/openGL/OBS headers without touching ffmpeg whatsoever. from a quick skim it looks like OBS is basically "blind" and simply gives a texture to be filled with this code bridging the NvFBC gap to do so. this makes the code useful for seeing how we interact with NvFBC, but provides nothing useful in terms of integrating for ffmpeg.

  • second, even if there were a working version of this patch, we're poking at what amounts to a clever bit of shell scripting. recompiling/custom patching ffmpeg is a reasonably large undertaking in comparison, and in combination with a driver patch would make the project's footprint absolutely massive.

I wouldn't be shocked if there were plenty of people who would be happy to use such a thing (after all, we have linux-tkg and all sorts of other hefty custom gamer stuff), but such undertakings are probably grounds for a new project.

to be clear - I don't speak for the maintainers, but there's no replies from them in 5 months or repo activity in 2 years, so make of that what you will.

@JustCryen
Copy link
Author

could I ask what refresh rate and fps you're using?

Ohh, I can't really remember, it was a long time ago.
My monitor has the refresh rate of 120 Hz but since I remember using my external display it was probably set to 60Hz.
xrandr actually shows it as 60.01 or 60.06 for internal display (primary) and around 58 for external (secondary).
And it was dual monitor setup.

About the fps, I've found the video I tested it with so I'll list all its important specs:
Dimensions: 3440 × 2520
(that's because integrated display is 1920 x 1080 and the external 3440 x 1440, configuration is 21:9 on top and 16:9 on the bottom. The program just recorded them both.)
Codec: H.264 (High Profile)
Frame rate: 60.00 fps
Bit rate: 5281 kbps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants