/// <summary> /// Constructor takes a file path+name /// </summary> /// <param name="filename">File path+name</param> public MediaFile(string filename) { _filename = filename; _realLengthInUnits = MediaDetUtils.GetLength(filename); _lengthUsedInUnits = _realLengthInUnits; _lengthInFrames = -1; }
protected void AssertLengths(double fps, string file1, string file2) { long length1 = MediaDetUtils.GetLength(file1); long length2 = MediaDetUtils.GetLength(file2); long frameLength = TimelineUtils.ToUnits(1.0 / fps); long difference = Math.Abs(length1 - length2); Assert.IsTrue(difference <= frameLength); }
protected void AssertLengths(double fps, double expected, string file) { long length1 = TimelineUtils.ToUnits(expected); long length2 = MediaDetUtils.GetLength(file); long frameLength = TimelineUtils.ToUnits(1.0 / fps) * 4; // allow for 4 frames difference long difference = Math.Abs(length1 - length2); Assert.IsTrue(difference <= frameLength, string.Format("expected {0} +/- {1}, but was {2}", length1, frameLength, length2)); }