private async Task Write(StorageFile file) { var stream = await file.OpenAsync(FileAccessMode.ReadWrite); var factory = new VideoWriteServiceFactory(); var prop = new VideoProperty(); prop.BitRate = 800000; prop.Format = VideoEncoding.WindowsMediaVideo; prop.FPS = 25; prop.Height = 480; prop.Width = 640; prop.Output = stream; var service = factory.Create(prop); UInt32[] data = new UInt32[prop.Height * prop.Width]; for (int i = 0; i < data.Length; ++i) { data[i] = 0x0000FF00; } for (int i = 0; i < 20 * prop.FPS; ++i) { service.WriteFrame(data); } service.Close(); }
private async Task Write(StorageFile file) { var stream = await file.OpenAsync(FileAccessMode.ReadWrite); var factory = new VideoWriteServiceFactory(); var prop = new VideoProperty(); prop.BitRate = 800000; prop.Format = VideoEncoding.WindowsMediaVideo; prop.FPS = 25; prop.Height = 480; prop.Width = 640; prop.Output = stream; var service = factory.Create(prop); UInt32[] data = new UInt32[prop.Height * prop.Width]; for (int i = 0; i < data.Length; ++i) { data[i] = 0x0000FF00; } for (int i = 0; i < 20 * prop.FPS; ++i) { service.WriteFrame(data); } service.Close(); }