Exemplo n.º 1
0
def main():
    print("Downloading video...")
    url = sys.argv[1]
    dl = Download(url)
    videoFile = dl.getVideo()
    # videoFile = "testVideo.mp4"

    print("Detecting shot boundaries...")
    bd = BoundaryDetector(videoFile)
    shotBounds = bd.getShotBoundaries()
    print("{0} shot boundaries found...".format(np.sum(shotBounds)))
    # shotBounds = np.load("bounds.npy")

    print("Extracting representative keyframes...")
    kfExtractor = KeyframeExtractor(videoFile)
    frames = kfExtractor.extractKeyframes(shotBounds)
    for frame in frames:
        cv2.imshow("Keyframes", frame)
        cv2.waitKey()
Exemplo n.º 2
0
def main():
	print("Downloading video...")
	url = sys.argv[1]
	dl = Download(url)
	videoFile = dl.getVideo()
	# videoFile = "testVideo.mp4"

	print("Detecting shot boundaries...")
	bd = BoundaryDetector(videoFile)
	shotBounds = bd.getShotBoundaries()
	print("{0} shot boundaries found...".format(np.sum(shotBounds)))
	# shotBounds = np.load("bounds.npy")

	print("Extracting representative keyframes...")
	kfExtractor = KeyframeExtractor(videoFile)
	frames = kfExtractor.extractKeyframes(shotBounds)
	for frame in frames:
		cv2.imshow("Keyframes", frame)
		cv2.waitKey()