NAME

Real::Encode - Perl interaction with Progressive Networks ReadEncoder(tm).


SYNOPSIS

        
        # use it
        use Real::Encode;
        or
        use Real::Encode qw(Merge Set_File); # to use all methods and functions

        # create the objects
        $foo = new Real::Encode;
        $bar = new Real::Encode("path-to-Real-dir");

        # Define current outfile (explained later)
        $bar->Set_File("path-to-file");

        # Encode a file
        $foo->Encode(INFILE, OUTFILE, [Params]);
                
        # Merge 2 files
        Merge([Params]);
        
        # Edit text info within file
        $foo->Edit_Text(OUTFILE, [Params]);

        # Edit flag info within file
        $foo->Edit_Flags(OUTFILE, [Params]);

        # Edit stream info within file
        $foo->Edit_Stream(OUTFILE, [Params]);

        # Dump editing info (don't need to edit before using this)
        $foo->Edit_Dump;

        # Dump of file
        $foo->Dump(OUTFILE);

        # Cut segment from file
        $foo->Cut([Params]);


DESCRIPTION

This module allows for interaction with the RealEncoder, and thus the manipulation of RealMedia files, and encoding to RealMedia format.


Installation

        Unzip distribution file.
        run install.bat


FUNCTIONS


NOTE: Make sure you write your paths as x:\\dir\\dir\\etc.. (with the double slashes) so that the \ is escaped.

$foo = new Win32::Real::Encode[(path-to-dir)];
        'path-to-dir' is the path to the directory on you machine which contains 
        the encoding executables. You do not need to set this if you used the default
        install and they are in c:\Real\Encoder\ (the default install).

$foo->Set_File("path-to-file");
        This would be used on either of 2 cases.
                1) You are not starting off by encoding a file (object). or
                2) You wish to reset the current OUTFILE path during your script.

        Every time you do something with your object, it stores what the last outfile was, which
        is uses as your most current file. When you encode, it sets this to begin with, but when
        you do not start by encoding, you will want to set it, so other fucntions, like the Edit_* 
        functions, know what file to use. If you wish to print out your current outfile, you can 
        do so by:
        print $foo->{out};

$foo->Encode(INFILE,OUTFILE,[Params]);
        This takes a multimedia file, with the proper format (.wav, .avi, etc..) and encodes it
        into a RealMedia file (.rm). INFILE will be your multimedia file, and OUTFILE will be the 
        name you wish your encoded file to have. OUTFILE must have the proper extention (.rm, .ra).
        The parameters are the same that you would use for encoding from the command line. Options
        are given as such:
        
        $foo->Encode("foobar.wav",
                     "foobar-out.rm",
                     "-A" => "dnet 1",
                     "-F"  => "optimal",
                     "-B" => 40,
                     "-T" => "My Super Duper Title",
                     "-U" => "Kevin",
                     "-C" => "1998 Foobar Productions",
                    );

        A list of options and what the mean is below:

Encode Options

NOTE: This is taken from Progressive Networks help. To get a copy of this, type rvbatch rvencode.exe /? in your Encoder directory. Options: ( defaults in parenthesis )

        /I      infile          - Input File
        /O      outfile or dir  - Output File Name or Directory ( infile.rm or dir\YYYYMMDDHHMMSS.rm )
        /L                      - Use Live Input                ( ignores /I )
        /S      "server[:port]/file" - Server Name, Port and File       ( port defaults to 7070 )
        /W      password        - Server Password
        /D      hhh:mm:ss       - Maximum Encoding Duration     ( continuous )
        /A      audio codec tag - Audio Codec                   ( sipr 1 )
        /V      video codec num - Video Codec                   ( 0 )
        /F      framerate       - Frame Rate 0-15 or optimal    ( optimal )
                                (Note: Optimal available for RealVideo (Standard) only)
        /B      Kbps            - Total Kbps for clip 1 - 500   ( 100 )
        /N      index           - Encoding Speed range 1 to 5   ( 1 )
                          where 1 = Normal, 5 = fastest
                          Fastest will decrease quality
        /M      index           - Optimal Framerate Bias        ( 2 )
                                1 = Sharpest Image
                                2 = Normal
                                3 = Smoothest Motion
                          1 will lower frame rate, 
                          3 will lower quality
        /T      title           - Clip Title
        /U      author          - Clip Author
        /C      copyright       - Clip Copyright
        /K      boolean         - Enable Mobile Play 0-1        ( 0 )
        /R      boolean         - Enable Selective Record 0-1   ( 0 )
        /X      boolean         - Enable Audio Encoding 0-1     ( 1 )
        /Y      boolean         - Enable Video Encoding 0-1     ( 1 )
        /Z      l,t,w,h         - Set Cropping Values : Left,Top,Width,Height (0,0,0,0)
        /?      Display this help information

Audio Codecs:

        sipr 0    6500 bps      6.5 Kbps Voice
        sipr 1    8500 bps      8.5 Kbps Voice
        sipr 2    5000 bps      5 Kbps Voice
        sipr 3   16000 bps      16 Kbps Voice - Wideband
        dnet 0   16000 bps      16 Kbps Music - Low Response
        dnet 1   16000 bps      16 Kbps Music - Medium Response
        dnet 2   16000 bps      16 Kbps Music - High Response
        dnet 3   20000 bps      20 Kbps Music Stereo
        dnet 4   40000 bps      40 Kbps Music Mono
        dnet 5   40000 bps      40 Kbps Music Stereo
        dnet 6   80000 bps      80 Kbps Music Mono
        dnet 7   80000 bps      80 Kbps Music Stereo
        dnet 8    8000 bps      8 Kbps Music
        dnet 9   12000 bps      12 Kbps Music
        dnet 10  32000 bps      32 Kbps Music Mono
        dnet 11  32000 bps      32 Kbps Music Stereo
        28_8 0   15200 bps      15.2 Kbps Voice

Video Codecs:

        0       RealVideo (Standard)
        1       RealVideo (Fractal)

RVEncode.log is written to the current working directory. (i.e., the dir with the executable)

Merge([Params]);
        This will merge two files together. To merge files, you want to merge a RealVideo file
        with a RealAudio file. This method is called as:

          Merge("-d" => "c:\\foo",
                "-i" => "d:\\gsperl\\dev\\real\\drums.rm, d:\\gsperl\\dev\\real\\tada.rm",
                "-o" => "foo-out.rm",
                "-D" => "d:\\gsperl\\dev\\real\\",
           );

        -d => Program directory. This is the path to where your executables are. If omitted
              c:\Real\Encoder\ is used.
        
        -i => Your two files to merge.

        -o => The output file.

        -D => The output directory.

        You can merge together two objects as such:
                Merge->("-d" => "c:\\foo",
                        "-i" => "$foo->{out}, $bar->{out}",
                        "-o" => "foo-out.rm",
                        "-D" => "d:\\gsperl\\dev\\real\\",
                );

$foo->Edit_Text(OUTFILE,[Params]);
        This function allows you to edit the author, title, copyright and comment on a file.
        
        $foo->Edit_Text("c:\\foo\\baz-out.rm", #OUTFILE location
                "-t" => "New funky Title",
                "-a" => "New Author",
                "-c" => "New copyright info",
                "-C" => "New Comment",
        );

$foo->Edit_Flags(OUTFILE,[Params]);
        This function allows you to edit certain flags on the file. The flags are perfect play mode,
        mobile playback mode, and selective record mode. 

        $foo->Edit_Flags("d:\\foo\\baz2-out.rm",
                "-r" => "on",
                "-b" => "off",
                "-p" => "on",
        );
        
        -r => set/clear selective record (ON|OFF)

        -b => set/clear mobile playback mode (ON|OFF)

        -p => set/clear perfect play mode (ON|OFF)

$foo->Edit_Stream(OUTFILE, [Params]);
        This function allows your to edit stream information on a file.

        $foo->Edit_Stream("d:\\foo\\baz3-out.rm",
                "-s" => "New Streamy Name",
                "-m" => "audio/x-pn-realaudio",
                "-S" => "0",
        );

        -s => New stream name

        -m => New mime type for stream

        -S => Which stream (0|1)

NOTE:

        When you wish to edit the text, flags and stream on a file, the output from each
        (your OUTFILE) will be saved in $foo->{out} and your final edited file will be the
        OUTFILE for the last edit function you call.

$foo->Edit_Dump;
        This will print out the current text, flag and stream info for $foo.

$foo->Dump(OUTFILE);
        This will give you a complete dump of $foo. OUTFILE should (could) be a text file.

$foo->Cut([Params]);
        This function will cut out a segment of a file as specified in the parameters.

        $foo->Cut("-i" => "foo.rm",
                "-o" => "outt.rm",
                "-S" => "1",
                "-s" => "1.0"
        );

        -i => INput file

        -o => Output file

        -S => Stream (0|1)

        -s => Start time in Days:Hours:Minutes:Seconds.Milliseconds ... This will default to
                the begining of the file.

        -e => End time in Days:Hours:Minutes:Seconds.Milliseconds ... defaults to the end of
                the start+input length


Version

        0.05


Knows Issues

  1. It is possible that some errors are not yet handled in the best way, if you find any please let me know.

    REVISION HISTORY

    v. 0.4 (9/14/98) - Original Release to CPAN

    v. 0.5 (9/30/98) - No real technical changes. Just some cleaning from 0.4

    AUTHOR INFORMATION

    Copyright 1998, Kevin Meltzer. All rights reserved. It may be used and modified freely, but I do request that this copyright notice remain attached to the file. You may modify this module as you wish, but if you redistribute a modified version, please attach a note listing the modifications you have made.

    Address bug reports and comments to: kmeltz@cris.com

    The author makes no warranties, promises, or gaurentees of this software. As with all software, use at your own risk.

    Copyright Info

    This module is Copyright 1998, Kevin Meltzer. All rights reserved. Any documentation from Progrssive Networks and and trademard of Progressive Networks Real products are copyright by Progressive Networks (http://www.real.com). They had no part in the creation of this version of this module.