Applications can use AIV Extenders by calling UDFs in SQL statements or by calling the AIV Extender API. Calling UDFs is the preferred method of using AIV Extenders from remote clients because they do not require the AIV Extenders client to be installed locally. Applications linking to the API must have AIV Extenders server or client installed on the same machine.
Many UDFs are available to extend SQL functionality for media data. AIV Extenders can be used to display and play video and audio clips. It also can use QBICs for searching images by content, and detecting a scene change in a video. Some UDFs are available for more than one media type. Some UDFs are available for all three. Table 17.1 lists some of the UDFs that are available and the media types they support.
Function | Description | Media Types |
---|---|---|
AlignValue | Returns the number of bytes per sample in a WAVE audio or in an audio track of a video | Audio and Video |
AspectRatio | Returns the aspect ratio of the first track of an MPEG1 and MPEG2 video | Video |
BitsPerSample | Returns the number of bits of data used to represent each sample of WAVE or AIFF audio in an audio or in an audio track of a video | Audio and Video |
BytesPerSec | Returns the data transfer rate in average bytes per second for a WAVE audio | Audio |
Comment | Returns or updates a comment stored with an image, audio, or video | All |
CompressType | Returns the compression format, such as MPEG-1, of a video | Video |
Content | Retrieves or updates the content of an image, audio, or video from a database | All |
DB2Audio | Stores the content of an audio in a database table | Audio |
DB2Image | Stores the content of an image in a database table | Image |
DB2Video | Stores the content of a video in a database table | Video |
Duration | Returns the duration (that is, playing time in seconds) of a WAVE or AIFF audio, or video | Audio and Video |
Filename | Returns the name of the server file that contains the contents of an image, audio, or video | All |
FindInstrument | Returns the track number of the first occurrence of a specified instrument in a MIDI audio | Audio |
FindTrackName | Returns the number of a specified named track in a MIDI audio | Audio |
Format | Returns the format of an image, audio, or video | All |
FrameRate | Returns the throughput of a video in frames per second | Video |
GetInstruments | Returns the instrument name of all instruments in a MIDI audio | Audio |
GetTrackNames | Returns the name of all tracks in a MIDI audio | Audio |
Height | Returns the height, in pixels, of an image or video frame | Image and Video |
Importer | Returns the user ID of the person who stored an image, audio, or video in a database table | All |
ImportTime | Returns a timestamp that indicates when an image, audio, or video was stored in a database table | All |
MaxBytesPerSec | Returns the maximum throughput of a video in bytes per second | Video |
NumAudioTracks | Returns the number of audio tracks in a video or MIDI audio | Audio and Video |
NumChannels | Returns the number of recorded audio channels in a WAVE or AIFF audio or video | Audio and Video |
NumColors | Returns the number of colors in an image | Image |
NumFrames | Returns the number of frames in a video | Video |
NumVideoTracks | Returns the number of video tracks in a video | Video |
QbScoreFromName | Returns the score of an image (uses a named query object) | Image |
QbScoreFromStr | Returns the score of an image (uses a query string) | Image |
QbScoreTBFromName | Returns a table of scores for an image column (uses a named query object) | Image |
QbScoreTBFromStr | Returns a table of scores for an image column (uses a query string) | Image |
Replace | Updates the content of an image, audio, or video stored in a database, and updates its comment | All |
SamplingRate | Returns the sampling rate of a WAVE or AIFF audio, or of an audio track in a video, in number of samples per second | Audio and Video |
Size | Returns the size of an image, audio, or video in bytes | All |
Thumbnail | Returns or updates a thumbnail-size version of an image or video frame stored in a database | Image and Video |
TicksPerQNote | Returns the clock speed of a recorded MIDI audio, in ticks per quarter note | Audio |
TicksPerSec | Returns the clock speed of a recorded MIDI audio, in ticks per second | Audio |
Updater | Returns the user ID of the person who last updated an image, audio, or video in a database table | All |
UpdateTime | Returns a timestamp that indicates when an image, audio, or video in a database table was last updated | All |
Width | Returns the width in pixels of an image or video frame | Image and Video |
UDFs are a subset of the available AIV Extender APIs. In addition to displaying and playing video and audio clips, searching images by content, and detecting a scene change in a video, API functions also can be used to prepare and maintain a database for AIV Extenders. Applications calling AIV Extender API functions must be executed locally on the database search or on a DB2 client with the AIV Extender client installed.
3.137.186.178