rdp / screen-capture-recorder-to-video-windows-free

a free open source windows "screen capture" device and recorder (also allows VLC/ffmpeg and others to capture/stream desktop/audio)
https://github.com/rdp/screen-capture-recorder-to-video-windows-free/releases
Other
2.11k stars 463 forks source link

"hwnd_to_track" shows black borders #62

Open leif81 opened 9 years ago

leif81 commented 9 years ago

When I use the hwnd_to_track registry setting my video appears in the top left corner of the frame and the rest of the frame is filled with big black borders (the bottom and right sides).

leif81 commented 9 years ago

I noticed that a workaround is to also set capture_width and capture_height in the registry.

I was surprised those weren't being auto discovered from the window handle. In fact PushSourceDesktop.cpp appears to be doing just that already:

https://github.com/rdp/screen-capture-recorder-to-video-windows-free/blob/9e766b414e20084230d1ff0586ce4fdb97d39292/source_code/PushSourceDesktop.cpp#L425

GetClientRect(m_iHwndToTrack, &p); // 0.005 ms

nWidth = min(p.right-p.left, nWidth); nHeight = min(p.bottom-p.top, nHeight);

Perhaps those nWidth and nHeight values need to be reused elsewhere too in place of capture_width and capture_height too?

rdp commented 9 years ago

It uses size 0 by default?

On Thu, Jun 4, 2015 at 12:22 PM, Leif Gruenwoldt notifications@github.com wrote:

I noticed that I have to also set capture_width and capture_height in the registry.

I was surprised those weren't being auto discovered from the window handle. In fact PushSourceDesktop.cpp appears to be figuring out the width and height for me from the window handle already:

https://github.com/rdp/screen-capture-recorder-to-video-windows-free/blob/9e766b414e20084230d1ff0586ce4fdb97d39292/source_code/PushSourceDesktop.cpp#L425

GetClientRect(m_iHwndToTrack, &p); // 0.005 ms

nWidth = min(p.right-p.left, nWidth); nHeight = min(p.bottom-p.top, nHeight);

Perhaps those nWidth and nHeight values need to be reused in place of capture_width and capture_height too?

— Reply to this email directly or view it on GitHub https://github.com/rdp/screen-capture-recorder-to-video-windows-free/issues/62#issuecomment-108998084 .

leif81 commented 9 years ago

Yacapture_width and capture_height are 0 by default.

https://github.com/rdp/screen-capture-recorder-to-video-windows-free/blob/9e766b414e20084230d1ff0586ce4fdb97d39292/source_code/PushSourceDesktop.cpp#L80

Just below that the code is implying that if the config_width and config_height are not greater than 0 then // leave fullscreen. Is that the problem? It seems like the width and height there should be getting set to the actual window size if hwnd_to_track is turned on?