Bånder

PHPFFMpeg
in package
uses ForwardsCalls, InteractsWithFilters, InteractsWithMediaStreams

Tags
mixin

Table of Contents

Properties

$pendingComplexFilters  : Collection
$beforeSavingCallbacks  : array<string|int, mixed>
Callbacks that should be called just before the underlying library hits the save method.
$ffmpeg  : FFMpeg
$forceAdvanced  : bool
$media  : AbstractMediaType
$mediaCollection  : MediaCollection

Methods

__call()  : mixed
Forwards the call to the underling media object and returns the result if it's something different from the media object itself.
__construct()  : mixed
__invoke()  : AbstractMediaType
Returns the underlying media object itself.
addFilter()  : self
Helper method to provide multiple ways to add a filter to the underlying media object.
addFilterAsComplexFilter()  : self
Maps the arguments into a 'LegacyFilterMapping' instance and pushed it to the 'pendingComplexFilters' collection. These filters will be applied later on by the MediaExporter.
addListener()  : self
Add a Listener to the underlying library.
addWatermark()  : self
Calls the callable with a WatermarkFactory instance and adds the freshly generated WatermarkFilter.
applyBeforeSavingCallbacks()  : self
Set the callbacks on the Media.
beforeSaving()  : self
Adds a callable to the callbacks array.
concatWithoutTranscoding()  : static
frame()  : static
fresh()  : self
Returns a fresh instance of itself with only the underlying FFMpeg instance.
get()  : AbstractMediaType
getAudioStream()  : Stream|null
Gets the first audio streams of the media.
getDurationInMiliseconds()  : int
Gets the duration of the media from the first stream or from the format.
getDurationInSeconds()  : int
getFilters()  : array<string|int, mixed>
Returns an array with the filters applied to the underlying media object.
getMediaCollection()  : MediaCollection
getPendingComplexFilters()  : Collection
Getter for the pending complex filters.
getStreams()  : array<string|int, mixed>
Returns an array with all streams.
getVideoStream()  : Stream|null
Gets the first video streams of the media.
isConcat()  : bool
isFrame()  : bool
isVideo()  : bool
onEvent()  : self
Add an event handler to the underlying library.
open()  : self
Opens the MediaCollection if it's not been instanciated yet.
openAdvanced()  : self
Force 'openAdvanced' when opening the MediaCollection
removeListener()  : self
Remove the Listener from the underlying library.
resize()  : self
Shortcut for adding a Resize filter.
getFFMpegDriver()  : FFMpegDriver
Returns the FFMpegDriver of the underlying library.
isAdvancedMedia()  : bool

Properties

$beforeSavingCallbacks

Callbacks that should be called just before the underlying library hits the save method.

private array<string|int, mixed> $beforeSavingCallbacks = []

$forceAdvanced

private bool $forceAdvanced = false

Methods

__call()

Forwards the call to the underling media object and returns the result if it's something different from the media object itself.

public __call(mixed $method, mixed $arguments) : mixed
Parameters
$method : mixed
$arguments : mixed

__construct()

public __construct(FFMpeg $ffmpeg) : mixed
Parameters
$ffmpeg : FFMpeg

__invoke()

Returns the underlying media object itself.

public __invoke() : AbstractMediaType
Return values
AbstractMediaType

addFilter()

Helper method to provide multiple ways to add a filter to the underlying media object.

public addFilter() : self
Return values
self

addFilterAsComplexFilter()

Maps the arguments into a 'LegacyFilterMapping' instance and pushed it to the 'pendingComplexFilters' collection. These filters will be applied later on by the MediaExporter.

public addFilterAsComplexFilter(mixed $in, mixed $out, mixed ...$arguments) : self
Parameters
$in : mixed
$out : mixed
$arguments : mixed
Return values
self

addListener()

Add a Listener to the underlying library.

public addListener(ListenerInterface $listener) : self
Parameters
$listener : ListenerInterface
Return values
self

addWatermark()

Calls the callable with a WatermarkFactory instance and adds the freshly generated WatermarkFilter.

public addWatermark(callable $withWatermarkFactory) : self
Parameters
$withWatermarkFactory : callable
Return values
self

applyBeforeSavingCallbacks()

Set the callbacks on the Media.

public applyBeforeSavingCallbacks() : self
Return values
self

beforeSaving()

Adds a callable to the callbacks array.

public beforeSaving(callable $callback) : self
Parameters
$callback : callable
Return values
self

concatWithoutTranscoding()

public concatWithoutTranscoding() : static
Return values
static

frame()

public frame(TimeCode $timeCode) : static
Parameters
$timeCode : TimeCode
Tags
throws
Exception
Return values
static

fresh()

Returns a fresh instance of itself with only the underlying FFMpeg instance.

public fresh() : self
Return values
self

get()

public get() : AbstractMediaType
Return values
AbstractMediaType

getAudioStream()

Gets the first audio streams of the media.

public getAudioStream() : Stream|null
Return values
Stream|null

getDurationInMiliseconds()

Gets the duration of the media from the first stream or from the format.

public getDurationInMiliseconds() : int
Return values
int

getFilters()

Returns an array with the filters applied to the underlying media object.

public getFilters() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPendingComplexFilters()

Getter for the pending complex filters.

public getPendingComplexFilters() : Collection
Return values
Collection

getStreams()

Returns an array with all streams.

public getStreams() : array<string|int, mixed>
Return values
array<string|int, mixed>

getVideoStream()

Gets the first video streams of the media.

public getVideoStream() : Stream|null
Return values
Stream|null

isConcat()

public isConcat() : bool
Return values
bool

isFrame()

public isFrame() : bool
Return values
bool

isVideo()

public isVideo() : bool
Return values
bool

onEvent()

Add an event handler to the underlying library.

public onEvent(string $event, callable $callback) : self
Parameters
$event : string
$callback : callable
Return values
self

openAdvanced()

Force 'openAdvanced' when opening the MediaCollection

public openAdvanced(MediaCollection $mediaCollection) : self
Parameters
$mediaCollection : MediaCollection
Return values
self

removeListener()

Remove the Listener from the underlying library.

public removeListener(ListenerInterface $listener) : self
Parameters
$listener : ListenerInterface
Return values
self

resize()

Shortcut for adding a Resize filter.

public resize(int $width, int $height[, string $mode = ResizeFilter::RESIZEMODE_FIT ][, bool $forceStandards = true ]) : self
Parameters
$width : int
$height : int
$mode : string = ResizeFilter::RESIZEMODE_FIT
$forceStandards : bool = true
Return values
self

getFFMpegDriver()

Returns the FFMpegDriver of the underlying library.

private getFFMpegDriver() : FFMpegDriver
Return values
FFMpegDriver

isAdvancedMedia()

private isAdvancedMedia() : bool
Return values
bool

        
On this page

Search results