package bimage-unix

  1. Overview
  2. Docs

Module Bimage_unix.FfmpegSource

Ffmpeg is used to load images from video files. The ffmpeg command line tool is required

Sourcetype input

Video file

Sourcetype output
Sourceval frames : input -> int

Get the number of frames for a video file

Sourceval index : input -> int

Get the current frame index for a video file

Sourceval shape : input -> int * int

Get the width and height of a video file

Sourceval skip : input -> int -> unit

Skip frames

Sourceval set_index : input -> int -> unit

Set the frame index

Sourceval load : string -> input

Open a video file

Sourceval create : ?framerate:int -> string -> int -> int -> output
Sourceval write_frame : output -> (int, Bimage.u8, Bimage.rgb) Bimage.Image.t -> unit
Sourceval finish : output -> unit
Sourceval reset : input -> unit

Reset the frame index to 0

Sourceval next : ?create: (string -> ?layout:Bimage.Image.layout -> int -> int -> (int, Bimage.u8, Bimage.rgb) Bimage.Image.t) -> ?layout:Bimage.Image.layout -> input -> (int, Bimage.u8, Bimage.rgb) Bimage.Image.t option

Get the next frame

Sourceval read_n : input -> ?create: (string -> ?layout:Bimage.Image.layout -> int -> int -> (int, Bimage.u8, Bimage.rgb) Bimage.Image.t) -> int -> (int, Bimage.u8, Bimage.rgb) Bimage.Input.t

Read multiple images directly into an Input array. The resulting array will not contain the number of frames requested if you've reached the end of the video