class ffmpeg_movie (View source)

Methods

__construct(string $path_to_media, bool $persistent)

Open a video or audio file and return it as an object.

int
getDuration()

Return the duration of a movie or audio file in seconds.

int
getFrameCount()

Return the number of frames in a movie or audio file.

int
getFrameRate()

Return the frame rate of a movie in fps.

string
getFilename()

Return the path and name of the movie file or audio file.

string
getComment()

Return the comment field from the movie or audio file.

string
getTitle()

Return the title field from the movie or audio file.

string
getAuthor()

Return the author field from the movie or the artist ID3 field from an mp3 file.

string
getArtist()

Return the author field from the movie or the artist ID3 field from an mp3 file.

string
getCopyright()

Return the copyright field from the movie or audio file.

string
getGenre()

Return the genre ID3 field from an mp3 file.

string|int
getTrackNumber()

Return the track ID3 field from an mp3 file.

string|int
getYear()

Return the year ID3 field from an mp3 file.

int
getFrameHeight()

Return the height of the movie in pixels.

int
getFrameWidth()

Return the width of the movie in pixels.

getPixelFormat()

Return the pixel format of the movie.

int
getBitRate()

Return the bit rate of the movie or audio file in bits per second.

int
getVideoBitRate()

Return the bit rate of the video in bits per second.

int
getAudioBitRate()

Return the audio bit rate of the media file in bits per second.

int
getAudioSampleRate()

Return the audio sample rate of the media file in bits per second.

int
getFrameNumber()

Return the current frame index.

string
getVideoCodec()

Return the name of the video codec used to encode this movie as a string.

string
getAudioCodec()

Return the name of the audio codec used to encode this movie as a string.

int
getAudioChannels()

Return the number of audio channels in this movie as an integer.

bool
hasAudio()

Return boolean value indicating whether the movie has an audio stream.

bool
hasVideo()

Return boolean value indicating whether the movie has a video stream.

getFrame(int $framenumber)

Returns a frame from the movie as an ffmpeg_frame object. Returns false if the frame was not found.

getNextKeyFrame()

Returns the next key frame from the movie as an ffmpeg_frame object. Returns false if the frame was not found.

Details

__construct(string $path_to_media, bool $persistent)

Open a video or audio file and return it as an object.

Parameters

string $path_to_media
  • File path of video or audio file to open.
bool $persistent
  • Whether to open this media as a persistent resource. See the PHP documentation for more info about persistent resources

int getDuration()

Return the duration of a movie or audio file in seconds.

Return Value

int

int getFrameCount()

Return the number of frames in a movie or audio file.

Return Value

int

int getFrameRate()

Return the frame rate of a movie in fps.

Return Value

int

string getFilename()

Return the path and name of the movie file or audio file.

Return Value

string

string getComment()

Return the comment field from the movie or audio file.

Return Value

string

string getTitle()

Return the title field from the movie or audio file.

Return Value

string

string getAuthor()

Return the author field from the movie or the artist ID3 field from an mp3 file.

Return Value

string

string getArtist()

Return the author field from the movie or the artist ID3 field from an mp3 file.

Return Value

string

string getCopyright()

Return the copyright field from the movie or audio file.

Return Value

string

string getGenre()

Return the genre ID3 field from an mp3 file.

Return Value

string

string|int getTrackNumber()

Return the track ID3 field from an mp3 file.

Return Value

string|int

string|int getYear()

Return the year ID3 field from an mp3 file.

Return Value

string|int

int getFrameHeight()

Return the height of the movie in pixels.

Return Value

int

int getFrameWidth()

Return the width of the movie in pixels.

Return Value

int

getPixelFormat()

Return the pixel format of the movie.

int getBitRate()

Return the bit rate of the movie or audio file in bits per second.

Return Value

int

int getVideoBitRate()

Return the bit rate of the video in bits per second.

NOTE: This only works for files with constant bit rate.

Return Value

int

int getAudioBitRate()

Return the audio bit rate of the media file in bits per second.

Return Value

int

int getAudioSampleRate()

Return the audio sample rate of the media file in bits per second.

Return Value

int

int getFrameNumber()

Return the current frame index.

Return Value

int

string getVideoCodec()

Return the name of the video codec used to encode this movie as a string.

Return Value

string

string getAudioCodec()

Return the name of the audio codec used to encode this movie as a string.

Return Value

string

int getAudioChannels()

Return the number of audio channels in this movie as an integer.

Return Value

int

bool hasAudio()

Return boolean value indicating whether the movie has an audio stream.

Return Value

bool

bool hasVideo()

Return boolean value indicating whether the movie has a video stream.

Return Value

bool

ffmpeg_frame getFrame(int $framenumber)

Returns a frame from the movie as an ffmpeg_frame object. Returns false if the frame was not found.

Parameters

int $framenumber
  • Frame from the movie to return. If no framenumber is specified, returns the next frame of the movie.

Return Value

ffmpeg_frame

ffmpeg_frame getNextKeyFrame()

Returns the next key frame from the movie as an ffmpeg_frame object. Returns false if the frame was not found.

Return Value

ffmpeg_frame