/// <summary>Create a new stream</summary> private void CreateStreamWithoutFormat() { int scale = 1; double rate = FrameRate; GetRateAndScale(ref rate, ref scale); Avi.AVISTREAMINFO strhdr = new Avi.AVISTREAMINFO { fccType = Avi.mmioStringToFOURCC("vids", 0), fccHandler = Avi.mmioStringToFOURCC("CVID", 0), dwFlags = 0, dwCaps = 0, wPriority = 0, wLanguage = 0, dwScale = scale, dwRate = (int)rate, dwStart = 0, dwLength = 0, dwInitialFrames = 0, dwSuggestedBufferSize = FrameSize, dwQuality = -1, dwSampleSize = 0, rcFrame = { top = 0, left = 0, bottom = (uint)Height, right = (uint)Width }, dwEditCount = 0, dwFormatChangeCount = 0, szName = new UInt16[64] }; int result = Avi.AVIFileCreateStream(aviFile, out aviStream, ref strhdr); if (result != 0) { throw new Exception("Exception in AVIFileCreateStream: " + result); } }
/// <summary>Copy the stream into a new file</summary> /// <param name="fileName">Name of the new file</param> public override void ExportStream(String fileName) { Avi.AVICOMPRESSOPTIONS_CLASS opts = new Avi.AVICOMPRESSOPTIONS_CLASS { fccType = (UInt32)Avi.mmioStringToFOURCC("auds", 0), fccHandler = (UInt32)Avi.mmioStringToFOURCC("CAUD", 0), dwKeyFrameEvery = 0, dwQuality = 0, dwFlags = 0, dwBytesPerSecond = 0, lpFormat = new IntPtr(0), cbFormat = 0, lpParms = new IntPtr(0), cbParms = 0, dwInterleaveEvery = 0 }; Avi.AVISaveV(fileName, 0, 0, 1, ref aviStream, ref opts); }