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.91k stars 126 forks source link

视频文件损坏导致压缩操作异常退出 #142

Closed shellj closed 6 months ago

shellj commented 6 months ago

最近发现产生的视频一直没有压缩,看了日志发现是某个视频文件损坏导致程序执行到这里退出了,损坏的视频不知如何产生的。

2024-03-26 13:29:42,721 - [ocr_manager.py:533] - compress_outdated_videofiles - INFO - compressing userdata\videos\2024-03\2024-03-12_13-29-58-OCRED.mp4, video_process_count=0, video_queue_batch=50
2024-03-26 13:29:42,771 - [record_screen.py:96] - idle_maintain_process_main - ERROR - Error on idle maintain: Command 'ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=p=0 userdata\videos\2024-03\2024-03-12_13-29-58-OCRED.mp4' returned non-zero exit status 1.

执行 ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=p=0 userdata\videos\2024-03\2024-03-12_13-29-58-OCRED.mp4 是下面这个错误:

[mov,mp4,m4a,3gp,3g2,mj2 @ 0000019230390d40] moov atom not found
userdata\videos\2024-03\2024-03-12_13-29-58-OCRED.mp4: Invalid data found when processing input

是否可以在这里对单个文件增加异常处理,不影响整个循环。 https://github.com/yuka-friends/Windrecorder/blob/9cc581328ce0ab8e11de8c2a3f246f044276a00b/windrecorder/ocr_manager.py#L531-L538

Antonoko commented 6 months ago

感谢反馈和提供详细的改进思路!已进行修复🧡