c4dynamics.datasets.video

Contents

c4dynamics.datasets.video#

c4dynamics.datasets.video(video_name: str) str[source]#

Fetches the path of a video from the local cache.

video downloads and manages video files from c4dynamics datasets.

Video Name

Description

planes

10 seconds video file of aerobatic airplanes (aerobatics.mp4, 7MB)

drifting_car

9 seconds video file of a drifting car* (drifting_car.mp4, 10MB)

The videos can be found at C4dynamics/C4dynamics

* Used by kind permission of Abed Ismail

Parameters:

video_name (str) – The name of the video to download

Returns:

out (str) – A path to the video file in the local cache

Examples

Import required packages:

>>> import c4dynamics as c4d
>>> import cv2

Fetch and run:

>>> vidpath = c4d.datasets.video('aerobatics')
Fetched successfully
>>> cap = cv2.VideoCapture(vidpath)
>>> while cap.isOpened():
...   ret, frame = cap.read()
...   if not ret: break
...   cv2.imshow('aerobatics', frame)
...   cv2.waitKey(33) 
>>> cap.release()
>>> cv2.destroyAllWindows()
../../../_images/aerobatics.gif