mPyPl.video
index
d:\winapp\anaconda3\lib\site-packages\mpypl\video.py

# Video processing functions

 
Modules
       
cv2.cv2
math
numpy

 
Functions
       
isdir = _isdir(path, /)
Return true if the pathname refers to an existing directory.
load_video(video, video_size=(100, 100), squarecrop=False, fps=25, maxlength=5, use_cache=False)
Load video content into `np.array.`. This is most frequently used to load video files for further processing in a
pipeline like this:
`get_datastream(...) | apply('filename','video',load_video) | ...`
videosource(fname, video_size=(100, 100), mode='rgb')
Produce a stream of video frames from a given input file.
:param fname: input file name (video)
:param video_size: tuple showing the size of the video frames `(width,height)`
:param mode: mode used to open the file. Default is `'rgb'`
:return: pipe stream of video frames
videosource_chunked(fname, frames_per_chunk=25, video_size=(100, 100), mode='rgb')
Produce a stream of video chunks of a given size.
:param fname: input filename
:param frames_per_chunk: number of frames per chunk. Defaults to 25, meaning 1 second of video under 25 fps.
:param video_size: tuple showing the size of the video frames `(width,height)`
:param mode: mode used to open the file. Default is `'rgb'`
:return: pipe stream of video chunks

 
Pipe functions
       
chunk_slide(datastream, chunk_size)
collect_video(datastream, filename, video_size=None, codec=1935959654)
Collect a video file from a sequence of frames of video fragments.
:param datastream: sequence of images or video fragments
:param filename: output file name
:param video_size: size of the video. If `None` (which is the default) - video size is determined from the dimensions of the input `np.array`
:param codec: OpenCV codec to use. Default is `cv2.VideoWriter_fourcc(*"ffds")`

 
Data
        altsep = '/'
curdir = '.'
defpath = r'.;C:\bin'
devnull = 'nul'
extsep = '.'
pardir = '..'
pathsep = ';'
sep = r'\'
supports_unicode_filenames = True