Esempio n. 1
0
        public VideoStream AddVideoStream(Avi.AVICOMPRESSOPTIONS compressOptions, double frameRate, Bitmap firstFrame)
        {
            VideoStream stream = new VideoStream(aviFile, compressOptions, frameRate, firstFrame);

            streams.Add(stream);
            return(stream);
        }
Esempio n. 2
0
 internal VideoStream(int frameSize, double frameRate, int width, int height, Int16 countBitsPerPixel, int countFrames, Avi.AVICOMPRESSOPTIONS compressOptions, bool writeCompressed)
 {
     this.frameSize         = frameSize;
     this.frameRate         = frameRate;
     this.width             = width;
     this.height            = height;
     this.countBitsPerPixel = countBitsPerPixel;
     this.countFrames       = countFrames;
     this.compressOptions   = compressOptions;
     this.writeCompressed   = writeCompressed;
     this.firstFrame        = 0;
 }
Esempio n. 3
0
        private void CreateCompressedStream(Avi.AVICOMPRESSOPTIONS options)
        {
            int result = Avi.AVIMakeCompressedStream(out compressedStream, aviStream, ref options, 0);

            if (result != 0)
            {
                throw new Exception("Exception in AVIMakeCompressedStream: " + result.ToString());
            }

            this.compressOptions = options;

            SetFormat(compressedStream);
        }
Esempio n. 4
0
        private void CreateCompressedStream()
        {
            Avi.AVICOMPRESSOPTIONS_CLASS options = new Avi.AVICOMPRESSOPTIONS_CLASS();
            options.fccType = (uint)Avi.streamtypeVIDEO;

            options.lpParms  = IntPtr.Zero;
            options.lpFormat = IntPtr.Zero;
            Avi.AVISaveOptions(IntPtr.Zero, Avi.ICMF_CHOOSE_KEYFRAME | Avi.ICMF_CHOOSE_DATARATE, 1, ref aviStream, ref options);
            Avi.AVISaveOptionsFree(1, ref options);

            this.compressOptions = options.ToStruct();
            int result = Avi.AVIMakeCompressedStream(out compressedStream, aviStream, ref compressOptions, 0);

            if (result != 0)
            {
                throw new Exception("Exception in AVIMakeCompressedStream: " + result.ToString());
            }

            SetFormat(compressedStream);
        }
Esempio n. 5
0
 public VideoStream(int aviFile, Avi.AVICOMPRESSOPTIONS compressOptions, double frameRate, Bitmap firstFrame)
 {
     Initialize(aviFile, true, frameRate, firstFrame);
     CreateStream(compressOptions);
     AddFrame(firstFrame);
 }
Esempio n. 6
0
 private void CreateStream(Avi.AVICOMPRESSOPTIONS options)
 {
     CreateStreamWithoutFormat();
     CreateCompressedStream(options);
 }