Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Latest commit

 

History

History
206 lines (134 loc) · 4.91 KB

File metadata and controls

206 lines (134 loc) · 4.91 KB

video

Contents

Video

__init__ [#19]

Check the source code online

def __init__(self, *args, fmt='mp4', **kwargs):

 
docstring:

no docstring

get_cap_from_images_folder [#23]

Check the source code online

def get_cap_from_images_folder(self, img_format='%1d.png'):

 
docstring:

It creates a cv2 VideoCaptur 'cap' from a folder of images (frames)

close [#46]

Check the source code online

def close(self):

 
docstring:

Takes a folder full of frames saved as images and converts it into a
    video.

BasicVideoMaker

Wrapper around vedo Video class to facilitate the creation of videos from
brainrender scenes.

Use kwargs to specify:
    - save_fld: folder where to save video
    - save_name: video name
    - video_format: e.g. mp4
    - duration: video duration in seconds
    - niters: number of iterations (frames) when creating the video
    - fps: framerate of video

__init__ [#79]

Check the source code online

def __init__(self, scene, **kwargs):

 
docstring:

no docstring

parse_kwargs [#95]

Check the source code online

def parse_kwargs(self, **kwargs):

 
docstring:

Parses arguments for video creation

Use kwargs to specify:

- save_fld: folder where to save video

- save_name: video name

- video_format: e.g. mp4

- duration: video duration in seconds

- niters: number of iterations (frames) when creating the video

- fps: framerate of video

Arguments not specified in kwargs will be assigned default values

make_video [#115]

Check the source code online

def make_video(self, azimuth=0, elevation=0, roll=0, **kwargs):

 
docstring:

Creates a video using user defined parameters

:param azimuth: integer, specify the rotation in degrees per frame on
    the relative axis. (Default value = 0)

:param elevation: integer, specify the rotation in degrees per frame
    on the relative axis. (Default value = 0)

:param roll: integer, specify the rotation in degrees per frame on the
    relative axis. (Default value = 0)

:param kwargs: use to change destination folder, video name, fps,
    duration ... check 'self.parse_kwargs' for details.

CustomVideoMaker

Subclasses BasicVideoMaker and replaces make_video method.

__init__ [#163]

Check the source code online

def __init__(self, scene, **kwargs):

 
docstring:

no docstring

make_video [#166]

Check the source code online

def make_video(self, video_function, **kwargs):

 
docstring:

Let's users use a custom function to create the video.

The custom function must:

- have a 'scene' keyword argument to accept a Scene() instance

- have a 'videomaker' keyword argument to accept the CustomVideoMaker
    (self) instance

- have a 'video' keyword that takes the Video argument

- return the instance of Video

The custom function can manipulate actors and camera in the scene and

add frames to the video with 'video.addFrame()'.

Once all frames are ready it has to return the video object

so that the video can be closed and saved.

:param video_function: custom function used to generate the video's
    frames

see: examples/advanced/custom_videomaker.py