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

Unable to record vertical displays (black screen) #23

Open
ain-cinematronic opened this issue May 25, 2023 · 7 comments
Open

Unable to record vertical displays (black screen) #23

ain-cinematronic opened this issue May 25, 2023 · 7 comments

Comments

@ain-cinematronic
Copy link

Hi,

When trying to record a vertical display, the output video file is completely black.

I also do not get any errors or message out of the ordinary in the log.

Do you know what causes this issues and how I could solve it?

@Andrey1994
Copy link
Owner

Is it ok for horizontal displays on the same system?

@ain-cinematronic
Copy link
Author

Hi Andrey, thank you for the reply

Yes, horizontal screen works perfectly (in fact, love the library btw, by far the best I could find with a python wrapper)

It is just when the display is set to portrait in Windows that the resulting screen is black.

I have a suspicion that the issue might be related to how the screen size is passed. When the screen is in portrait orientation, the width and height values are effectively swapped compared to a landscape orientation. I suspect this might be causing some confusion or conflict within the library's functionality.

What do you think?

@Andrey1994
Copy link
Owner

I will take a closer look at the source code this weekend, is it only for video or screenshots also?

@ain-cinematronic
Copy link
Author

ain-cinematronic commented May 25, 2023

Taking a screenshot also produces a black image in portrait mode.

I have briefly tried a fork of your project by PatrykTokarczyk
(https://github.com/PatrykTokarczyk/screen_recorder_sdk.git)

who seems to have implemented a way to capture a portion of the screen (therefore allowing to set a height and width value)

With his fork, I also get a black screen normally, unless I choose to capture a "portion" of the screen and setting the width and height of the display in portrait mode.

Here is a code snippet:

        srcRight = 3840  # height
        srcBottom = 2160 # width
        
        screen_recorder.start_crop_video_recording(path_to_save, self.frame_rate, self.bitrate, self.hardware_acceleration_supported, srcLeft, srcTop, srcRight, srcBottom)

This way, it correctly captures a portrait video too.

I hope this finding helps! :)

EDIT: I would like to add further details after trying the fork of PatrykTokarczyk. Strangely enough, when I run a scan of the dll file from PatrykTokarczyk's repository with VirusTotal, it gets 1/69 virus warnings (which is most likely a false positive).

However, the dll from your repository provide give 0 warnings (which is great), which makes me wonder whether PatrykTokarczyk's approach triggers a false positive.

I just wanted to also share this information in case it is useful.

@ain-cinematronic
Copy link
Author

Hey Andrey, have you found anything new about this bug by any chance?

@Andrey1994
Copy link
Owner

Hi, I can reproduce it but I have not found the issue yet, and its a little bit hard to debug for me since I have no external monitor to test

@Andrey1994
Copy link
Owner

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