protected override void OnClipInitializing(FilterInitializationEventArgs e) { base.OnClipInitializing(e); using (var stream = this.OpenStreamForFrame(0)) { using (var decoder = new PNGDecoder()) { decoder.Bitstream = stream; decoder.Initialize(); var frame = decoder.Decode(); if (frame == null) return; else if (frame.Video != null) { var bitmap = frame.Video[0]; if (bitmap != null) { var track = new VideoTrack(); //track.SampleCount = this.FrameCount; track.Width = bitmap.Width; track.Height = bitmap.Height; track.Format = bitmap.Format; track.SamplesPerFrame = 1; //this.Clip = new Clip(track); } } } } }
protected override Track CreateDeepClone() { var track = new VideoTrack(); track.Dimensions = this.Dimensions; track.Format = this.Format; return(track); }
protected override void OnClipInitializing(FilterInitializationEventArgs e) { base.OnClipInitializing(e); using (var stream = this.OpenStreamForFrame(0)) { using (var decoder = new TGADecoder(stream)) { decoder.Initialize(); var context = decoder.DecodeHeader(); var header = context.Header; var track = new VideoTrack() { SampleCount = 1, SamplesPerFrame = 1, Width = header.Width, Height = header.Height, }; //track.Format = if (header.BitsPerPixel == 24) track.Format = ColorFormat.RGB24; else track.Format = ColorFormat.RGB32; track.SamplesPerFrame = 1; track.SampleCount = 1; /* var track = new VideoTrack(); track.SampleCount = 1; track.Width = bitmap.Width; track.Height = bitmap.Height; track.Format = bitmap.Format; track.SamplesPerFrame = 1; track.Options = TrackOptions.Infinite; */ this.Clip = new Clip(track); } } }
protected override Track CreateDeepClone() { var track = new VideoTrack(); track.Dimensions = this.Dimensions; track.Format = this.Format; return track; }