media_get_attr — retrieve the requested parameter for the specified media file
use Wacs;
use Wacs::WacsId;
scalar media_get_attr( | filename, | |
attribute) ; |
scalar filename
;scalar attribute
;parameter | description |
---|---|
height | The height of the video/photo in pixels |
width | The width of the video/photo in pixels |
format | The format of the file: JPEG, PNG, TIFF for images; MOV, MPEG, WMV, for videos |
codec | The Codec format used - Windows Media, MPEG-2, etc |
duration | The running time of a video clip |
creation | The creation date in the corrext format for the current database |
resolution | Text name of the resolution: LD, SD, ID, HD, UHD, Mobile etc |
aspectratio | The actual numeric aspect ratio as a decimal number |
aspect | The generalised aspect ratio expressed as a ratio: 4:3, 16:9, etc |
durhrs | The video clip duration broken up into parts - the hours component |
durmin | The video clip duration - the minutes component |
dursec | The video clip duration - the seconds component |
framerate | The 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. |
bitrate | The 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. |
audiochannels | Number of audio channels - typically 2 for normal stereo content. NB: added in Wacs 1.0.0. |
audiobitrate | Bit rate of the audio channel. NB: added in Wacs 1.0.0. |
interlace | Whether the video is progressive (P), interlace (I) or unknown (U) NB: added in Wacs 1.0.0 |
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
.