public bool Save(out string path, int beginFrame = 0, int endFrame = -1) { T encoder = unit.Encoder; string fileName = GetFileName(encoder.Extension); string filePath = GetOutputPath(m_OutputDirectory, fileName); m_OutputDirectory.CreateDirectory(); bool result; if (encoder.Seekable) { ISeekableMovieEncoder seekable = (ISeekableMovieEncoder)encoder; result = seekable.Flush(filePath, beginFrame, endFrame); Debug.LogFormat("{0}.Flush({2}, {3}): {1}", encoder.GetType().Name, filePath, beginFrame, endFrame); } else { result = encoder.Flush(filePath); Debug.LogFormat("{0}.Flush(): {1}", encoder.GetType().Name, filePath); } path = result ? filePath : null; return(result); }
public void GetFrameData(RenderTexture texture, int frame) { if (!unit.Encoder.Seekable) { throw new NotSupportedException(); } ISeekableMovieEncoder seekable = (ISeekableMovieEncoder)unit.Encoder; seekable.GetFrameData(texture, frame); }
public int GetExpectedFileSize(int beginFrame = 0, int endFrame = -1) { if (!unit.Encoder.Seekable) { throw new NotSupportedException(); } ISeekableMovieEncoder seekable = (ISeekableMovieEncoder)unit.Encoder; return(seekable.GetExpectedFileSize(beginFrame, endFrame)); }
public bool Save(string path, int beginFrame = 0, int endFrame = -1) { T encoder = unit.Encoder; if (encoder.Seekable) { ISeekableMovieEncoder seekable = (ISeekableMovieEncoder)encoder; return(seekable.Flush(path, beginFrame, endFrame)); } else { return(encoder.Flush(path)); } }