videoflow.consumers package
This package contains a collection of consumers that implement the videoflow.core.node.ConsumerNode interface
Submodules
videoflow.consumers.basic module
- class videoflow.consumers.basic.CommandlineConsumer(sep: str = ' ', end: str = '\n', **kwargs)[source]
Bases:
ConsumerNodeWrites the input received to the command line.
- Arguments:
sep: separator to use between tokens.
end: end of line character
- class videoflow.consumers.basic.FileAppenderConsumer(filepath: str, **kwargs)[source]
Bases:
ConsumerNodeAppends a text representation of each received item, one per line, to a file.
- Arguments:
filepath: path to the file to append to (created if missing). The folder must already exist.
- class videoflow.consumers.basic.VoidConsumer(**kwargs)[source]
Bases:
ConsumerNodeIgnores the input received. Helpful in debugging flows.
- class videoflow.consumers.basic.WebhookConsumer(host: str, method: str = 'post', **kwargs)[source]
Bases:
ConsumerNode
videoflow.consumers.video module
- class videoflow.consumers.video.VideofileWriter(video_file: str, swap_channels: bool = True, fps: int = 30, **kwargs)[source]
Bases:
ConsumerNodeOpens a video file writer object and writes subsequent frames received into the object. If video file exists it overwrites it.
The video writer will open when it receives the first frame. - Arguments:
video_file: path to video. Folder where video lives must exist. Extension must be .avi
fps: frames per second
- consume(item: ndarray) None[source]
Receives the picture frame to append to the video and appends it to the video.
If it is the first frame received, it opens the video file and determines the height and width of the video from the dimensions of that first frame. Every subsequent frame is expected to have the same height and width. If it does not has it, it gets resized to it.
- Arguments:
item: np.ndarray of dimension (height, width, 3)