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

ddagrab stuttering and cursor issues #347

Closed
Sean-Zeo opened this issue Mar 12, 2024 · 11 comments
Closed

ddagrab stuttering and cursor issues #347

Sean-Zeo opened this issue Mar 12, 2024 · 11 comments

Comments

@Sean-Zeo
Copy link

Hi, it seems ddagrab is currently broken in the latest builds.
The cursor causes a tail effect and the frame rate skips/jumbles.

@BtbN
Copy link
Owner

BtbN commented Mar 12, 2024

Works fine for me on latest win64 build.
Make sure your graphics driver is in working condition.

@Sean-Zeo
Copy link
Author

Hi, same issue. Latest drivers for intel XE graphics.
It also has the same issue on a cloud A4000 nvidia GPU PC.

output.mp4

@BtbN
Copy link
Owner

BtbN commented Mar 12, 2024

I have just tested it, and it works perfectly for me. So I'm not sure what to tell you or what I should do about it.

@Sean-Zeo
Copy link
Author

Hi, even this sample command causes such an issue;

ffmpeg -filter_complex ddagrab=output_idx=0:framerate=60,hwdownload,format=bgra -c:v libx264 -crf 18 output.mp4

@BtbN
Copy link
Owner

BtbN commented Mar 12, 2024

Your command also works perfectly fine for me, and produces clean and intact output.
This looks much more like some weird driver side issue than anything related to FFmpeg, let alone these specific builds of it.

@Sean-Zeo
Copy link
Author

Hi, even software encoding, it does not work (no drivers required), same issue.
I've tested on several machines with latest Windows 10, same issue.

@BtbN
Copy link
Owner

BtbN commented Mar 13, 2024

ddagrab is quite low level and directly interfaces with the graphics driver.
It works perfectly for me on both Nvidia and Intel Iris Xe, so my suspicion is that it's some bug in older Intel GPU drivers or something.

It's probably fallout from FFmpeg/FFmpeg@21c6d12 but without that patch capturing is completely broken in different ways.
The patch still looks correct to me, and it's likely a driver bug where it does not honor the correct order of operations for some reason.

@Sean-Zeo
Copy link
Author

Hi, as I said before, this issue is occurring on both an Intel Iris XE machine as well as a separate RTX 4000 machine. The issue also occurs when using software encoding.
So I don't think this is driver related at all.

@BtbN
Copy link
Owner

BtbN commented Mar 13, 2024

The encoder is not involved in this, so not sure why you keep bringing it up.
ddagrab always interfaces with the graphics driver.

And like I said before, I am completely unable to reproduce this on both an Nvidia and an Intel machine.

@BtbN
Copy link
Owner

BtbN commented Mar 13, 2024

Can you run a debugger on this? Since I can't reproduce this, I have no chance of fixing it otherwise.

Run ffmpeg like this:
./ffmpeg.exe -v debug -init_hw_device d3d11va=dbgdev:-1,debug=1 -filter_hw_device dbgdev -filter_complex ddagrab=0:framerate=60 -c:v hevc_nvenc -preset slow -cq:v 20 -y out.mp4

The output side doesn't matter, feel free to replace nvenc with x264 or whatever.

Run https://learn.microsoft.com/en-us/sysinternals/downloads/debugview before and while invoking ffmpeg like that. It should capture any D3D11 debug messages from ffmpeg, hopefully giving an explanation for this.
For me it comes up completely empty outside of a bit of noise on shutdown.

For this to work, you need to have the d3d11 debug layers installed.
You can check by running where.exe d3d11_1sdklayers.dll. It it's missing, you might have to install the "Graphical Tools" Optional Feature, or the full on D3D SDK.

@BtbN
Copy link
Owner

BtbN commented Mar 15, 2024

After quite a wild chase for this, we finally found the root cause and fixed it in FFmpeg/FFmpeg@b47abd5
I still don't fully understand why these flags are different per system or screen. But they are. And depending on what they are, it can break in multiple ways.

@BtbN BtbN closed this as completed Mar 15, 2024
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

2 participants