cutcutcodec.core.classes.stream_video.StreamVideo
- class cutcutcodec.core.classes.stream_video.StreamVideo(node)[source]
Representation of any video stream.
Attributes
- colorspaceColorspace
The color space in which the stream is defined (readonly).
Initialise and create the class.
Parameters
- nodecutcutcodec.core.classes.node.Node
The node where this stream comes from. The audit must be conducted in the children’s classes. It is not done here in order to avoid cyclic imports.
- node_maincutcutcodec.core.classes.node.Node
In the case this streams comes from
cutcutcodec.core.filter.meta_filter.MetaFilter, node_main is the meta filter while node is the subgraph of the meta-filter.
- abstract property colorspace: Colorspace
Return the color space in which the stream is defined.
- snapshot(timestamp: Real, shape: tuple[Integral, Integral] | list[Integral], *, channels=None) FrameVideo[source]
Extract the closest frame to the requested date.
Parameters
- timestampnumbers.Real
The absolute time expressed in seconds, not relative to the beginning of the video. For avoid the inacuracies of round, it is recomended to use fractional number.
- shapetuple[int, int] or list[int, int]
The pixel dimensions of the returned frame. The convention adopted is the numpy convention (height, width).
- channelsint, optional
Impose the numbers of channels, apply conversion if nescessary. For the interpretation of the layers, see
cutcutcodec.core.classes.frame_video.FrameVideo.
Returns
- framecutcutcodec.core.classes.frame_video.FrameVideo
Video frame with metadata.
Raises
- cutcutcodec.core.exception.OutOfTimeRange
If we try to get a frame out of the definition range. The valid range is [self.beginning, self.beginning+self.duration[.