rticau / ScreenCapLibrary

Robot Framework test library for capturing screenshots and video recording.
Apache License 2.0
40 stars 15 forks source link

can't see the mouse cursor during the video recording #50

Closed davesliu closed 3 years ago

davesliu commented 4 years ago

Hello

With the start_video_recording stop_video_recording keywords. We can get the video recording for the screen. As there are some mouse clicking operation during that period. I didn't see the mouse cursor in the video. Is it a bug? How can I capture the mouse cursor movement and clicking operation in the video?

Thanks

davesliu commented 4 years ago

I look through the code of start video recording function, it seems that opencv can not capture the mouse cursor. As we can know the position of cursor with pyautogui api so is it possible to synthesize a cursor at the mous position in the video?

@mihaiparvu

mihaiparvu commented 4 years ago

ScreenCapLibrary uses python-mss and pygtk as backends for screen capturing. pygtk might be possible to be configured to display the cursor, have to study a bit the problem, but mss, which is the default one, doesn't look like it. opencv, in this library, is used only for combining the captures together to create the video, it takes no part in recording the screen or on mouse cursor.

This is a complex feature and unfortunately will not be included in version 1.4.0. However, we are open to contributions and if you're interested in implementing a feature like this, feel free to submit a pull request.

davesliu commented 4 years ago

@mihaiparvu Thanks for you detail comments. I will try to synthesize a mouse pointer in the snapshots

davesliu commented 4 years ago

@mihaiparvu I saw another tool pyScreenCapture can include the cursor by pasting a cursor image in the snapshot. https://github.com/swharden/pyScreenCapture/blob/master/go.py

But it doesn't use mss

cristii006 commented 3 years ago

Implemented via https://github.com/mihaiparvu/ScreenCapLibrary/commit/6f548c5b877f793e70837b9ed9019e3760efa6bf and https://github.com/mihaiparvu/ScreenCapLibrary/commit/b1d929917676b836c6bec7d6a657b6d465fbe3cf.