The SunVideo software includes two video-bitstream conversion tools:
mpeg_rc enables you to produce a constant bit rate MPEG-1 bitstream, which is more suitable for playback because of its fixed bit rate. Since the SunVideo software provides no molecules for Cell, mpeg_to_cell enables you to produce a full frame-rate Cell bitstream.
The SunVideo card can capture constant bit rate MPEG-1 at a rate of 18 frames per second (fps) and an I-only variable bit rate MPEG-1 bitstream at a rate of 30 fps. Therefore, the mpeg_rc tool, which converts MPEG-1 bitstreams to constant bit rate MPEG-1 bitstreams, enables you to produce a constant bit rate MPEG-1 bitstream by starting with a bitstream captured at 30 fps.
This tool produces bitstreams that have an image width of 320 and height of 240. If the source bitstream's width is greater than 320 or the height is greater than 240, a centered 320 x 240 child image is compressed.
XIL decompresses the source MPEG-1 bitstream, and then the SunVideo card's compression engine re-compresses it. The quality of the resulting constant bit rate MPEG-1 bitstream is affected by the following three variables, which can be set when you invoke the mpeg_rc tool:
The default pattern in the resulting constant bit rate MPEG-1 bitstream is IBBPBBPBBPBBPBB, but you can modify this by changing the variable's intraframe distance, the reference-frame distance, and the number-of-frames per pattern when you invoke the mpeg_rc tool. See the section "Valid SunVideo MPEG-1 Patterns" in Appendix B for a discussion of these variables.
SunVideo allocates a certain number of bits to each picture type. See the section "MPEG_WEIGHTS" in Chapter 9 for information about how weights effect bitstream quality.
Table 11-2 describes the mpeg_rc tool's arguments. Arguments without values are switches. For example, -s is a switch.
Table 11-1 Arguments for the mpeg_rc Tool
------------------------------------------------------------------------------
Argument Description Default ------------------------------------------------------------------------------
-i <filename'> The name of the MPEG-1 bitstream None - a file to convert. filename is required -o <filename'> The name of the file into which to None - a store the constant bit rate MPEG-1 filename is bitstream. required -I <intradistance'> The number of frames to the next I 15 picture. -R <ref_distance'> The number of frames to the next I 3 or P picture. -N <num_frames'> The number of frames per pattern. 15 This value must be an integer multiple of ref_distance. -D <devname'> The name of the SunVideo card to /dev/rtvc0 use for recompression. -b <bitrate'> The bit rate in bits per second. 1,150,000 -f <frames'> The number of frames to re- All of the compress. See the second example frames in the below. source bitstream -s Display compression statistics. The Do not display output for each frame is the size of the frame in bytes (in decimal and hex), the bits/pixel, and bits per second as a running average and for the last 30 frames. -t <frames_to_discard'> The number of frames to discard 0 from the source bitstream before starting compression. See the second example below. -wi <weight'> The weight associated with I 8 pictures. -wp <weight'> The weight associated with P 4 pictures. -wb <weight'> The weight associated with B 1 pictures. ------------------------------------------------------------------------------
Convert the MPEG-1 bitstream file test.mpeg to a constant bit rate MPEG-1 bitstream and store the bitstream in the file test.cbr. Set the weights of the pictures to I=10, P=6, and B=1 (B=1 is the default).
% /opt/SUNWrtvc/bin/mpeg_rc -i test.mpeg -o test.cbr -wi 10 -wp 6
Convert the MPEG-1 bitstream file test.mpeg to a constant bit rate MPEG-1 bitstream and store the bitstream in the file test.cbr. Encode only frames 100 to 599 of the given bitstream (assuming frame numbers start at 0).
% /opt/SUNWrtvc/bin/mpeg_rc -i test.mpeg -o test.cbr -t 100 -f 500
While there are SunVideo molecules for CellB, there are none for Cell. Therefore, the SunVideo card cannot directly produce a full frame-rate Cell bitstream. Since the card can capture MPEG-1 frames at full frame rates (if MPEG_RATE_CONTROL is set to FALSE), the mpeg_to_cell tool enables you to produce a full frame-rate Cell bitstream.
mpeg_to_cell is an XIL program; it does not use the SunVideo card. It uses XIL to decompress MPEG-1 frames and re-compress them as Cell frames.
Table 11-2 describes the mpeg_to_cell tool's arguments. Arguments without values are switches. For example, -h is a switch.
Table 11-2 Arguments for the mpeg_to_cell Tool
-------------------------------------------------------------------------------
Argument Description Default -------------------------------------------------------------------------------
-i <filename'> The name of the MPEG-1 bitstream file to None - a filename convert. is required -o <filename'> The name of the file into which to store None - a filename the Cell bitstream. is required -v Turn on verbose mode. When verbose Verbose mode off mode is on, error messages about the status of the conversion are display at the local workstation. -h Print a help message about the tool. Do not print a help message -------------------------------------------------------------------------------
Convert the MPEG-1 bitstream file mymovie.mpeg to a Cell bitstream and store the bitstream in the file mymovie.cell.
% /opt/SUNWrtvc/bin/mpeg_to_cell -i mymovie.mpeg -o mymovie.cell