Editing Video Files
If you want to edit your video files, you have two
options: you can edit your .rm files or you can edit your original
source files.
Editing the original source files is the editing
method of choice. Encoded video is stored in indivisible clips
of varying duration depending on the encoding algorithm and the
video bit rate. This limits how precisely encoded video can be
cut and pasted.
RealVideo Encoder is distributed with a Windows editing
utility, RMTools, and three command line editing utilities for
UNIX and DOS: RMEdit, RMPaste and RMDump which enable simple editing
of RealVideo files.
RMTools, the Windows 95 and Windows NT editing utility,
is installed with RealVideo Encoder. Windows 3.1 is not supported.
This utility enables you to perform three basic editing tasks:
- Edit the file properties
- Examine the contents of a file
- Edit the data of a file.
RMTools allows you to edit the static information
about the file: title, author, copyright, and comment; and the
stream name and mime type for each individual stream. You can
also enable or disable PerfectPlay or Selective Record. Editing
the file properties does not affect the data.
To edit file properties of RealVideo files using
RMTools:
- From the RVEncode folder, double-click
RMTools.exe (or you can double-click the icon if you create
a Windows shortcut). The RealMedia Tools window appears. Notice
the window is divided into two panes, the source file pane on
top and the destination file pane on the bottom.
- Select Open Source from the File menu.
The Open File dialog box displays. Select the file you want to
edit. The file properties information is displayed in the source
file window. To sort by the stream attribute, click the column.
You can also resize the columns by placing the cursor over the
column border and then clicking-and-dragging.
- Select File Properties from the Edit menu.
The File Properties dialog box appears. The file name is displayed
in the source box and in the destination box. New file names can
be selected by clicking Browse and selecting a new file from the
dialog box.
- To save changes to the existing file, do not
change the destination file name. To save the changes to a new
file, click Browse to select or enter a different name
in the destination box.
- Type the new title name, author, copyright information,
and any comment in the appropriate boxes. (You can also type a
new title, author, copyright, or comment directly in the fields
on the source and destination panes.)
- The total number of streams is listed in the
Stream Properties box. If you want to change the name or the mime
type of one stream, select the stream to be changed by clicking
the up or down arrow.
- If you want to change the stream name, type the
new name in the Stream Name box.
- Changing the mime type is recommended for advanced
users only. If you are certain you wish to change the mime type,
type the new mime type in the Mime Type box. If you change the
mime type, the following warning will appear after you have applied
the changes.
- RealPlayer users with low bandwidth modems can
experience files encoded for a higher bandwidth by partially downloading
audio data before beginning playback. If you want to allow this,
check the PerfectPlay checkbox in the Flag box.
- If you want to allow RealPlayer Plus users to
save your clip to disk, check the Selective Record checkbox.
- Click Apply. The changes are applied to
the file and displayed in the source file pane of the RealMedia
Tools window.
Examining the Contents of a RealVideo File
RMTools enables you to view the contents of an .rm
file by dumping the contents to a text file. You can then edit
or print the file as you would any other text file.
To examine the contents of a RealVideo file:
- Select New Session from the File menu.
- Open the Source file from the File menu. The
file information is displayed in the source pane.
- Select Dump from the File menu. The Dump
As dialog box appears. The default name is the same as the source
file name, with the extension changed to .txt. You may also select
or enter another dump file name.
- Click Save. You will be prompted to view
the file now. Click Yes.
- The following error message may appear. Click
Yes. The Notepad or WordPad window displays the contents
of the file.
- You can view, edit, and print the file just as
you would any other text file.
Editing RealVideo Data
RMTools allows simple editing of .rm files. You can
put multiple clips in one file; you can shorten the length of
a clip; and you can take a video stream from one file and add
the audio stream from another file. When working with more than
one file, streams of the same mime type must have the same encoding
parameters if they are going to be pasted together.
To place two RealVideo clips in one file:
- Select New Session from the
File menu.
- Select Open Source from the
File menu. The Open File dialog box appears.
- Select the file you want to edit. Click Open.
The source file pane displays the stream number, the stream name,
mime type, and the start and end times.
- Select Copy from the Edit menu. The Copy
dialog box appears.
- In the Stream Number box, accept the default,
All Streams.
- Do not change the start and end times. Click
Copy.
- Select Paste from the Edit menu. The Paste
dialog box appears.
- Click Paste. The destination pane displays
the stream number, source file, mime type, start time and end
time.
- Right-click the source pane. A shortcut menu
appears. Click Open Source. Choose a second clip to be
added at the end of the first clip. (Both clips must have the
same encoding parameters.)
- Click Open. The source pane displays the
information from the new file while the destination pane displays
the information from the streams that were previously pasted.
- Select Copy from the Edit menu.
- Accept the default, All Streams, and the
start and end times. Click Apply.
- Right-click the destination pane. A shortcut
menu appears. Click Paste. The Paste dialog box appears.
The previous end time displays as the new start time.
- Click Paste. The second clip is listed
below the first clip.
- If the following warning displays, you must select
a different clip or re-encode the clip so that the encoding parameters
are the same.
- Select Save As from the File menu. The
Save As dialog box appears.
- Type the new file name. Click Save.
- Use RealPlayer to view the new file.
To put the video stream of one file with the audio
stream of another:
- Select New Session from the File menu.
- Select Open Source from the
File menu. The Open File dialog box appears.
- Select the first file you want to edit. Click
Open. The source file pane displays the information from
the file.
- Select Copy from the Edit menu. The Copy
dialog box appears.
- In the Stream Number box, select the stream that
contains the video. Click Copy.
- Select Paste from the Edit menu. The Paste
dialog box appears.
- Click Paste. The destination pane displays
the information from the new file. Notice only the video stream
has been pasted into the destination pane.
- Right-click the source file pane. A shortcut
menu appears. Click Open Source.
- Choose a second file with the same encoding parameters
as the first clip, and of approximately the same duration. Click
Open. The source pane displays the information from the
file.
- Right-click the source pane. A shortcut menu
appears. Click Copy. The Copy dialog box appears.
- In the Stream Number box, select the stream that
contains the audio.
- Do not change the start and end times. Click
Copy.
- Right-click the destination pane. A shortcut
menu appears. Click Paste. The Paste dialog box appears.
Click Paste. The audio stream is listed below
the video stream. Notice both streams have the same start time,
and should have similar end times.
- Select Save As from the File menu. The
Save As dialog box appears.
- Type the new file name. Click Save.
- Use RealPlayer to view the new file.
The RealVideo file editing tools, RMCut, RMPaste,
RMEdit, and RMDump are run from a UNIX or DOS command line. The
RMCut tool is used to cut a specific portion of a RealVideo file
without changing the original source. The RMPaste tool is used
to combine two or more RealVideo files. The RMEdit tool is used
to modify the title, author, copyright, comment, mime type, or
stream name. It can also be used to print the current values for
the file or stream. The RMDump tool is used to examine the contents
of a RealVideo file.
Editing RealVideo Files
RMEdit has five separate forms. The first form modifies
any or all of the title, author, copyright, and comment for the
file.
rmedit -i <input> -o <output> [-t
<title>]
[-a <author>] [-c <copyright>]
[-C <comment>]
The second form modifies any or all of mime type
and stream name for the selected stream.
rmedit -i <input> -o <output> (-S
<stream number> [-m <mimetype>] [-s <stream name>])
The third form prints out the current values for
the file and for each stream that RMEdit is capable of modifying.
rmedit -i <input>
The fourth form sets or clears Perfect Play mode
and Selective Record.
rmedit -i <input> -o <output> [-r
[ON|OFF]] [-p [ON|OFF]]
The fifth form prints the RMDump version and copyright notice.
rmedit -v
where:
<input> is the path and file name to the input file.
<output> is the path to the output file that contains the edited file.
<title> is the title text.
<author> is the author text.
<copyright> is the copyright text.
<comment> is the comment text.
<stream number> is the stream number for the following two parameters. (May be
repeated for any number of streams.)
<mimetype> is the mimetype for a specified stream.
<stream name> is the stream name for a specified stream.
-v prints the RMDump version and copyright notice.
-p is the perfect play mode.
-r is the set/clears selective record.
Note Only valid mime types (those accepted by the player) should be entered in the mime type
field.
Note Input and output file names must not be the same.
The following examples demonstrate the use of the RMEdit tool:
- To create a new file modifying the title, enter:
rmedit -ioriginal.rm -onewfile.rm -t"My New Title"
- To change the stream name of stream 1, enter:
rmedit -ioriginal.rm -onewfile.rm -S1 \-s"New Stream Name"
- To display the current contents of the file,
enter:
rmedit -ioriginal.rm
Note Long file names are acceptable, but file names containing spaces must be contained
in quotes.
Cutting RealVideo Files
Use the RMCut tool to cut a specific portion of a
RealVideo file without modifying the original source. A cut is
made by setting the start and end times for individual streams.
Not entering a start time defaults to the beginning of the file
and likewise, not entering an end time defaults to the end of
the file. RMCut can be used without RMPaste to remove the front
or end of a file.
To create a copy of a piece of a RealVideo file:
- View your original RealVideo file
to determine the start and end times of the segment you want to
copy (you can read the times on the status bar of RealPlayer).
- Create a copy by typing:
rmcut -i <input> ([-S <stream>] [-s <start>] \
[-e <end>]) -o <output> -v
where:
<input> is the path to the input file
<stream> is the stream number. If not specified, all streams are used.
It can be repeated to grab one or more streams.
<start> is the start time in Days:Hours:Minutes:Seconds.Milliseconds format.
If missing, this parameter defaults to the beginning of the file.
<end>
is the end time in Days:Hours:Minutes:Seconds.Milliseconds format.
If missing, this parameter defaults to the end of the start+input
length. (Multiple start end sequences can be used to cut discontinuous
portions of the stream.)
<output>
is the path to the output file that contains the edited file.
-v is the print version
and copyright notice
Note An image map stream's start and end times must go from the beginning to
the end of the file. Use RMCut to strip out the image map before
working with the RealVideo file. Then, to alter and re-merge the
image map file with the video image, refer to Image Maps.
The following examples demonstrate the use of the RMCut tool.
- To create a new file with only stream zero, enter:
rmcut -i source.rm -o cutfile.rm -S0
- To create a new file with the first 30 seconds of stream 0:
rmcut -i source.rm -o cutfile.rm -s0.0 -e30.0
- To create a new file with the first
30 second of stream 0 and with the first 45 seconds of stream
1, enter:
rmcut -i source.rm -o cutfile.rm \
-S0 -s0.0 -S1 -s0.0 -e45.0
Examining the Contents of RealVideo Files
RMDump is used to examine the contents of a RealVideo
file. RMDump accepts two input parameters: the input file and
the output file.
To use RMDump, type:
rmdump -i <infile> -o <outfile> rmdump -v
Where:
<infile> is the input .rm extension file
<outfile> is the output text file (use a text editor to view)
<-v> prints the RMDump version and copyright notice.
An example of how to run RMDump is shown below:
Example
>rmdump -i input.rm -o out.txt
dumping input.rm to out.txt . . .
dumping realmedia headers . . .
dumping stream packets
dumping stream 0 . . .
dumping stream 1 . . .
done
! Elapsed time = 556 milliseconds
The next step is to use an editor like Notepad on
Windows NT/95, or vi on UNIX to examine the contents of the RMDump.
RealMedia File: input.rm
================
RM_HEADER_OBJECT
... deleted to save space ...
====================
RM_PROPERTIES_OBJECT
... deleted to save space ...
====================
RM_CONTENT_OBJECT
... deleted to save space ...
==========================
RM_MEDIA_PROPERTIES_OBJECT
object_id: 0x4D445052 (RPDM)
size: 155 bytes
object version: 0
stream_number: 0
max_bit_rate: 12062 bps
avg_bit_rate: 12062 bps
max_packet_size: 288 bytes
avg_packet_size: 288 bytes
start time: 0 milliseconds
preroll: 191 milliseconds
duration: 224898 milliseconds
stream_name: The Audio Stream
mime_type: audio/x-pn-realaudio
type_specific_length: 73
==========================
RM_MEDIA_PROPERTIES_OBJECT
object_id: 0x4D445052 (RPDM)
size: 116 bytes
object version: 0
stream_number: 1
max_bit_rate: 7000 bps
avg_bit_rate: 7000 bps
max_packet_size: 668 bytes
avg_packet_size: 564 bytes
start time: 0 milliseconds
preroll: 3474 milliseconds
duration: 228000 milliseconds
stream_name: The Video Stream
mime_type: video/x-pn-realvideo
type_specific_length: 34
====================
RM_DATA_OBJECT
... deleted to save space ...
==========================
Seek Time: 1 with reqtime = 0 and actualtime = 0
packet 0: stream 0 timestamp 0 size: 288
keyframe
packet 1: stream 1 timestamp 0 size: 639
keyframe
packet 2: stream 1 timestamp 0 size: 619
keyframe
packet 3: stream 1 timestamp 0 size: 599
keyframe
packet 4: stream 1 timestamp 0 size: 544
keyframe
packet 5: stream 1 timestamp 0 size: 639
keyframe
packet 6: stream 0 timestamp 192 size: 288
keyframe
packet 7: stream 0 timestamp 384 size: 288
keyframe
packet 8: stream 0 timestamp 575 size: 288
keyframe
packet 9: stream 0 timestamp 767 size: 288
keyframe
packet 10: stream 0 timestamp 958 size:
288 keyframe
packet 11: stream 0 timestamp 1150 size:
288 keyframe
packet 12: stream 0 timestamp 1341 size:
288 keyframe
packet 13: stream 0 timestamp 1533 size:
288 keyframe
packet 14: stream 0 timestamp 1724 size:
288 keyframe
packet 15: stream 0 timestamp 1916 size:
288 keyframe
packet 16: stream 0 timestamp 2108 size:
288 keyframe
packet 17: stream 0 timestamp 2299 size:
288 keyframe
packet 18: stream 0 timestamp 2491 size:
288 keyframe
The RM_MEDIA_PROPERTIES_OBJECT sections describe
the stream type and stream number for each stream.
- The keyframe field is used to identify the
start of a series of related packets.
- Keyframes are sometimes too large to form
a single packet. In this case multiple keyframes will be seen
with the same timestamps.
- Some codecs produce packets with the keyframe
flag always set. And others produce a mixture of keyframe and
non keyframe packets.
- Packet sizes can be identical in size or
vary in size within a single stream.
- The RM_MEDIA_PROPERTIES_OBJECT sections
contain attributes of each stream which include:
- The stream number.
- The stream type.
- The total stream type (audio or video).
- The total duration of the stream in milliseconds.
- The preroll which describes how long to
load buffers into the player before playing the stream.
Combining RealVideo Files
RMPaste assumes that streams on the input side are
joined to streams on the output side based upon their mime types.
Start and End times are specified to map the input file, which
may contain one or more streams, to a new time range in the output
file. Only one file can use default start and end times. Start
and end times must not overlap. If streams overlap, packets from
both streams are intermingled based upon timestamp.
rmpaste (-i <input> [-s <start>]
[-e <end>]
[-f <from stream> -t <to stream>])
-o <output> -v
where:
<input> is the path to the input file. There can be one or more -i -s
-e parameters sequences.
<start> is the start time in Days:Hours:Minutes:Seconds.Milliseconds format. If missing this parameter defaults to the beginning of the file.
<end> is the end time in Days:Hours:Minutes:Seconds.Milliseconds format. If missing this parameter defaults to start+input length.
<output> is the path to the output file that contains the edited file.
<from stream> is the input stream number to be sent to the to stream.
<to stream> is the output stream number.
-v is the print version and copyright notice.
Note RMPaste can paste in additional streams and add to existing streams. When streams
are pasted together, the timestamps must not overlap.
Note If multiple streams
are in the input file and the timestamps of the streams do not
start at the same time, the start time applies to the earliest
stream in the file. The start time plus the difference between
the streams first packet is used for the remaining streams. See
first example.
The following examples demonstrate the use of the RMPaste tool:
- If you cut three streams from a source file using:
rmcut -i source.rm -o cutfile1.rm \
-S0 -s10.0 -S1 -s20.0 -S2 -s30.0
resulting in an output file like:
| Times |
| Stream0: | 0.3 | 1.1 | .... |
| Stream1: | 10.4 | 12.4 | .... |
| Stream2: | 22.0 | 32.0 | .... |
and mapped it using:
rmpaste -i cutfile1.rm -s5.0 \
-i cutfile2.rm -e5.0 \
-o paste.rm
the new stream times for cutfile1.rm would be:
| Times |
| Stream0: | 5.3 | 6.1 | .... |
| Stream1: | 15.4 | 17.4 | .... |
| Stream2: | 27.0 | 37.0 | .... |
with cutfile2.rm placed from the beginning of the
file to 5 seconds into the file. (packets not shown)
- To create a new file using the first
60 seconds of the source.rm file swapping the first 45 seconds
with the next 15 seconds in the file enter:
rmcut -i source.rm -o cutfile1.rm -s0.0 -e45.0
rmcut -i source.rm -o cutfile2.rm -s45.0 -e60.0
rmpaste -onewfile.rm -icutfile2.rm -s0.0 -e15.0\
-icutfile1.rm -s15.0 -e60.0
- To add a new stream to an existing
file:
rmpaste -ioriginal.rm -inewstream.rm -onewfile.rm
"Click-able" image maps allow users to
interact with the video content by adding image-specific video
seeking and URL commands. Image maps are fully customizable; actions
can be connected to rectangular, circular or polygonal content
regions and can be varied over specific user defined time intervals.
To create Image Maps:
- Create an Image Map File (text file).
- Merge the Image Map file (with a .rm file).
Creating an Image Map File
Image Map Files are text files that have HTML-like
tags which specify the location and action of each image map.
Image map files should be created in a text editor and saved as
text only.
All tags shown below are required unless otherwise
stated. Negative values for numbers are not allowed.
DURATION Tag
This tag must be at the beginning of the file. The
DURATION tag specifies the amount of time from the start time
of the first map to the end time of the last map in the file.
The format is as follows:
DURATION=x:x:x:x:x
| Tag Name | Description |
| DURATION | Times are specified in the following format: Days:Hours:Minutes:Seconds:MilliSeconds. All of the these fields must be present. That means if you don't want to specify a particular setting, fill 0's in that space. |
MAP Tag
This line describes the overall properties of the image map. The
format is as follows:
<MAP START=x:x:x:x:x END=x:x:x:x:x COORDS=x,y,x1,y1>
| Tag Name | Description |
| START | Times are specified in the following format: Days:Hours:Minutes:Seconds:MilliSeconds. All of the these fields must be present. That means if you don't want to specify a particular setting, fill 0's in that space. If START contains all 0's then the start of the clip is assumed. |
| END | Times are specified in the following format: Days:Hours:Minutes:Seconds:MilliSeconds. All of the these fields must be present. That means if you don't want to specify a particular setting, fill 0's in that space. If END contains all 0's then the end of clip is assumed. |
| COORDS | Specifies the rectangle that this entire map is going to occupy. If you enter an area bigger than the entire display area, the entire area is active. Any area not located within this rectangle will be clipped. |
You may have as many MAP tags in a file as you wish.
AREA Tag
There can be 0 to 40 area lines in an image map. These lines describe
the different regions that are active within an image map.
<AREA START=x:x:x:x:x END=x:x:x:x:x SHAPE=XXXX
COORDS=x0,y0,x1,y1,x2,y2,
xn,yn action_tag ALT=""
>
| Tag Name | Description |
| START | Specifies the start time of this area during the map. This field is optional; if you do not include a START time, the area begins at the beginning of the map time. Times are specified in the following format: Days:Hours:Minutes:Seconds:MilliSeconds. All of the these fields must be present. That means if you don't want to specify a particular setting, fill 0's in that space. If START contains all 0's then the start of the current map is assumed. |
| END | Specifies the end time of this area during the map. This field is optional; if you do not include an END time, the area ends at the end of the map time. Times are specified in the following format: Days:Hours:Minutes:Seconds:MilliSeconds. All of the these fields must be present. That means if you don't want to specify a particular setting, fill 0's in that space. If END contains all 0's then the end of map is assumed.
Note If the start and end times of an area are outside the start and end times of the map, then the start and end times of the map are used.
|
| SHAPE | The XXXX for the SHAPE tag can be one of the following values: (CIRCLE, RECTANGLE, POLYGON).
CIRCLE - COORDS tag should specify three values: centerX,centerY,radius
RECTANGLE - COORDs tag should specify four values: left,top,right,bottom
POLYGON - COORDs tag should specify at least 6 values (x and y coordinates for at least 3 points). These are the vertices for the polygon.
|
| action_tag | The action_tag is one of the following: PLAYER, URL, SEEK.
PLAYER - Used to specify a new stream to play with RealPlayer. For example:
PLAYER="pnm://video.real.com/welcome.rm"
URL - Used to specify a new URL to display in a browser. For example:
URL="http://www.real.com"
SEEK - Used to specify a time within the current clip to seek to. For example:
SEEK=0:0:0:5:0.
Note the format is just like the START and END tags.
|
| ALT | The ALT tag contains text that appears in the status bar of the player when the mouse is over this AREA and it is active. If you want no text then use "" as shown above.
|
/MAP Tag
This line means you are done with the current image map.
Example
DURATION=0:0:0:40:0
<MAP START=0:0:0:0:0 END=0:0:0:5:20
COORDS=0,0,100,100>
<AREA SHAPE=CIRCLE COORDS=50,50,10 URL="http://www.real.com"
ALT="Home Page">
</MAP>
<MAP START=0:0:0:5:20 END=0:0:0:20:3 COORDS=0,0,100,100>
<AREA SHAPE=RECTANGLE COORDS=0,0,50,50 SEEK=0:0:0:3:98
ALT="Seek to a point in the clip">
</MAP>
<MAP START=0:0:0:20:3 END=0:0:0:40:0 COORDS=0,0,100,100>
<AREA END=0:0:0:30:0 SHAPE=POLYGON COORDS=0,50,50,0,100,50
PLAYER="pnm://video.real.com/welcome.rm" ALT="">
<AREA START=0:0:0:31:0 SHAPE=POLYGON COORDS=0,25,25,0,100,50
SEEK=0:0:0:0:0 ALT="Rewind to Beginning">
</MAP>
Merging an Image Map file with a Video Image
When you have finished creating the Image Map file,
you convert the Image Map text file into a .rm file using the
RMMerge tool that is installed with RealVideo Encoder. Then, you
merge that .rm file with an encoded video (.rm) file.
To convert the Image Map file into a .rm file:
- From a DOS command line, change
directories to the directory that RealVideo Encoder was installed,
which by default is C:\REAL\RVENCODER
- Enter the following command:
rmmerge -f rmimap.dll image_map_text image_map_rm
Done..... appears when the image map text file has
been converted to a .rm file.
Note If you receive the message Error Parsing file, verify that the Image Map file is saved as text only and the tags are used correctly.
- Merge the Image Map .rm file with a video (.rm) file by typing the following command:
rmmerge image_map_rm video_rm final_rm
The final_rm file contains your Image Map as well as the audio/video clip.
- Verify the Image Map by playing the final_rm file with RealPlayer.
You can change the title, author, or copyright text, and modify the Selective Record and PerfectPlay settings in a .rm file using several different methods: