Musicalgestures

Auto-generated documentation for musicalgestures module.

Examples

[find in source code]

class Examples():
    def __init__():

MgVideo

[find in source code]

class MgVideo(MgAudio):
    def __init__(
        filename,
        array=None,
        fps=None,
        path=None,
        filtertype='Regular',
        thresh=0.05,
        starttime=0,
        endtime=0,
        blur='None',
        skip=0,
        frames=0,
        rotate=0,
        color=True,
        contrast=0,
        brightness=0,
        crop='None',
        keep_all=False,
        returned_by_process=False,
        sr=22050,
        n_fft=2048,
        hop_length=512,
    ):

This is the class for working with video files in the Musical Gestures Toolbox. It inherites from the class MgAudio for working with audio files as well. There is a set of preprocessing tools you can use when you load a video, such as: - trimming: to extract a section of the video, - skipping: to shrink the video by skipping N frames after keeping one, - rotating: to rotate the video by N degrees, - applying brightness and contrast - cropping: to crop the video either automatically (by assessing the area of motion) or manually with a pop-up user interface, - converting to grayscale

These preprocesses will apply upon creating the MgVideo. Further processes are available as class methods.

See also

MgVideo().average

[find in source code]

def average(filename=None, normalize=True, target_name=None, overwrite=False):

MgVideo().from_numpy

[find in source code]

def from_numpy(array, fps, target_name=None):

MgVideo().get_video

[find in source code]

def get_video():

Creates a video attribute to the Musical Gestures object with the given correct settings.

MgVideo().numpy

[find in source code]

def numpy():

Pipe all video frames from FFmpeg to numpy array

MgVideo().test_input

[find in source code]

def test_input():

Gives feedback to user if initialization from input went wrong.