Video
extends Image
in package
Uses ffmpeg to extract frames, or to convert a video.
Table of Contents
- $aspectRatio : float
- $duration : float
- $ffmpeg : string
- Full path of the ffmpeg executable.
- $height : int
- $height : int
- $notices : array<string|int, mixed>
- Encoder & Decoder notices/warnings.
- $position : float
- The positon of the current frame (in sec).
- $width : int
- $width : int
- $filename : string
- $gd : resource
- $errors : array<string|int, mixed>
- Errors reported by ffmpeg.
- $inputParameters : array<string|int, mixed>|string
- Parameters that are placed before the "-i" to speficy the input format & codec.
- $progressFile : string
- Filename of the progress json file.
- $properties : array<string|int, mixed>
- The duration, width and heigth properties.
- $started : int
- Timestamp.
- $state : enum
- Parser state.
- __call() : mixed
- Report that the $method doesn't exist.
- __callStatic() : mixed
- Report that the $method doesn't exist.
- __construct() : mixed
- Constructor.
- __destruct() : mixed
- __get() : mixed
- Vraag gegevens op van het filmbestand (via de property).
- __set() : mixed
- Report that $property doesn't exist and set the property to the given $value.
- __toString() : string
- The object is used as an string.
- cropped() : Graphics
- Return a new Graphics object with the cropped contents.
- flipped() : Graphics
- Return a new Graphics object with the contents flipped.
- getHeaders() : mixed
- isDocument() : true
- This Component can not be nested inside another Component.
- process() : mixed
- Process the video with ffmpeg.
- rasterize() : resource
- Rasterize the layer to an GD resource.
- render() : mixed
- resized() : Image
- Returns a new Graphics object in the given size.
- rotated() : Graphics
- Return a new Graphics object in te given rotation.
- saveAs() : mixed
- Save frame, video or audio.
- saveThumbnail() : mixed
- Create a thumbnail.
- colorIndex() : int
- Resolve/Allocate palete index for the given $color.
- createCanvas() : resource
- Create a transparent gd resource with full (white) alphachannel.
- getAspectRatio() : float
- getHeight() : int
- getWidth() : int
- rasterizeTo() : mixed
- Render the graphics to the given $gd resource.
- rasterizeTruecolor() : resource
- Rasterize the layer to a truecolor(32bit) GD resource.
- createFromMimetype() : mixed
- parseError() : mixed
- parseLine() : mixed
Properties
$aspectRatio read-only
public
float
$aspectRatio
$duration read-only
public
float
$duration
in seconds.
$ffmpeg
Full path of the ffmpeg executable.
public
static string
$ffmpeg
= null
$height read-only
public
int
$height
in pixels.
$height
public
int
$height
in pixels.
$notices
Encoder & Decoder notices/warnings.
public
array<string|int, mixed>
$notices
= []
$position
The positon of the current frame (in sec).
public
float
$position
= 0
$width read-only
public
int
$width
in pixels.
$width
public
int
$width
in pixels.
$filename
protected
string
$filename
Path to the imagefile
$gd
protected
resource
$gd
GD
$errors
Errors reported by ffmpeg.
private
array<string|int, mixed>
$errors
$inputParameters
Parameters that are placed before the "-i" to speficy the input format & codec.
private
array<string|int, mixed>|string
$inputParameters
$progressFile
Filename of the progress json file.
private
string
$progressFile
$properties
The duration, width and heigth properties.
private
array<string|int, mixed>
$properties
$started
Timestamp.
private
int
$started
$state
Parser state.
private
enum
$state
Methods
__call()
Report that the $method doesn't exist.
public
__call(string $method, array<string|int, mixed> $arguments) : mixed
Parameters
- $method : string
- $arguments : array<string|int, mixed>
Return values
mixed —__callStatic()
Report that the $method doesn't exist.
public
static __callStatic(string $method, array<string|int, mixed> $arguments) : mixed
Parameters
- $method : string
- $arguments : array<string|int, mixed>
Return values
mixed —__construct()
Constructor.
public
__construct(string $filename[, string|array<string|int, mixed> $inputParameters = '' ]) : mixed
Parameters
- $filename : string
- $inputParameters : string|array<string|int, mixed> = ''
-
Parameters that are placed before the "-i" to speficy the input format & codec.
Return values
mixed —__destruct()
public
__destruct() : mixed
Return values
mixed —__get()
Vraag gegevens op van het filmbestand (via de property).
public
__get(mixed $property) : mixed
Parameters
- $property : mixed
Return values
mixed —__set()
Report that $property doesn't exist and set the property to the given $value.
public
__set(string $property, mixed $value) : mixed
Parameters
- $property : string
- $value : mixed
Return values
mixed —__toString()
The object is used as an string.
public
__toString() : string
Return values
string —cropped()
Return a new Graphics object with the cropped contents.
public
cropped(int $width, int $height[, int $offsetLeft = null ][, int $offsetTop = null ]) : Graphics
Resizes the canvas, but not the contents.
Parameters
- $width : int
-
The new width
- $height : int
-
The new height
- $offsetLeft : int = null
-
Offset left (null: centered)
- $offsetTop : int = null
-
Offset top (null: centered)
Return values
Graphics —flipped()
Return a new Graphics object with the contents flipped.
public
flipped([enum $mode = 'both' ]) : Graphics
Parameters
- $mode : enum = 'both'
-
"horizontal" left <-> right, "vertical": up ^v down, "both": rotates 180deg
Return values
Graphics —getHeaders()
public
getHeaders() : mixed
Return values
mixed —isDocument()
This Component can not be nested inside another Component.
public
isDocument() : true
Return values
true —process()
Process the video with ffmpeg.
public
process([string $outputFile = null ][, string|array<string|int, mixed> $outputParameters = [] ][, string|array<string|int, mixed> $inputParameters = [] ]) : mixed
Parameters
- $outputFile : string = null
-
The output filename
- $outputParameters : string|array<string|int, mixed> = []
- $inputParameters : string|array<string|int, mixed> = []
-
Additional parameters that are placed before the "-i"
Tags
Return values
mixed —rasterize()
Rasterize the layer to an GD resource.
public
rasterize() : resource
Updates and returns the internal gd resource.
Return values
resource —gd
render()
public
render() : mixed
Return values
mixed —resized()
Returns a new Graphics object in the given size.
public
resized(int $width, int $height) : Image
Parameters
- $width : int
- $height : int
Return values
Image —rotated()
Return a new Graphics object in te given rotation.
public
rotated(float $angle[, string $bgcolor = 'rgba(255,255,255,0)' ]) : Graphics
Parameters
- $angle : float
- $bgcolor : string = 'rgba(255,255,255,0)'
Return values
Graphics —saveAs()
Save frame, video or audio.
public
saveAs(string $filename[, array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $filename : string
-
The target filename
- $options : array<string|int, mixed> = []
Return values
mixed —saveThumbnail()
Create a thumbnail.
public
saveThumbnail(string $filename, int $width, int $height) : mixed
Parameters
- $filename : string
- $width : int
- $height : int
Return values
mixed —colorIndex()
Resolve/Allocate palete index for the given $color.
protected
colorIndex(string $color[, $gd = null ]) : int
Parameters
- $color : string
-
Allowed syntax: 'red' '#f00' '#ff0000' 'rgb(255, 0, 0)' 'rgba(255, 0, 0, 0.5)'
- $gd : = null
-
(optional) GD resource
Return values
int —createCanvas()
Create a transparent gd resource with full (white) alphachannel.
protected
createCanvas(int $width, int $height[, mixed $bgcolor = 'rgba(255,255,255,0)' ]) : resource
Parameters
- $width : int
- $height : int
- $bgcolor : mixed = 'rgba(255,255,255,0)'
Return values
resource —gd
getAspectRatio()
protected
getAspectRatio() : float
Return values
float —Aspect ratio
getHeight()
protected
getHeight() : int
Return values
int —Height
getWidth()
protected
getWidth() : int
Return values
int —Width
rasterizeTo()
Render the graphics to the given $gd resource.
protected
rasterizeTo(resource $gd, mixed $x, mixed $y) : mixed
Parameters
- $gd : resource
- $x : mixed
- $y : mixed
Return values
mixed —rasterizeTruecolor()
Rasterize the layer to a truecolor(32bit) GD resource.
protected
rasterizeTruecolor() : resource
Updates and returns the internal gd resource.
Return values
resource —gd
createFromMimetype()
private
createFromMimetype(mixed $mimetype) : mixed
Parameters
- $mimetype : mixed
Return values
mixed —parseError()
private
parseError(mixed $line) : mixed
Parameters
- $line : mixed
Return values
mixed —parseLine()
private
parseLine(mixed $line) : mixed
Parameters
- $line : mixed