This section includes information for using the pure Python API of bob.io.video.
Returns a dictionary with all available video codec properties.
Returns a dictionary containing a detailed description of the built-in codecs for videos that are available but not necessarily supported.
Returns a dictionary with currently available video input formats.
Returns a dictionary containing a detailed description of the built-in input formats for videos that are available, but not necessarily supported by this library.
Returns a dictionary with currently available video output formats.
Returns a dictionary containing a detailed description of the built-in output formats for videos that are available, but not necessarily supported by this library.
Parameters:
Returns a dictionary containing a description of properties in the given decoder.
Parameters:
Returns a dictionary containing a description of properties in the given encoder.
Bases: object
reader(filename, [check=True]) -> new reader
Use this object to read frames from video files.
Constructor parameters:
Video reader objects can read data from video files. The current implementation uses FFmpeg (or libav if FFmpeg is not available) which is a stable freely available video encoding and decoding library, designed specifically for these tasks. You can read an entire video in memory by using the bob.io.video.reader.load() method or use iterators to read it frame by frame and avoid overloading your machine’s memory. The maximum precision data FFmpeg will yield is a 24-bit (8-bit per band) representation of each pixel (32-bit depths are also supported by FFmpeg, but not by this extension presently). So, the output of data is done with uint8 as data type. Output will be colored using the RGB standard, with each band varying between 0 and 255, with zero meaning pure black and 255, pure white (color).
[str] Full name of the codec in which this video file was recorded in
[str] Short name of the codec in which this video file was recorded in
[int] Total duration of this video file in microseconds (long)
[str] The full path to the file that will be decoded by this object
[str] Full name of the format in which this video file was recorded in
[str] Short name of the format in which this video file was recorded in
[float] Video’s announced frame rate (note there are video formats with variable frame rates)
[tuple] Typing information to load each frame separatedly
[int] The height of each frame in the video (a multiple of 2)
[str] A string with lots of video information (same as str(x))
x.load([raise_on_error=False] -> numpy.ndarray
Loads all of the video stream in a numpy ndarray organized in this way: (frames, color-bands, height, width). I’ll dynamically allocate the output array and return it to you.
The flag raise_on_error, which is set to False by default influences the error reporting in case problems are found with the video file. If you set it to True, we will report problems raising exceptions. If you either don’t set it or set it to False, we will truncate the file at the frame with problems and will not report anything. It is your task to verify if the number of frames returned matches the expected number of frames as reported by the property number_of_frames (or len) of this object.
[int] The number of frames in this video file
[tuple] Typing information to load all of the file at once
[int] The width of each frame in the video (a multiple of 2)
Returns a dictionary with currently supported video codec properties.
Returns a dictionary containing a detailed description of the built-in codecs for videos that are fully supported.
Returns a dictionary with currently supported video input formats.
Returns a dictionary containing a detailed description of the built-in input formats for videos that are fully supported.
Returns a dictionary with currently supported video output formats.
Returns a dictionary containing a detailed description of the built-in output formats for videos that are fully supported.
Bases: object
writer(filename, height, width, [framerate=25., [bitrate=1500000., [gop=12, [codec=’‘, [format=’‘, [check=True]) -> new writer
Use this object to write frames to video files.
Constructor parameters:
Video writer objects can write data to video files. The current implementation uses FFmpeg (or libav if FFmpeg is not available) which is a stable freely available video encoding and decoding library, designed specifically for these tasks. Videos are objects composed of RGB colored frames. Each frame inserted should be a 3D numpy.ndarray composed of unsigned integers of 8 bits. Each frame should have a shape equivalent to (plane, height, width).
Writes a new frame or set of frames to the file.
The frame should be setup as a array with 3 dimensions organized in this way (RGB color-bands, height, width). Sets of frames should be setup as a 4D array in this way: (frame-number, RGB color-bands, height, width). Arrays should contain only unsigned integers of 8 bits.
Note
At present time we only support arrays that have C-style storages (if you pass reversed arrays or arrays with Fortran-style storage, the result is undefined).
[float] The indicative bit rate for this video file, given as a hint to FFmpeg (compression levels are subject to the picture textures)
Closes the current video stream and forces writing the trailer. After this point the video is finalized and cannot be written to anymore.
[str] Full name of the codec in which this video file was recorded in
[str] Short name of the codec in which this video file was recorded in
[int] Total duration of this video file in microseconds (long)
[str] The full path to the file that will be decoded by this object
[str] Full name of the format in which this video file was recorded in
[str] Short name of the format in which this video file was recorded in
[float] Video’s announced frame rate (note there are video formats with variable frame rates)
[tuple] Typing information to load each frame separatedly
[int] Group of pictures setting (see the Wikipedia entry for details on this setting)
[int] The height of each frame in the video (a multiple of 2)
[str] A string with lots of video information (same as str(x))
[bool] A flag, indicating if the video is still opened for writing (or has already been closed by the user using close())
[int] The number of frames in this video file
[tuple] Typing information to load all of the file at once
[int] The width of each frame in the video (a multiple of 2)