videoSlice.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:Enchain 作者: Zhehua-Hu 项目源码 文件源码
def showVideoInfo(video_path):
    try:
        vhandle = cv2.VideoCapture(video_path)  # For read Chinease-name video
        fps = vhandle.get(cv2.CAP_PROP_FPS)
        count = vhandle.get(cv2.CAP_PROP_FRAME_COUNT)
        size = (int(vhandle.get(cv2.CAP_PROP_FRAME_WIDTH)),
                int(vhandle.get(cv2.CAP_PROP_FRAME_HEIGHT)))
        ret, firstframe = vhandle.read()
        if ret:
            print("FPS: %.2f" % fps)
            print("COUNT: %.2f" % count)
            print("WIDTH: %d" % size[0])
            print("HEIGHT: %d" % size[1])
            return vhandle, fps, size, firstframe
        else:
            print("Video can not read!")
    except:
        "Error in showVideoInfo"
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号