private void CreateStreamWithoutFormat() { int scale = 1; double rate = frameRate; GetRateAndScale(ref rate, ref scale); Avi32.AVISTREAMINFO strhdr = new Avi32.AVISTREAMINFO(); strhdr.fccType = Avi32.mmioStringToFOURCC("vids", 0); strhdr.fccHandler = Avi32.mmioStringToFOURCC("CVID", 0); strhdr.dwFlags = 0; strhdr.dwCaps = 0; strhdr.wPriority = 0; strhdr.wLanguage = 0; strhdr.dwScale = (int)scale; strhdr.dwRate = (int)rate; strhdr.dwStart = 0; strhdr.dwLength = 0; strhdr.dwInitialFrames = 0; strhdr.dwSuggestedBufferSize = frameSize; strhdr.dwQuality = -1; strhdr.dwSampleSize = 0; strhdr.rcFrame.top = 0; strhdr.rcFrame.left = 0; strhdr.rcFrame.bottom = (uint)height; strhdr.rcFrame.right = (uint)width; strhdr.dwEditCount = 0; strhdr.dwFormatChangeCount = 0; strhdr.szName = new UInt16[64]; int result = Avi32.AVIFileCreateStream(aviFile, out aviStream, ref strhdr); if (result != 0) { throw new Exception("Exception in AVIFileCreateStream: " + result.ToString()); } }
private Avi32.AVISTREAMINFO GetStreamInfo(IntPtr aviStream) { Avi32.AVISTREAMINFO streamInfo = new Avi32.AVISTREAMINFO(); int result = Avi32.AVIStreamInfo(StreamPointer, ref streamInfo, Marshal.SizeOf(streamInfo)); if (result != 0) { throw new Exception("Exception in VideoStreamInfo: " + result.ToString()); } return streamInfo; }