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

Gdigrab Screen Capture Issue With Scaled Display #1071

Open
nodminger opened this issue Feb 22, 2024 · 2 comments
Open

Gdigrab Screen Capture Issue With Scaled Display #1071

nodminger opened this issue Feb 22, 2024 · 2 comments
Labels

Comments

@nodminger
Copy link

I have two displays and wanted to capture both the display and stream them using FFMpegFileAndDeviceTest Source code. When I run this raw ffmpeg command ffmpeg -f gdigrab -offset_x 0 -offset_y 0 -video_size 1920x1722 -i desktop output.mp4 I am able to capture a video. But when I use the same attributes (offset_x: 0, offset_y: 0, video_size: 1920x1722, i(path): desktop) in Sipsorcery by modifying this line videoSource = new SIPSorceryMedia.FFmpeg.FFmpegScreenSource("desktop", new System.Drawing.Rectangle(0, 0, 1920, 1722), 10); I get this error
image

why does the total height reduces. This only happens when the screen is scaled. But even then, with raw ffmpeg command I am able to capture the stream. Only when I use FFMpeg from Sipsorcery, this issue arises.

My Two Displays:
1: 1920x954 : 100% Scaled
2: 1024x768 : 125% Scaled

When I use FFMpeg directly i get the height as 1722.
image

@ChristopheI
Copy link
Collaborator

This use case (broadcast 2 screens in same time) was not targeted.
Don't hesitate to create a PR :)

@nodminger
Copy link
Author

I attempted to share my second screen alone, and that's when I encountered this issue. After checking further, I discovered that FFMpeg v4 exhibits this problem by default. Even when I executed this raw code, ffmpeg -f gdigrab -offset_x 0 -offset_y 0 -video_size 1920x1722 -i desktop output.mp4, the error persisted. But, with FFMpeg v6, I no longer encounter this error using the same raw command (though the issue still persists in Sipsorcery). So, I believe this issue is related to FFMpeg.Autogen or SipsorceryMedia.FFMpeg.

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

No branches or pull requests

2 participants