C# Class AnimatGuiCtrls.Video.AviManager

Mostra file Open project: NeuroRoboticTech/AnimatLabPublicSource Class Usage Examples

Public Methods

Method Description
AddAudioStream ( AudioStream newStream, int startAtFrameIndex ) : void

Add an existing wave audio stream to the file

AddAudioStream ( IntPtr waveData, Avi streamInfo, Avi streamFormat, int streamLength ) : void

Add an existing wave audio stream to the file

AddAudioStream ( String waveFileName, int startAtFrameIndex ) : void

Add a wave audio stream from another file to this file

AddVideoStream ( Avi compressOptions, double frameRate, Bitmap firstFrame ) : VideoStream

Add an empty video stream to the file

Compresses the stream without showing the codecs dialog

AddVideoStream ( bool isCompressed, double frameRate, Bitmap firstFrame ) : VideoStream

Add an empty video stream to the file

AddVideoStream ( bool isCompressed, double frameRate, int frameSize, int width, int height, PixelFormat format ) : VideoStream

Add an empty video stream to the file

AviManager ( String fileName, bool open ) : System

Open or create an AVI file

Close ( ) : void

Release all ressources

CopyTo ( String newFileName, float startAtSecond, float stopAtSecond ) : AviManager

Copy a piece of video and wave sound int a new file

GetOpenStream ( int index ) : VideoStream

Get a stream from the internal list of opened streams

Use this method after DecompressToNewFile, to get the copied stream from the new AVI file

GetVideoStream ( ) : VideoStream

Get the first video stream - usually there is only one video stream

GetWaveStream ( ) : AudioStream

Getthe first wave audio stream

MakeFileFromStream ( String fileName, AviStream stream ) : void

Private Methods

Method Description
AviManager ( int aviFile ) : System
InsertSilence ( int countSilentSamples, IntPtr waveData, int lengthWave, Avi &streamInfo ) : IntPtr

Method Details

AddAudioStream() public method

Add an existing wave audio stream to the file
public AddAudioStream ( AudioStream newStream, int startAtFrameIndex ) : void
newStream AudioStream The stream to add
startAtFrameIndex int /// The index of the video frame at which the sound is going to start. /// '0' inserts the sound at the beginning of the video. ///
return void

AddAudioStream() public method

Add an existing wave audio stream to the file
public AddAudioStream ( IntPtr waveData, Avi streamInfo, Avi streamFormat, int streamLength ) : void
waveData System.IntPtr The new stream's data
streamInfo Avi Header info for the new stream
streamFormat Avi The new stream' format info
streamLength int Length of the new stream
return void

AddAudioStream() public method

Add a wave audio stream from another file to this file
public AddAudioStream ( String waveFileName, int startAtFrameIndex ) : void
waveFileName String Name of the wave file to add
startAtFrameIndex int Index of the video frame at which the sound is going to start
return void

AddVideoStream() public method

Add an empty video stream to the file
Compresses the stream without showing the codecs dialog
public AddVideoStream ( Avi compressOptions, double frameRate, Bitmap firstFrame ) : VideoStream
compressOptions Avi Compression options
frameRate double Frames per second
firstFrame System.Drawing.Bitmap Image to write into the stream as the first frame
return VideoStream

AddVideoStream() public method

Add an empty video stream to the file
public AddVideoStream ( bool isCompressed, double frameRate, Bitmap firstFrame ) : VideoStream
isCompressed bool true: Create a compressed stream before adding frames
frameRate double Frames per second
firstFrame System.Drawing.Bitmap Image to write into the stream as the first frame
return VideoStream

AddVideoStream() public method

Add an empty video stream to the file
public AddVideoStream ( bool isCompressed, double frameRate, int frameSize, int width, int height, PixelFormat format ) : VideoStream
isCompressed bool true: Create a compressed stream before adding frames
frameRate double Frames per second
frameSize int Size of one frame in bytes
width int Width of each image
height int Height of each image
format PixelFormat PixelFormat of the images
return VideoStream

AviManager() public method

Open or create an AVI file
public AviManager ( String fileName, bool open ) : System
fileName String Name of the AVI file
open bool true: Open the file; false: Create or overwrite the file
return System

Close() public method

Release all ressources
public Close ( ) : void
return void

CopyTo() public method

Copy a piece of video and wave sound int a new file
public CopyTo ( String newFileName, float startAtSecond, float stopAtSecond ) : AviManager
newFileName String File name
startAtSecond float Start copying at second x
stopAtSecond float Stop copying at second y
return AviManager

GetOpenStream() public method

Get a stream from the internal list of opened streams
Use this method after DecompressToNewFile, to get the copied stream from the new AVI file
public GetOpenStream ( int index ) : VideoStream
index int Index of the stream. The streams are not sorted, the first stream is the one that was opened first.
return VideoStream

GetVideoStream() public method

Get the first video stream - usually there is only one video stream
public GetVideoStream ( ) : VideoStream
return VideoStream

GetWaveStream() public method

Getthe first wave audio stream
public GetWaveStream ( ) : AudioStream
return AudioStream

MakeFileFromStream() public static method

public static MakeFileFromStream ( String fileName, AviStream stream ) : void
fileName String
stream AviStream
return void