vInfo Class

PHP Media Handler Pro parse media information returned from ffmpeg and other utilities and stored in proper object. this page will provide detail about media object

PHP Media Handler Pro - vInfo Class

PHP Media Handler Pro parse media information returned from ffmpeg and other utilities and stored in proper object of vinfo class. this page will provide detail about properties available in vinfo class


vInfo Class Properties

List of properties available in vinfo class

Properties Detail Information
errorcode
It shows whether error occurs or not while processing media. value 0 shows no error.
errorMessage
Return error description in case error occurs.
ffmpegOutput
Return complete ffmpeg or other service (utility used) output.
duration
Return duration of video or audio file in hours:minutes:seconds format.
duration_sec
Return duration of video in seconds.
sourceFileName
Return source file name of video or audio.
fileName
Return published file name of video or audio.
thumbFileName
Return thumb file name grabbed from video
bitrate
Return actual bitate of video or audio file.
Source File / Main Information
width
Return video width info
height
Return video height info
aCodec
Return audio codec information of source video.
vCodec
Return video codec information of source video
samplingRate
Return audio sampling rate
channel
Return audio channel info
aBitrate
Return audio bitrate info
vBitrate
Return video bitrate info
frameRate
Return video framerate
hasaudio
Return whether media has audio or not
hasvideo
Return whether media has video or not
Source File / Main Information
i_width
Return video width info
i_height
Return video height info
i_aCodec
Return audio codec information of published video.
i_vCodec
Return video codec information of published video
i_SamplingRate
Return audio sampling rate
i_channel
Return audio channel info
i_aBitrate
Return audio bitrate info
i_vBitrate
Return video bitrate info
i_frameRate
Return video framerate
i_hasaudio
Return whether media has audio or not
i_hasvideo
Return whether media has video or not
Other Information
artist
Return media artist information
title
Return media title information
copyright
Return media copyright information
genre
Return media genre information
tracknumber
Return media track number
pixelformat
Return media pixel format

Example Code

Example 1: Sample code for displaying information returned as vinfo object.

$output = "";
$output .= "
......................................................
"; $output .= "Duration: " . $info->duration . "
"; $output .= "Duration Seconds: " . $info->duration_sec . "
"; $output .= "Size: " . $info->width . 'x' . $info->height . "
"; $output .= "......................................................
"; $output .= "Detail Information
"; $output .= "......................................................
"; $output .= "Frame Rate: " . $info->frameRate . "
"; if($info->title != "") $output .= "Title: " . $info->title . "
"; if($info->artist != "") $output .= "Artist: " . $info->artist . "
"; if($info->copyright != "") $output .= "Copyright: " . $info->copyright . "
"; if($info->genre != "") $output .= "Genre: " . $info->genre . "
"; if($info->tracknumber != "") $output .= "Track Number: " . $info->tracknumber . "
"; if($info->pixelformat != "") $output .= "Pixel Format: " . $info->pixelformat . "
"; if($info->bitrate != "") $output .= "Bitrate: " . $info->bitrate . "
"; if($info->vBitrate != "") $output .= "Video Bitrate: " . $info->vBitrate . "
"; if($info->aBitrate != "") $output .= "Audio Bitrate: " . $info->aBitrate . "
"; if($info->samplingRate != "") $output .= "Sampling Rate: " . $info->samplingRate . "
"; if($info->vCodec != "") $output .= "Video Codec: " . $info->vCodec . "
"; if($info->aCodec != "") $output .= "Audio Codec: " . $info->aCodec . "
"; if($info->channel != "") $output .= "Channel: " . $info->channel . "
"; $output .= "Has Video: " . (boolean)$info->hasaudio . "
"; $output .= "Has Audio: " . (boolean)$info->hasaudio . "
"; $output .= "......................................................
"; $output .= "Output Information
"; $output .= "......................................................
"; $output .= "Size: " . $info->i_width . 'x' . $info->i_height . "
"; if($info->i_vBitrate != "") $output .= "Video Bitrate: " . $info->i_vBitrate . "
"; if($info->i_aBitrate != "") $output .= "Audio Bitrate: " . $info->i_aBitrate . "
"; if($info->i_SamplingRate != "") $output .= "Sampling Rate: " . $info->i_SamplingRate . "
"; if($info->i_vCodec != "") $output .= "Video Codec: " . $info->i_vCodec . "
"; if($info->i_aCodec != "") $output .= "Audio Codec: " . $info->i_aCodec . "
"; if($info->i_channel != "") $output .= "Channel: " . $info->i_channel . "
"; $output .= "Has Video: " . (boolean)$info->i_hasaudio . "
"; $output .= "Has Audio: " . (boolean)$info->i_hasaudio . "
"; echo $output;