private void InitCompressFramesInfo(double fps, int frameCount) { var info = new VfwApi.CompressFramesInfo { StartFrame = 0, FrameCount = frameCount, Quality = quality, KeyRate = keyFrameRate, }; AviUtils.SplitFrameRate((decimal)fps, out info.FrameRateNumerator, out info.FrameRateDenominator); var result = VfwApi.ICSendMessage(compressorHandle, VfwApi.ICM_COMPRESS_FRAMES_INFO, ref info, Marshal.SizeOf(typeof(VfwApi.CompressFramesInfo))); CheckICResult(result); }
private void PrepareForWriting() { startedWriting = true; foreach (var stream in streams) { stream.PrepareForWriting(); } AviUtils.SplitFrameRate(FramesPerSecond, out frameRateNumerator, out frameRateDenominator); streamsInfo = streams.Select(s => new StreamInfo(KnownFourCCs.Chunks.IndexData(s.Index))).ToArray(); riffSizeTreshold = RIFF_AVI_SIZE_TRESHOLD; currentRiff = fileWriter.OpenList(KnownFourCCs.Lists.Avi, KnownFourCCs.ListTypes.Riff); WriteHeader(); currentMovie = fileWriter.OpenList(KnownFourCCs.Lists.Movie); }