Using ActiveX Controls to Encode RealNetworks Video Files
To encode a video file using the ActiveX control, you need to define the input and output file name, as well as the width and height of the encoded clip.
RealProducer.InputFilename = "file.avi" 'Input file name
RealProducer.OutputFilename = "file.rm" 'Output file name
RealProducer.VideoOutputWidth = "240" 'Width'
RealProducer.VideoOutputHeight = "180" 'Height'
You then need to specify what bit rates should be encoded. If the SureStream option is set to True, the RealProducer ActiveX control creates one large file that contains all the bit rates that were specified.
RealProducer.Target28KModem = True '28Kmodem bit rate
RealProducer.Target56KModem = True '56Kmodem bit rate
RealProducer.TargetDualISDN = True 'DualISDN bit rate
RealProducer.Target256KDSLCableModem = True '256K bit rate
RealProducer.SureStream = True 'SureStream enabled
After you start the encoding, check if the IsEncoding property is True and call the VisualBasic DoEvent routine to give the OS a chance to service other requests. Once the IsEncoding property changes to False, stop the encoding process.
RealProducer.StartEncoding
While RealProducer.IsEncoding = True And EncError = 0
DoEvents
Wend
RealProducer.StopEncoding
Unlike Microsoft WindowsMedia Encoder (which encodes according to a selected profile), the RealProducer ActiveX control lets you define the bit rates you want to generate by setting the appropriate Target bit rate property.
J.G.