module Video: sig .. end
exception Invalid_frame
exception Invalid_conversion
exception Not_implemented
Raised when a feature is not yet implemented,
in particular pixel format with data other than
unsigned 8 bit integers.
type interlace_mode =
| |
No_interlace |
| |
Top_first |
| |
Bottom_first |
| |
Mixed |
Interlace mode type
type pixel_format =
| |
Gray_8 |
| |
Gray_16 |
| |
Gray_float |
| |
Graya_16 |
| |
Graya_32 |
| |
Graya_float |
| |
Rgb_15 |
| |
Bgr_15 |
| |
Rgb_16 |
| |
Bgr_16 |
| |
Rgb_24 |
| |
Bgr_24 |
| |
Rgb_32 |
| |
Bgr_32 |
| |
Rgba_32 |
| |
Rgb_48 |
| |
Rgba_64 |
| |
Rgb_float |
| |
Rgba_float |
| |
Yuy2 |
| |
Yuvy |
| |
Yuva_32 |
| |
Yuva_64 |
| |
Yuv_float |
| |
Yuva_float |
| |
Yuv_420_p |
| |
Yuv_422_p |
| |
Yuv_444_p |
| |
Yuv_411_p |
| |
Yuv_410_p |
| |
Yuvj_420_p |
| |
Yuvj_422_p |
| |
Yuvj_444_p |
| |
Yuv_444_p_16 |
| |
Yuv_422_p_16 |
Pixel formats. Only formats using 8 bit unsigned integers are supported for now.
type framerate_mode =
| |
Constant |
| |
Variable |
| |
Still |
Framerate mode
type chroma_placement =
| |
Default |
| |
Mpeg2 |
| |
Dvpal |
Chroma placement.
type format = {
|
frame_width : int; |
|
frame_height : int; |
|
image_width : int; |
|
image_height : int; |
|
pixel_width : int; |
|
pixel_height : int; |
|
pixelformat : pixel_format; |
|
frame_duration : int; |
|
timescale : int; |
|
framerate_mode : framerate_mode; |
|
chroma_placement : chroma_placement; |
|
interlace_mode : interlace_mode; |
}
Video format.
type plane = (int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t
Plane data, represented as a big array of unsigned 8 bits ints.
type frame = {
|
planes : (plane * int) array; |
|
timestamp : Int64.t; |
|
duration : Int64.t; |
|
frame_interlace_mode : interlace_mode; |
}
Frame type.
val new_frame : format -> frame
Create a new frame.
type t
Opaque type for a converter.
val create_converter : format -> format -> t
in_format out_format creates a converter
converting from
in_format to
out_format.
Raises Not_implemented if input or output format
do not use unsigned 8 bit integers.
val init : t -> format -> format -> unit
init conv in_format out_format: initializes a converter with
new input and output formats.
Raises Not_implemented if input or output format
do not use unsigned 8 bit integers.
val get_formats : t -> format * format
get_formats conv returns a pair (in_format,out_format).
val get_quality : t -> int
Get quality setting.
val set_quality : t -> int -> unit
Set quality setting.
type int_rect = int * int * int * int
Type for integer rectangles.
type float_rect = float * float * float * float
Type for float rectangles.
val get_rect : t -> float_rect * int_rect
get_rect conv returns a pair (in_rect,out_rect).
val set_rect : t -> float_rect -> int_rect -> unit
set_rect conv in_rec out_rec sets input and output rectangles.
type conversion_flags = [ `Convolve_chroma
| `Convolve_normalize
| `Force_deinterlace
| `Resample_chroma ]
Type for conversion flags.
val set_flags : t -> conversion_flags list -> unit
Set conversion flags.
val get_flags : t -> conversion_flags list
Get conversion flags.
type scale_mode =
| |
Auto |
| |
Nearest |
| |
Bilinear |
| |
Quadratic |
| |
Cubic_bspline |
| |
Cubic_mitchell |
| |
Cubic_catmull |
| |
Scale_sinc_lanczos |
Type for scale mode.
val set_scale_mode : t -> scale_mode -> unit
Set scale mode.
val get_scale_mode : t -> scale_mode
Get scale mode.
val reinit : t -> unit
Reinitialize a converter. Should be called when a setting has changed.
val convert : t -> frame -> frame -> unit
Perform frame conversion.
Raises Invalid_frame if input or output frame doesn't match
corresponding format.
Raises Not_implemented if input or output format
do not use unsigned 8 bit integers.