videocr icon indicating copy to clipboard operation
videocr copied to clipboard

关于设置读帧的stride方法

Open Phincle opened this issue 6 years ago • 3 comments

你好,非常感谢你,videocr对我的帮助非常大。 但是我现在机器算力有点慢,我想通过增大读帧间隔的方法来提高一下效率,请问怎么修改呢?

Phincle avatar Nov 08 '19 16:11 Phincle

https://github.com/apm1467/videocr/blob/9b97c996570897b5a45d1f8b4f046aebcbcca300/videocr/video.py#L46

可以在这里设置步长,比如

frames = (v.read()[1] for _ in range(0,num_ocr_frames,20))

lhy1024 avatar Jan 14 '20 06:01 lhy1024

但是这样做的话,得到的时间戳也是缩放了吧?

hlthu avatar Jan 15 '20 17:01 hlthu

但是这样做的话,得到的时间戳也是缩放了吧?

想了一下,确实存在这种情况。因为我的使用场景是提取文本,而不是提取软字幕,所以就没有考虑这方面

lhy1024 avatar Jan 16 '20 02:01 lhy1024