PHPFFMpeg
in package
uses
ForwardsCalls, InteractsWithFilters, InteractsWithMediaStreams
Tags
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
$pendingComplexFilters
protected
Collection
$pendingComplexFilters
$beforeSavingCallbacks
Callbacks that should be called just before the underlying library hits the save method.
private
array<string|int, mixed>
$beforeSavingCallbacks
= []
$ffmpeg
private
FFMpeg
$ffmpeg
$forceAdvanced
private
bool
$forceAdvanced
= false
$media
private
AbstractMediaType
$media
$mediaCollection
private
MediaCollection
$mediaCollection
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
AbstractMediaTypeaddFilter()
Helper method to provide multiple ways to add a filter to the underlying media object.
public
addFilter() : self
Return values
selfaddFilterAsComplexFilter()
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
selfaddListener()
Add a Listener to the underlying library.
public
addListener(ListenerInterface $listener) : self
Parameters
- $listener : ListenerInterface
Return values
selfaddWatermark()
Calls the callable with a WatermarkFactory instance and adds the freshly generated WatermarkFilter.
public
addWatermark(callable $withWatermarkFactory) : self
Parameters
- $withWatermarkFactory : callable
Return values
selfapplyBeforeSavingCallbacks()
Set the callbacks on the Media.
public
applyBeforeSavingCallbacks() : self
Return values
selfbeforeSaving()
Adds a callable to the callbacks array.
public
beforeSaving(callable $callback) : self
Parameters
- $callback : callable
Return values
selfconcatWithoutTranscoding()
public
concatWithoutTranscoding() : static
Return values
staticframe()
public
frame(TimeCode $timeCode) : static
Parameters
- $timeCode : TimeCode
Tags
Return values
staticfresh()
Returns a fresh instance of itself with only the underlying FFMpeg instance.
public
fresh() : self
Return values
selfget()
public
get() : AbstractMediaType
Return values
AbstractMediaTypegetAudioStream()
Gets the first audio streams of the media.
public
getAudioStream() : Stream|null
Return values
Stream|nullgetDurationInMiliseconds()
Gets the duration of the media from the first stream or from the format.
public
getDurationInMiliseconds() : int
Return values
intgetDurationInSeconds()
public
getDurationInSeconds() : int
Return values
intgetFilters()
Returns an array with the filters applied to the underlying media object.
public
getFilters() : array<string|int, mixed>
Return values
array<string|int, mixed>getMediaCollection()
public
getMediaCollection() : MediaCollection
Return values
MediaCollectiongetPendingComplexFilters()
Getter for the pending complex filters.
public
getPendingComplexFilters() : Collection
Return values
CollectiongetStreams()
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|nullisConcat()
public
isConcat() : bool
Return values
boolisFrame()
public
isFrame() : bool
Return values
boolisVideo()
public
isVideo() : bool
Return values
boolonEvent()
Add an event handler to the underlying library.
public
onEvent(string $event, callable $callback) : self
Parameters
- $event : string
- $callback : callable
Return values
selfopen()
Opens the MediaCollection if it's not been instanciated yet.
public
open(MediaCollection $mediaCollection) : self
Parameters
- $mediaCollection : MediaCollection
Return values
selfopenAdvanced()
Force 'openAdvanced' when opening the MediaCollection
public
openAdvanced(MediaCollection $mediaCollection) : self
Parameters
- $mediaCollection : MediaCollection
Return values
selfremoveListener()
Remove the Listener from the underlying library.
public
removeListener(ListenerInterface $listener) : self
Parameters
- $listener : ListenerInterface
Return values
selfresize()
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
selfgetFFMpegDriver()
Returns the FFMpegDriver of the underlying library.
private
getFFMpegDriver() : FFMpegDriver
Return values
FFMpegDriverisAdvancedMedia()
private
isAdvancedMedia() : bool