MAPReiff / ShadowRePlay-Linux

Shadowplay's Replay Feature On Linux For Nvidia, AMD and Intel
MIT License
138 stars 7 forks source link

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

Open JustCryen opened 3 years ago

JustCryen commented 3 years ago

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 commented 2 years ago

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 commented 2 years ago

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:

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 commented 2 years ago

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