python cv2从archi读取视频

2024-03-28 20:56:56 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个.tar文件,其中包含一个.mp4视频。我需要在PyQt4中通过OpenCV(v2.4.8)打开它们,而不需要将归档文件解压到文件系统中。你知道吗

这里有reading images from tar的解

实例:

import cv2
import numpy as np
import tarfile

tar0 = tarfile.open('files.tar')
fileg = tar0.extractfile('1.mp4')#  (may be convert fileg to VideoCapture?)

Tags: 文件实例fromimport视频tarcv2opencv