YaoFANGUK / video-subtitle-remover

基于AI的图片/视频硬字幕去除、文本水印去除,无损分辨率生成去字幕、去水印后的图片/视频文件。无需申请第三方API,本地实现。AI-based tool for removing hard-coded subtitles and text-like watermarks from videos or Pictures.
Apache License 2.0
3.25k stars 431 forks source link

无法检测单张图片 #39

Open goddesssusu opened 4 months ago

goddesssusu commented 4 months ago

检测单张图片时报错: [ERROR:0@0.007] global cap_ffmpeg_impl.hpp:1237 open Could not find decoder for codec_id=61 [ERROR:0@0.007] global cap_ffmpeg_impl.hpp:1286 open VIDEOIO/FFMPEG: Failed to initialize VideoCapture [ERROR:0@2.440] global cap.cpp:166 cv::VideoCapture::open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.8.1) D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): img.png in function 'cv::icvExtractPattern'

use GPU for acceleration Subtitle Removing: 0frame [00:00, ?frame/s][ERROR:0@2.588] global cap_ffmpeg_impl.hpp:1237 open Could not find decoder for codec_id=61 [ERROR:0@2.588] global cap_ffmpeg_impl.hpp:1286 open VIDEOIO/FFMPEG: Failed to initialize VideoCapture [ERROR:0@4.956] global cap.cpp:166 cv::VideoCapture::open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.8.1) D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): img.png in function 'cv::icvExtractPattern'

seriable commented 4 months ago

这个需要改检测存在水印或者字幕得位置得算法,目前用得是videoCapture,这个是读取视频得方法,不太兼容单张图片得,需要调整成兼容单张图片得方法,这个估计要等到大佬来调整了

YaoFANGUK commented 4 months ago

我测试是可以的啊

seriable commented 4 months ago

我测试是可以的啊

您测试目录下的图片,我测试过了,是可以得,我适当调整了部分代码,发现我从网上爬得图片,有大概三分之一是不行的,原因可能是Cv2.Videocapture这个函数不是专业处理图片的,可能存在不兼容的问题,您需要的话,我给您发一下测试图片

YaoFANGUK commented 4 months ago

我测试是可以的啊

您测试目录下的图片,我测试过了,是可以得,我适当调整了部分代码,发现我从网上爬得图片,有大概三分之一是不行的,原因可能是Cv2.Videocapture这个函数不是专业处理图片的,可能存在不兼容的问题,您需要的话,我给您发一下测试图片

你邮件压缩包发我看看 flavioy@live.com

seriable commented 4 months ago

我测试是可以的啊

您测试目录下的图片,我测试过了,是可以得,我适当调整了部分代码,发现我从网上爬得图片,有大概三分之一是不行的,原因可能是Cv2.Videocapture这个函数不是专业处理图片的,可能存在不兼容的问题,您需要的话,我给您发一下测试图片

你邮件压缩包发我看看 flavioy@live.com

OK,辛苦大佬

YaoFANGUK commented 4 months ago

试了下,本身图片就有问题,不是PNG格式的图片,但是文件名命名用了PNG,哪些有问题的图片,我电脑都预览不了,感觉是你爬虫的问题

seriable commented 4 months ago

试了下,本身图片就有问题,不是PNG格式的图片,但是文件名命名用了PNG,哪些有问题的图片,我电脑都预览不了,感觉是你爬虫的问题

大佬问题解决了,我使用cv2.imwrite保存图片,就没有这个报错,如果使用image.save就会出现这个问题