class ffmpeg_frame (View source)

Methods

__construct(resource $gd_image)

NOTE: This function will not be available if GD is not enabled.

int
getWidth()

Return the width of the frame.

int
getHeight()

Return the height of the frame.

int
getPTS()

Return the presentation time stamp of the frame.

int
getPresentationTimestamp()

Return the presentation time stamp of the frame.

resize(int $width, int $height, int $crop_top = 0, int $crop_bottom = 0, int $crop_left = 0, int $crop_right = 0)

Resize and optionally crop the frame. (Cropping is built into ffmpeg resizing so I'm providing it here for completeness.)

crop(int $crop_top, int $crop_bottom = 0, int $crop_left = 0, int $crop_right = 0)

Crop the frame.

resource
toGDImage()

Returns a truecolor GD image of the frame.

Details

__construct(resource $gd_image)

NOTE: This function will not be available if GD is not enabled.

Parameters

resource $gd_image

int getWidth()

Return the width of the frame.

Return Value

int

int getHeight()

Return the height of the frame.

Return Value

int

int getPTS()

Return the presentation time stamp of the frame.

Return Value

int

int getPresentationTimestamp()

Return the presentation time stamp of the frame.

Return Value

int

resize(int $width, int $height, int $crop_top = 0, int $crop_bottom = 0, int $crop_left = 0, int $crop_right = 0)

Resize and optionally crop the frame. (Cropping is built into ffmpeg resizing so I'm providing it here for completeness.)

Parameters

int $width
  • New width of the frame (must be an even number).
int $height
  • New height of the frame (must be an even number).
int $crop_top
  • Remove [croptop] rows of pixels from the top of the frame.
int $crop_bottom
  • Remove [cropbottom] rows of pixels from the bottom of the frame.
int $crop_left
  • Remove [cropleft] rows of pixels from the left of the frame.
int $crop_right
  • Remove [cropright] rows of pixels from the right of the frame. NOTE: Cropping is always applied to the frame before it is resized. Crop values must be even numbers.

crop(int $crop_top, int $crop_bottom = 0, int $crop_left = 0, int $crop_right = 0)

Crop the frame.

Parameters

int $crop_top
  • Remove [croptop] rows of pixels from the top of the frame.
int $crop_bottom
  • Remove [cropbottom] rows of pixels from the bottom of the frame.
int $crop_left
  • Remove [cropleft] rows of pixels from the left of the frame.
int $crop_right
  • Remove [cropright] rows of pixels from the right of the frame. NOTE: Crop values must be even numbers.

resource toGDImage()

Returns a truecolor GD image of the frame.

NOTE: This function will not be available if GD is not enabled.

Return Value

resource