private void VideoObserver_VideoSampleReady(object sender, Events.VideoSampleReadyArgs e) { this.videoFile = this.videoFile ?? File.OpenWrite($"tello.video.{this.session.Id}.h264"); this.videoFile.Write(e.Message.Data, 0, e.Message.Data.Length); this.videoLength = this.videoLength < Int64.MaxValue ? this.videoLength + e.Message.Data.Length : 0; }
private void Observer_VideoSampleReady(object sender, Events.VideoSampleReadyArgs e) { _timeIndex = _watch.Elapsed; var sample = new VideoSample(e.Message.Data, _timeIndex, _watch.Elapsed - _timeIndex); if (!_watch.IsRunning) { _watch.Start(); } _samples.Enqueue(sample); }
private void Observer_VideoSampleReady(object sender, Events.VideoSampleReadyArgs e) { this.timeIndex = this.watch.Elapsed; var sample = new VideoSample(e.Message.Data, this.timeIndex, this.watch.Elapsed - this.timeIndex); if (!this.watch.IsRunning) { this.watch.Start(); } this.samples.Enqueue(sample); }
private void VideoObserver_VideoSampleReady(object sender, Events.VideoSampleReadyArgs e) { this.videoFile = this.videoFile ?? File.OpenWrite($"tello.video.{this.session.Id}.h264"); this.videoFile.Write(e.Message.Data, 0, e.Message.Data.Length); this.videoLength = this.videoLength < Int64.MaxValue ? this.videoLength + e.Message.Data.Length : 0; // video reporting interval is 30hz, so 150 should be once every 5 seconds if (this.videoCount % 150 == 0) { Log.WriteLine($"video segment size {e.Message.Data.Length}b @ {e.Message.Timestamp.ToString("o")}", ConsoleColor.Magenta, false); Log.WriteLine($"ttl video size {this.videoLength}b, segment count {this.videoCount + 1}", ConsoleColor.Magenta); } this.videoCount = this.videoCount < Int32.MaxValue ? this.videoCount + 1 : 0; }