Oracle® interMedia
Reference
10g Release 1 (10.1)
Part No. B10829-01
December 2003
Oracle interMedia ("interMedia") is a feature that enables
Oracle Database to store, manage, and retrieve images,
audio, video, or other heterogeneous media data in an
integrated fashion with other enterprise information.
Oracle interMedia extends Oracle Database reliability,
availability, and data management to multimedia content
in Internet, electronic commerce, and media-rich
applications.
Oracle interMedia Reference, 10g Release 1 (10.1)
Part No. B10829-01
Copyright © 1999, 2003 Oracle Corporation. All rights reserved.
Primary Author: Ingrid Stuart
Contributor: Rod Ward, Susan Mavris, Melli Annamalai, Todd Rowell, Raja Chatterjee, Robert Abbott,
Albert Landeck, Vishal Rao, Dongbai Guo, Fengting Chen, Manjari Yalavarthy, Joseph Mauro, Rabah
Mediouni, Sanjay Agarwal, Bill Voss, Susan Kotsovolos, Rosanne Toohey, Bill Beauregard, Susan
Shepard, Helen Grembowicz
The Programs (which include both the software and documentation) contain proprietary information of
Oracle Corporation; they are provided under a license agreement containing restrictions on use and
disclosure and are also protected by copyright, patent and other intellectual and industrial property
laws. Reverse engineering, disassembly or decompilation of the Programs, except to the extent required
to obtain interoperability with other independently created software or as specified by law, is prohibited.
The information contained in this document is subject to change without notice. If you find any problems
in the documentation, please report them to us in writing. Oracle Corporation does not warrant that this
document is error-free. Except as may be expressly permitted in your license agreement for these
Programs, no part of these Programs may be reproduced or transmitted in any form or by any means,
electronic or mechanical, for any purpose, without the express written permission of Oracle Corporation.
1.2 Multimedia Storage............................................................................................................... 1-1
2 Ensuring Compatibility with Evolving interMedia Object Types
2.1 When and How to Call the Compatibility Initialization Function ................................ 2-2
compatibilityInit( ) ................................................................................................................ 2-3
3 Common Methods for interMedia Object Types
3.1 Embedded ORDSource Object ............................................................................................ 3-2
3.2 Important Notes .................................................................................................................... 3-2
3.3 Methods .................................................................................................................................. 3-3
clearLocal( ) ............................................................................................................................ 3-5
iv
closeSource( ).......................................................................................................................... 3-6
deleteContent( )...................................................................................................................... 3-8
export( )................................................................................................................................... 3-9
getBFile( ) .............................................................................................................................. 3-13
getContent( )......................................................................................................................... 3-15
getMimeType( ).................................................................................................................... 3-16
getSource( )........................................................................................................................... 3-18
getSourceLocation( )............................................................................................................ 3-20
getSourceName( ) ................................................................................................................ 3-22
getSourceType( ).................................................................................................................. 3-24
getUpdateTime( )................................................................................................................. 3-26
isLocal( )................................................................................................................................ 3-27
openSource( )........................................................................................................................ 3-28
processSourceCommand( ) ................................................................................................ 3-30
readFromSource( )............................................................................................................... 3-32
setLocal( ).............................................................................................................................. 3-35
setMimeType( ) .................................................................................................................... 3-37
setSource( )............................................................................................................................ 3-39
setUpdateTime( ) ................................................................................................................. 3-41
trimSource( )......................................................................................................................... 3-43
setNumberOfChannels( ) ............................................................................................ 4-49
setProperties( ).............................................................................................................. 4-50
setSamplingRate( ) ....................................................................................................... 4-52
setSampleSize( )............................................................................................................ 4-53
5 ORDDoc
ORDDoc Object Type............................................................................................................ 5-3
ORDDoc Constructors.......................................................................................................... 5-6
init( ) for ORDDoc.......................................................................................................... 5-7
init(srcType,srcLocation,srcName) for ORDDoc....................................................... 5-9
ORDDoc Methods ............................................................................................................... 5-11
getContentInLob( )....................................................................................................... 5-12
vi
getContentLength( )..................................................................................................... 5-14
getFormat( )................................................................................................................... 5-15
import( ) ......................................................................................................................... 5-16
importFrom( )................................................................................................................ 5-19
setFormat( ) ................................................................................................................... 5-22
setProperties( ) .............................................................................................................. 5-24
6 ORDImage and ORDImageSignature
ORDImage Object Type........................................................................................................ 6-3
ORDImage Constructors ............................................................................................... 6-7
init( ) for ORDImage............................................................................................... 6-8
init(srcType,srcLocation,srcName) for ORDImage.......................................... 6-10
ORDImage Methods .................................................................................................... 6-12
checkProperties( ).................................................................................................. 6-13
copy( ) ..................................................................................................................... 6-15
getCompressionFormat( ) .................................................................................... 6-17
getContentFormat( ).............................................................................................. 6-18
getContentLength( ).............................................................................................. 6-19
getFileFormat( ) ..................................................................................................... 6-20
SI_Color Method .......................................................................................................... 7-17
SI_RGBColor( ) ...................................................................................................... 7-18
SI_ColorHistogram Object Type ....................................................................................... 7-20
SI_ColorHistogram Constructors .............................................................................. 7-22
SI_ColorHistogram(colors, frequencies)............................................................ 7-23
SI_ColorHistogram(firstColor, frequency)........................................................ 7-26
SI_ColorHistogram(sourceImage)...................................................................... 7-28
SI_ColorHistogram Methods...................................................................................... 7-30
SI_Append( ).......................................................................................................... 7-31
SI_Score( ) for SI_ColorHistogram ..................................................................... 7-33
SI_FeatureList Object Type ................................................................................................ 7-36
SI_FeatureList Constructor ......................................................................................... 7-39
SI_FeatureList( ) .................................................................................................... 7-40
viii
SI_FeatureList Methods............................................................................................... 7-44
SI_AvgClrFtr( ) ...................................................................................................... 7-45
SI_AvgClrFtrWght( ) ............................................................................................ 7-47
SI_ClrHstgrFtr( ).................................................................................................... 7-49
SI_ClrHstgrFtrWght( ).......................................................................................... 7-51
SI_PstnlClrFtr( )..................................................................................................... 7-53
SI_PstnlClrFtrWght( ) ........................................................................................... 7-55
SI_Score( ) for SI_FeatureList .............................................................................. 7-57
SI_SetFeature(averageColorFeature, averageColorFeatureWeight).............. 7-60
SI_SetFeature(colorHistogramFeature, colorHistogramFeatureWeight) ..... 7-62
SI_SetFeature(positionalColorFeature, positionalColorFeatureWeight) ...... 7-64
SI_SetFeature(textureFeature, textureFeatureWeight) .................................... 7-66
SI_TextureFtr( )...................................................................................................... 7-68
SI_TextureFtrWght( )............................................................................................ 7-70
SI_PositionalColor Object Type......................................................................................... 7-72
SI_PositionalColor Constructor.................................................................................. 7-73
ORDVideo Object Type ........................................................................................................ 8-3
ORDVideo Constructors ...................................................................................................... 8-8
init( ) for ORDVideo ...................................................................................................... 8-9
init(srcType,srcLocation,srcName) for ORDVideo ................................................. 8-11
ORDVideo Methods............................................................................................................ 8-13
checkProperties( )......................................................................................................... 8-15
getAllAttributes( ) ........................................................................................................ 8-17
getAttribute( ) ............................................................................................................... 8-19
getBitRate( )................................................................................................................... 8-21
getCompressionType( ) ............................................................................................... 8-22
getContentInLob( )....................................................................................................... 8-23
getContentLength( )..................................................................................................... 8-25
getDescription( )........................................................................................................... 8-26
getFormat( )................................................................................................................... 8-27
getFrameRate( ) ............................................................................................................ 8-28
getFrameResolution( ) ................................................................................................. 8-29
x
getFrameSize( ) ............................................................................................................. 8-30
getNumberOfColors( )................................................................................................. 8-32
getNumberOfFrames( ) ............................................................................................... 8-33
getVideoDuration( ) ..................................................................................................... 8-34
import( ) ......................................................................................................................... 8-35
importFrom( )................................................................................................................ 8-37
processVideoCommand( )........................................................................................... 8-40
setBitRate( ) ................................................................................................................... 8-42
setCompressionType( )................................................................................................ 8-43
setDescription( )............................................................................................................ 8-44
setFormat( ) ................................................................................................................... 8-46
setFrameRate( ) ............................................................................................................. 8-48
setFrameResolution( ).................................................................................................. 8-49
processCopy( ) for BFILEs .......................................................................................... 9-57
Static Methods Unique to the ORDVideo Object Type Relational Interface .............. 9-59
getProperties( ) for BLOBs .......................................................................................... 9-62
getProperties( ) (all attributes) for BLOBs ................................................................ 9-64
getProperties( ) for BFILEs.......................................................................................... 9-68
getProperties( ) (all attributes) for BFILEs................................................................ 9-70
10 ORDSource
ORDSource Object Type..................................................................................................... 10-2
ORDSource Methods .......................................................................................................... 10-6
clearLocal( )................................................................................................................... 10-8
close( ) ............................................................................................................................ 10-9
deleteLocalContent( )................................................................................................. 10-11
export( )........................................................................................................................ 10-12
getBFile( )..................................................................................................................... 10-15
getContentInTempLob( )........................................................................................... 10-16
getContentLength( )................................................................................................... 10-18
getLocalContent( )...................................................................................................... 10-19
getSourceAddress( )................................................................................................... 10-20
xii
getSourceInformation( )............................................................................................. 10-22
getSourceLocation( ) .................................................................................................. 10-23
getSourceName( )....................................................................................................... 10-24
getSourceType( )......................................................................................................... 10-25
getUpdateTime( )........................................................................................................ 10-26
import( ) ....................................................................................................................... 10-27
importFrom( ).............................................................................................................. 10-29
isLocal( )....................................................................................................................... 10-31
open( ) .......................................................................................................................... 10-32
processCommand( ) ................................................................................................... 10-34
read( ) ........................................................................................................................... 10-36
D.1.3 Operator and Value ....................................................................................................... D-2
D.1.4 Combining Operators.................................................................................................... D-2
D.2 Image Formatting Operators ............................................................................................... D-2
D.2.1 fileFormat ........................................................................................................................ D-3
D.2.2 contentFormat................................................................................................................. D-3
D.2.3 compressionFormat ....................................................................................................... D-7
D.2.4 compressionQuality....................................................................................................... D-9
D.3 Image Processing Operators................................................................................................ D-9
D.3.1 contrast ............................................................................................................................ D-9
D.3.2 cut ................................................................................................................................... D-10
D.3.3 flip................................................................................................................................... D-10
D.3.4 gamma ........................................................................................................................... D-11
D.3.5 mirror............................................................................................................................. D-11
D.3.6 page ................................................................................................................................ D-11
D.3.7 quantize ......................................................................................................................... D-11
D.3.8 rotate .............................................................................................................................. D-13
D.3.9 Scaling Operators ......................................................................................................... D-14
D.3.9.1 fixedScale................................................................................................................ D-14
D.3.9.2 maxScale................................................................................................................. D-14
D.3.9.3 scale......................................................................................................................... D-15
D.3.9.4 xScale ...................................................................................................................... D-15
D.3.9.5 yScale ...................................................................................................................... D-16
D.3.10 tiled................................................................................................................................. D-16
xiv
D.4 Format-Specific Operators ................................................................................................ D-16
D.4.1 channelOrder ............................................................................................................... D-16
D.4.2 pixelOrder .................................................................................................................... D-16
D.4.3 scanlineOrder............................................................................................................... D-17
D.4.4 inputChannels.............................................................................................................. D-17
E Image Raw Pixel Format
List of Tables
6–1 Image Processing Operators ............................................................................................. 6-28
6–2 Additional Image Processing Operators for Raw Pixel and Foreign Images ............ 6-31
6–3 Image Characteristics for Foreign Files........................................................................... 6-39
7–1 SI_IMAGE_FORMATS View .......................................................................................... 7-130
7–2 SI_IMAGE_FORMAT_CONVERSIONS View............................................................. 7-130
7–3 SI_IMAGE_FORMAT_FEATURES View...................................................................... 7-131
7–4 SI_THUMBNAIL_FORMATS View .............................................................................. 7-131
7–5 SI_VALUES View ............................................................................................................. 7-132
A–1 Supported AIFF-C Data Compression Formats and Types ........................................... A-2
A–2 AU Data Compression Formats and Types...................................................................... A-3
A–3 Audio MPEG1 and MPEG2 Compression Formats and Types ..................................... A-5
A–4 WAV Data Compression Formats and Types .................................................................. A-6
B–1 I/O Support for Image File Content Format Characteristics ....................................... B-12
B–2 I/O Support for Image File Compression Formats ....................................................... B-13
B–3 I/O Support for Image File Formats Other Than Content and Compression........... B-15
C–1 Supported Apple QuickTime 3.0 Data Compression Formats ...................................... C-1
C–2 Supported AVI Data Compression Formats..................................................................... C-2
E–1 Raw Pixel Image Header Structure.................................................................................... E-2
xvii
Send Us Your Comments
Oracle interMedia Reference, 10g Release 1 (10.1)
Part No. B10829-01
Oracle Corporation welcomes your comments and suggestions on the quality and usefulness of this
publication. Your input is an important part of the information used for revision.
■
Did you find any errors?
■
Is the information clearly presented?
■
This guide is for application developers and database administrators who are
interested in storing, retrieving, and manipulating audio, image, and video data in
Oracle Database, including developers of audio, image, and video specialization
options. Before using this reference, you should familiarize yourself with the
concepts presented in Oracle interMedia User's Guide.
If you are interested in only one particular object type, see Chapter 1 for general
introductory information, then, for a description of the methods that are common
for all object types, refer to Chapter 3. If, for example, you are interested in the
ORDImage object type, refer to Chapter 6, the ORDImage reference chapter for a
description of the image-specific methods.
For a description of using the relational interface with images, see Chapter 9.
For information on supported image content and compression formats, see
Appendix B. For information about using image processing methods, see
Appendix D. Finally, for information about the raw pixel image format, see
Appendix E.
xx
Documentation Accessibility
Our goal is to make Oracle products, services, and supporting documentation
accessible, with good usability, to the disabled community. To that end, our
documentation includes features that make information available to users of
assistive technology. This documentation is available in HTML format, and contains
markup to facilitate access by the disabled community. Standards will continue to
evolve over time, and Oracle Corporation is actively engaged with other
market-leading technology vendors to address technical obstacles so that our
documentation can be accessible to all of our customers. For additional information,
visit the Oracle Accessibility Program Web site at
http://www.oracle.com/accessibility/
Accessibility of Code Examples in Documentation
JAWS, a Windows screen
reader, may not always correctly read the code examples in this document. The
Provides reference information on SQL/MM Still Image object types, methods, SQL
functions and procedures, and views that identify the supported image formats and
implementation-defined values
Chapter 8, "ORDVideo"
Provides reference information on Oracle interMedia ORDVideo object type and
methods.
Chapter 9, "interMedia Relational Interface Reference"
Provides reference information on Oracle interMedia relational interface methods
for the ORDAudio, ORDDoc, ORDImage, and ORDVideo object types.
Chapter 10, "ORDSource"
Provides reference information on Oracle interMedia ORDSource object type and
methods.
Appendix A, "Audio File and Compression Formats"
Describes the supported audio data formats.
Appendix B, "Image File and Compression Formats"
Describes the supported image data formats.
Appendix C, "Video File and Compression Formats"
Describes the supported video data formats.
xxii
Appendix D, "Image process( ) and processCopy( ) Operators"
Describes the process( ) and processCopy( ) operators.
Appendix E, "Image Raw Pixel Format"
Describes the raw pixel format.
Appendix F, "Exceptions and Error Messages"
Lists exceptions raised, their causes, and user actions to correct them.
Appendix G, "Deprecated Audio and Video Methods"
Lists the ORDAudio and ORDVideo get methods that were deprecated in release
8.1.6
Related Documentation
For more information about using interMedia in a development environment, see
For reference information on both Oracle interMedia Java Classes and Oracle
interMedia Java Classes for Servlets and JSP in Javadoc format, see the Oracle API
documentation (also known as Javadoc). The API documentation is available on the
Oracle Database 10g Documentation CD-ROM and also from the documentation
section of the Oracle Technology Network (OTN) Web site at
http://otn.oracle.com/documentation/
Note that the information in the reference sections of Oracle interMedia Java Classes
Reference supersedes the Javadoc documentation.
Many of the examples in this book use the sample schemas of the seed database,
which is installed by default when you install Oracle. Refer to Oracle Database
Sample Schemas for information on how these schemas were created and how you
can use them yourself.
Printed documentation is available for sale in the Oracle Store at
http://oraclestore.oracle.com/
To download free release notes, installation documentation, white papers, or other
collateral, please visit the Oracle Technology Network (OTN). You must register
online before using OTN; registration is free and can be done at
http://otn.oracle.com/membership/
If you already have a user name and password for OTN, then you can go directly to
the documentation section of the OTN Web site at
http://otn.oracle.com/documentation/
Conventions
In this guide, Oracle interMedia is sometimes referred to as interMedia.
In examples, an implied carriage return occurs at the end of each line, unless
otherwise noted. You must press the Return key at the end of a line of input.
xxiv
The following conventions are also used in this guide:
Changes to This Guide
The following substantive changes have been made to this guide since release 9.0.1:
■
Introduction to Oracle interMedia
Oracle interMedia ("interMedia") is a feature that enables Oracle Database to store,
manage, and retrieve images, audio, video, or other heterogeneous media data in an
integrated fashion with other enterprise information. Oracle interMedia extends
Oracle Database reliability, availability, and data management to multimedia
content in traditional, Internet, electronic commerce, and media-rich applications.
See Oracle interMedia User's Guide for conceptual information and information on
application development.
1.1 Multimedia Object Types and Methods
Oracle interMedia provides the ORDAudio, ORDDoc, ORDImage,
ORDImageSignature, ORDVideo, and SI_StillImage object types and methods for:
■
Extracting metadata and attributes from multimedia data
■
Getting and managing multimedia data from Oracle interMedia, Web servers,
file systems, and other servers
■
Performing manipulation operations on image data
1.2 Multimedia Storage
Oracle interMedia provides the ORDSource object type and methods for multimedia
data source manipulation. The ORDAudio, ORDDoc, ORDImage, and ORDVideo
object types all contain an attribute of type ORDSource.