Name

media_get_attr — retrieve the requested parameter for the specified media file

Synopsis

use Wacs;
use Wacs::WacsId;
scalar media_get_attr(filename,  
 attribute); 
scalar filename;
scalar attribute;
 

Parameters

parameterdescription
heightThe height of the video/photo in pixels
widthThe width of the video/photo in pixels
formatThe format of the file: JPEG, PNG, TIFF for images; MOV, MPEG, WMV, for videos
codecThe Codec format used - Windows Media, MPEG-2, etc
durationThe running time of a video clip
creationThe creation date in the corrext format for the current database
resolutionText name of the resolution: LD, SD, ID, HD, UHD, Mobile etc
aspectratioThe actual numeric aspect ratio as a decimal number
aspectThe generalised aspect ratio expressed as a ratio: 4:3, 16:9, etc
durhrsThe video clip duration broken up into parts - the hours component
durminThe video clip duration - the minutes component
dursecThe video clip duration - the seconds component
framerateThe video clip frame rate multiplied by 100 - thus 29.97 frames per second drop frame is 2997, and 30 frames per second non-drop is 3000. Divide by 100 before use in your applications. NB: added in Wacs 1.0.0.
bitrateThe video clip bit rate - defaults to the Average Bit Rate if given, if not it looks at the Maxmium Bit Rate. NB: added in Wacs 1.0.0.
audiochannelsNumber of audio channels - typically 2 for normal stereo content. NB: added in Wacs 1.0.0.
audiobitrateBit rate of the audio channel. NB: added in Wacs 1.0.0.
interlaceWhether the video is progressive (P), interlace (I) or unknown (U) NB: added in Wacs 1.0.0

Summary

The media_get_attr function fetches the specified result (attribute) of the media file named in the filename parameter. This is the filename provided by a previously run call to media scan to perform the actual scan itself. A number of different media scans can be queried at the same time so long as they do not have the same file name. The results are all obtained and stored during the media_scan call and are simply retrieved from a results array when using media_get_attr.

Availability

media_get_attr is available in Wacs 0.9.2 and later. The framerate request is only available in Wacs 1.0.0 and later.