yuka-friends / Windrecorder

Windrecorder is a memory search app by records everything on your screen in small size, to let you rewind what you have seen, query through OCR text or image description, and get activity statistics.
GNU General Public License v2.0
2.7k stars 110 forks source link

Automatic Flexible Screenshots Mode does not work | 自动灵活截图模式无法运行 #190

Closed RTLiang closed 1 week ago

RTLiang commented 1 week ago

0.015版本升级到0.0.16版本,自动灵活截图模式无法运行,原因未知。 看了下代码,截下来的图片应该存在cache_screenshot里面,但是此处没有图片。也不知道怎么调试,要不出一个调试的教程? image ENGLISH TRANSLATION I updated to 0.0.16 from 0.0.15, but I have no idea why the Automatic Flexible Screenshots mode does not work. I think these screenshots are supposed to be in cache_screenshot directory, but there is no files. I don't know how to debug, can we get a tutorial about debugging?

Antonoko commented 1 week ago

感谢反馈!你可以这样进行手动测试该模块是否起作用:

  1. 在根目录下创建 test.py 文件,内容如下:
    
    from windrecorder.record import record_screen_via_screenshot_process

record_screen_via_screenshot_process()


2. 在根目录下新建一个名字为`DEBUGMODE.txt`的空文件(测试完毕后请记得删除,以避免过多的日记记录 IO
3. 在根目录下执行以下命令:
    1. `poetry shell`
    2. `python test.py`
    这样就单独启动了一段自动灵活截图录制过程,你可以切换几个窗口、进行一些浏览操作,然后在命令行中观察录制过程,并进行反馈。如果运作正常,将会在 cache_screenshot 目录下有新增的截图文件。
RTLiang commented 1 week ago

日志是这样的,因为capture screenshot error: object of type 'int' has no len()这个error无法截图,python版本是3.11.7

(windrecorder-py3.11) PS > python test.py
No conda env active, defaulting to base
2024-06-27 11:48:58,393 - [file_utils.py:47] - ensure_dir - DEBUG - files: folder existed:userdata\db
2024-06-27 11:48:58,393 - [db_manager.py:45] - db_main_initialize - INFO - Initialize the database...
2024-06-27 11:48:58,397 - [db_manager.py:88] - db_initialize - INFO - db existed and not empty
2024-06-27 11:48:58,397 - [db_manager.py:111] - db_ensure_row_exist - DEBUG - Column win_title already exists in video_text.
2024-06-27 11:48:58,401 - [db_manager.py:111] - db_ensure_row_exist - DEBUG - Column win_title already exists in video_text.
2024-06-27 11:48:58,401 - [db_manager.py:111] - db_ensure_row_exist - DEBUG - Column win_title already exists in video_text.
2024-06-27 11:48:59,487 - [record.py:427] - record_screen_via_screenshot_process - DEBUG - config.record_seconds=900
2024-06-27 11:49:02,491 - [record.py:434] - record_screen_via_screenshot_process - DEBUG - time_counter=3, sleep_time_second=3.0
2024-06-27 11:49:03,095 - [record.py:470] - record_screen_via_screenshot_process - DEBUG - capture_single_display_window
2024-06-27 11:49:03,095 - [record.py:476] - record_screen_via_screenshot_process - ERROR - capture screenshot error: object of type 'int' has no len()
2024-06-27 11:49:05,495 - [record.py:434] - record_screen_via_screenshot_process - DEBUG - time_counter=6, sleep_time_second=2.3959927558898926
2024-06-27 11:49:06,103 - [record.py:470] - record_screen_via_screenshot_process - DEBUG - capture_single_display_window
2024-06-27 11:49:06,103 - [record.py:476] - record_screen_via_screenshot_process - ERROR - capture screenshot error: object of type 'int' has no len()
2024-06-27 11:49:08,495 - [record.py:434] - record_screen_via_screenshot_process - DEBUG - time_counter=9, sleep_time_second=2.388575315475464
2024-06-27 11:49:09,142 - [record.py:470] - record_screen_via_screenshot_process - DEBUG - capture_single_display_window
2024-06-27 11:49:09,142 - [record.py:476] - record_screen_via_screenshot_process - ERROR - capture screenshot error: object of type 'int' has no len()
2024-06-27 11:49:11,497 - [record.py:434] - record_screen_via_screenshot_process - DEBUG - time_counter=12, sleep_time_second=2.3537983894348145
2024-06-27 11:49:12,109 - [record.py:470] - record_screen_via_screenshot_process - DEBUG - capture_single_display_window
2024-06-27 11:49:12,113 - [record.py:476] - record_screen_via_screenshot_process - ERROR - capture screenshot error: object of type 'int' has no len()
Antonoko commented 1 week ago

感谢测试与反馈!已修复这个低级错误,请更新后再试试 TvT

RTLiang commented 1 week ago

可以正常运行了,谢谢☺️❤️❤️