Oracle
Video Server Administrator's Guide: UNIX Release 2.1.7.3 A42271_4 |
|
Topics covered in this chapter are:
Before video content files can be loaded into the Oracle Media Data Store (MDS) and made available for playback through the Oracle Video Server system, the video must first be encoded. Video encoding captures the analog video signal from the source tape and converts it to a digital signal which is then compressed. Video compression removes redundant information between frames and reduces the amount of data necessary to produce a usable image. Compressed videos can be easily transported over networks and require less disk space for storage.
This section is divided into the following sub-sections:
The MPEG group of standards addresses the compression and decompression of motion video and audio signals and the synchronization of these signals during playback. MPEG is popular because it provides the following advantages:
MPEG files are composed of three layers: video, audio, and system. The video and audio layers (also called elementary streams) contain the coded video and audio data, respectively. The system layer defines the multiplexed structure for the video and audio data as well as the timing information required to replay synchronized segments in real time. Figure 1 illustrates the general process of encoding a valid MPEG file.
There are two widely-used MPEG standards, MPEG-1 and MPEG-2. For a complete technical explanation of these standards, please refer to the appropriate specification (IEC/ISO 11172-1, 2, 3 for MPEG-1 and IEC/ISO 13818-1, 2, 3 for MPEG-2).
Like most standards, the MPEG specifications are written in general
terms to support a variety of applications and allow for future innovation.
Each
encoder/decoder vendor may interpret the specification in subtly different
ways. Therefore, to guarantee successful storage and delivery of MPEG files
over the Oracle Video Server system, it is important for you to understand
what the Oracle Video Server expects to see in an encoded MPEG file.
Oracle Video Server supports MPEG-1 files encoded at rates up to 2 Mbps. Regardless of the selected encoding rate, the MPEG-1 files must be encoded using:
I-frames, or intra-frames, are picture frames compressed using only the redundancies found within its own frame. In MPEG-1, you can only seek to I-frame boundaries. Therefore, seek requests are only as accurate as the I-frame frequency within a particular file.
For specific encoding recommendations, refer to "MPEG-1 Encoding Tips" later in this chapter.
Before encoding your video, gather the information listed in Table 4-1. If you do not own the equipment necessary to encode MPEG files, you will need to provide this information to the video production studio you employ to encode the video. As a rule, do not assume that the video production studio will know how you want your files encoded.
When selecting your system bit rate:
For a detailed discussion on planning and configuration issues related to the Oracle Video Server, refer to Chapter 2, System Planning for the Oracle Video Server.
The information in Table A-1 will usually be sufficient for the video encoder. If you require more precise control over the MPEG file, discuss it with your encoding vendor.
Not all encoder/decoder vendors handle MPEG files in exactly the same way. Before encoding and storing all your videos, first create a test file and play it from a local file system. When you find an encoding/decoding solution that works, encode the rest of your content the same way. As long as the content is MPEG-compliant, the Oracle Video Server will deliver it successfully for normal playback.
This section provides examples of how you might encode video content for delivery over an intranet. The bit rates listed in these examples are suggested, but not required.
This example encodes an MPEG-1 file at a target bit rate of 1.536 Mbps.
The combined video and audio bit rates produce a bit rate of 1,491,200. The remaining 44,800 bps is used for system information and padding.
This example encodes an MPEG-1 file at a target bit rate of 2.048 Mbps.
The combined video and audio bit rates produce a bit rate of 1,988,000. The remaining 60,000 bps is used for system information and padding.
This section contains specific encoding tips that advanced encoders should be aware of before encoding files for use with the Oracle Video Server.
The Oracle Video Server does not support the delivery of elementary streams. You must generate a valid MPEG-1 system layer content file.
The Oracle Video Server expects I-frames to be provided at regular intervals throughout the program stream. Since there is not enough bandwidth in the wire to send every frame as an I-frame, features like rate control (fast-forward, rewind, or seek) can be only as accurate as the interval between I-frames. Oracle recommends encoding 1 or 2 I-frames per second.
Some MPEG encoders allow you to define I-frame frequency with the Group of Pictures (GOP) variable. GOP size defines the number of picture frames for every I-frame. A smaller GOP will provide better response when searching through the content (I-frames are closer together), but does not provide as high a compression ratio. A GOP size of 15 provides two I-frames per second.
The MPEG specification permits Presentation Time Stamp (PTS) and System Clock Reference (SCR) data to be streamed out of sequence so long as there is a discontinuity indication in the encoded file. However, some clients query the clock from the decoder chip to identify locations within a particular file. If content is encoded with time stamps that occur out of numerical sequence or multiple times, the times become meaningless, and the decoder will have difficulty presenting the file. Oracle strongly recommends encoding PTSs and SCRs so that their values increase in a non-repeating, sequential pattern.
The MPEG-1 specification permits encoders to change the sequence header information mid-program. The sequence header contains matrices that provide critical timing, frame content, color-map, and decoding information to the client. If these matrices change in a piece of content, search functions will not work properly. Oracle recommends that you do not change the sequence header in mid-program.
Names of MDS volumes and files are not case-sensitive, although they
are
case-retentive. For example:
If you have an MDS volume created prior to Release 2.1 which uses earlier filenaming conventions, you will still be able to read those files with their previous names.
To reference a file contained in the MDS filesystem, specify /mds followed by the volume name and the filename. For example:
/mds/volume_name/filename
where:
specifies that the file is contained in the MDS filesystem
This example references the file oracle1.mpg located in the MDS filesystem in the volume video:
/mds/video/oracle1.mpg
To reference a file contained on a host filesystem, specify the pathname followed by the filename. For example:
/pathname/filename
where:
locates a file, directory, or any other object in the host filesystem
This example locates the file oracle1.mpg in the directory path
/home/video:
/home/video/oracle1.mpg
To locate a file and its path relative to the current working directory, prepend a period (.) to the pathname. For example:
./video/oracle1.mpg
To locate a file and its path relative to the directory above the current working directory prepend two periods (..) to the pathname. For example:
../home/video/oracle1.mpg
You can load content into the MDS using remote file access over a network, or using a local CD-ROM or tape drive. The OVS supports online loading. That is, you can load content at the same time the server is providing uninterrupted media streams to clients. The OVS software guarantees that content loading will not interfere with the delivery of real-time media.
Before loading content files into an MDS volume for the first time, you must initialize the volume using the mdsvolinit utility. Refer to the "Oracle Media Data Store Utilities" chapter of the Oracle Video Server Utilities User's Guide (online only) for information on mdsvolinit. Also, before initializing the volume, make any needed modifications to your MDS volume or the voltab file, such as:
Once a volume contains content files, you cannot perform any of the above operations; doing so will destroy all content. However, you can always create new volumes should you require additional storage capacity.
The utilities used to load files into the MDS are:
If the encoded video resides in a tar archive, use the mdstar utility. mdstar allows you to create or extract a tar archive between the MDS and a host filesystem or tape device.
This example extracts all files with the extension .mpg from a tape device and places them in the MDS volume video:
% mdstar -x -T -b 128 -f /dev/rmt/1m -p /mds/video "*.mpg"
where:
specifies the blocking factor to be used. In this example the blocking factor specified is 128; mdstar defaults to 20.
extracts a file from a tar archive to the specified MDS volume
This example archives the file oracle1.mpg in the MDS volume video to the device /dev/scsi/rmt8. The -c option specifies that mdstar create an archive in the location specified with -f:
% mdstar -c -T -f /dev/rmt/1m /mds/video/oracle1.mpg a oracle1.mpg, 1610612789 bytes, 1 segment(s), 293 kb/s
This example uses the default blocking factor of 20. To ensure that you are using the correct blocking factor, refer to your server platform documentation.
Note that this example and others in this section use the -T option. This option enables verbose mode, which lists additional information about actions taken on files.
This example uses a wildcard search to archive all files in the MDS volume video with the extension .mpg to a file:
% mdstar -c -T -f /tmp/film.tar "/mds/video/*.mpg" a oracle1.mpg, 1610612789 bytes, 1 segment(s), 278 kb/s a oracle2.mpg, 3610612 bytes, 1 segment(s), 289 kb/s
If the encoded video resides on a CD-ROM , removable disk drive, or host filesystem, use the mdscopy utility. mdscopy allows you to copy files from one MDS volume to another, or from a host filesystem to the MDS.
This example copies the file oracle1.mpg from the current directory on a host filesystem to the MDS volume video:
% mdscopy ./oracle1.mpg /mds/video
The mdscopy utility requires that the full MDS path of the output file be explicitly stated, or that the MDS_CWD environment variable be set to the appropriate MDS volume. For information on MDS_CWD, refer to Setting the MDS_CWD Environment Variable section of Chapter 5 "Oracle Media Data Store Tasks and Procedures."
This example uses a wildcard search to copy all files ending in .mpg from the current host directory into the MDS volume video:
% mdscopy ./*.mpg /mds/video
This example copies a file from one MDS volume to another. The file oracle1.mpg is copied from volume1 to volume2:
% mdscopy /mds/volume1/oracle1.mpg /mds/volume2/oracle1.mpg
For further information on mdstar and mdscopy, refer to
the "Oracle Media Data Store Utilities" chapter in the Oracle
Video Server Utilities User's
Guide (online only).
Tag files store information about a given piece of content such as filename, file type, bit rate, and file size. For each content file that you load into the MDS, you must use the vstag utility to create a tag file and store it in the MDS with the content file.
Rate control is the ability to play video at different speeds and in different directions, to seek in either direction, to scan in either direction, or to pause and resume playback of video files.
Currently, the OVS allows you to prohibit only pause, scan forward, and scan backward operations. Other prohibitions that you specify are not implemented.
The following examples create tag files for MPEG files.
This example generates tag files for the MPEG file oracle1.mpg located in the MDS volume video. The -E option specifies the extension .mpi be added to the tag file name:
% vstag -E mpi /mds/video/oracle1.mpg
The vstag utility requires that the full MDS path of the input file be explicitly stated, or that the MDS_CWD environment variable be set to the appropriate MDS volume. For information on MDS_CWD refer to Setting the MDS_CWD Environment Variable section of Chapter 5, "Oracle Media Data Store Tasks and Procedures."
This example uses a wildcard search to tag all files with the extension .mpg in the MDS volume video. Note the use of quotes on the volume name. When using a wildcard search on an MDS volume, the full volume name must be specified in the search string:
vstag -E mpi "/mds/video/*.mpg"
To display the contents of a tag file on a terminal, use the vstagprint utility.
This example displays the tag file oracle1.mpi in the MDS volume video. oracle1.mpi is a tag file for an MPEG-1 content file. An explanation of the fields displayed is provided below:
% vstagprint /mds/video/oracle1.mpi Tag file version: 3.4 Current code is version 3.4, back-compatible to version 3.4 magic=aabbccdd (should be aabbccdd) file describes content for: 1 member files: All rate control operations are allowed on this file # 1. format=MPEG 1 transport=none flags=1 file="/mds/video/oracle1.mpg" Size = 735246204 creation time of content: Apr 12 13:04:21 bitrate=1536029 bits/second elapsed length=7120729 milliseconds presentation rate=1000 frames/sec(* 1000)=23976 5695 tags in tag file. audio PID/stream = 0/0 video PID/stream = 33/224 width: 352, height: 240, pel aspect ratio (* 10000): 10950 Tags for member file #1: 1:1, pos= 5315, PTS- 16262 [002f0005a20b0000000000000000] 2:1, pos= 231383, PTS- 128875 [0b8b0034808d0000000a00000000] 3:1, pos= 471340, PTS- 241487 [0c14003f39930000000c00010000] 4:1, pos= 711650, PTS- 354100 [0c420055891d0000000f00010000] 5:1, pos= 951971, PTS- 466712 [0c7b00570b960000001100020000] [etc.]
The output header tells you:
Each numbered line of output following the header describes a single tag point and has these fields:
|
Copyright © 1997 Oracle Corporation. All Rights Reserved. |
|