colinkeenan / silentcast

Create silent mkv screencast and animated gif.
GNU General Public License v3.0
512 stars 22 forks source link

4k Screen #48

Open sosukeinu opened 6 years ago

sosukeinu commented 6 years ago

great little tool. the only issue i'm seeing is that the box i draw on the screen does not accurately reflect the area being recorded when I'm using a 4k screen. Any idea how to remedy something like this? Thank you for your time.

colinkeenan commented 6 years ago

I don't expect to be able to look into this, but I will let you know if I do and discover something.

sosukeinu commented 6 years ago

thank you for your response. Could you recommend a debugging method, or path that I could follow to perhaps look into this further? Either way, I appreciate your time and the application.

colinkeenan commented 6 years ago

At the moment, it's not even working properly on my machine since it's confining itself to a 100x100 pixel area in the upper left corner. I will have to work on this again to fix it for my computer and that will remind me all that's going on so I can advise you how to debug it.

Off the top of my head, I would look at the numbers displayed around the rectangle and see if they get into the ffmpeg command that you can see by pressing F3. If those are the same, I don't know why it wouldn't record the same area shown by the green rectangle. You could also see if those numbers make sense as you move the rectangle around and increase it etc. Also, see if there's some sort of scaling needed - maybe they are off by some factor. I mean, see what doubling the coordinates does and try other factors.

colinkeenan commented 6 years ago

Actually, it's still working on my machine for most ways of launching it, but not for one particular way. This may not be a new bug and it's not one that anyone else noticed. Eventually I will work on it, but for your issue, let me know if you get anything from looking at the coordinates shown around the green rectangle and in the ffmpeg command shown by hitting F3.

You can find the coordinates of the active window using other tools and compare when the green rectangle is surrounding the active window. Is the top left corner correct or off by some factor? What about the width and height?

One way to get the coordinates of the active window is to use the method used by my older version of Silentcast which was bash based instead of written in C. It used various command line tools to get the information.

I don't have a lot of time right now, but my answer (or other answers) to this question will help you get the coordinates of the active window by other means: https://unix.stackexchange.com/questions/14159/how-do-i-find-the-window-dimensions-and-position-accurately-including-decoration

colinkeenan commented 6 years ago

Did you try my suggestions? What did you discover? If I know the answers to these questions, I could point you to what part of the code to look at or what else to try:

  1. Do the x,y and size coordinates shown outside the green box match what's in the ffmpeg command shown when you press F3?
  2. When the green box surrounds an active window (as it does by default on startup), do the x,y and size coordinates shown match what you find using other tools as suggested in https://unix.stackexchange.com/questions/14159/how-do-i-find-the-window-dimensions-and-position-accurately-including-decoration?
  3. If they don't match, can you just scale the numbers by some factor (like 2) in order to get them to match?
  4. If everything matches but it's still recording the wrong part of the screen, have you tried copy and pasting the ffmpeg command shown with F3 into a terminal and playing with the numbers until you are recording the correct area?
  5. After getting the correct area to record, what is the relationship between the correct coordinates and those shown by Silentcast/other applications?
sosukeinu commented 6 years ago

I'm sorry, I was finishing up some projects this week. I will try these suggestions and get back to you with the results on Monday. Thank you for your help.