private string CalculateDuration(VideoReel videoReel) { Timecode timeCode = Timecode.FromString("00:00:00:00", videoReel.VideoStandard.FrameRate().ToFrameRate()); foreach (var videoClip in videoReel.VideoClips) { if (timeCode != null) { timeCode = Timecode.Add(timeCode, Timecode.Subtract( Timecode.FromString(videoClip.EndTime, videoClip.VideoStandard.FrameRate().ToFrameRate()), Timecode.FromString(videoClip.StartTime, videoClip.VideoStandard.FrameRate().ToFrameRate()))); } else { timeCode = Timecode.Subtract( Timecode.FromString(videoClip.EndTime, videoClip.VideoStandard.FrameRate().ToFrameRate()), Timecode.FromString(videoClip.StartTime, videoClip.VideoStandard.FrameRate().ToFrameRate())); } } return(videoReel.TotalDuration = timeCode.ToString()); }