We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We are using OtaliaStudios.TranscoderLib ITranscoderListener to compress the video in our application.
Current behavior: Sometimes the compressed video file would be corrupted and getting exceptions in our application.
Expected behavior: After compressing the video, the video should be playable and not corrupt.
In our application, please see the code snippet that we were used for compressing the video.
VideoTranscoder.TranscodeVideoAsync(inputPath, outputPath);
public static async Task TranscodeVideoAsync(string sourceVideoPath, string outputpath) {
string path = System.IO.Path.GetDirectoryName(outputpath); AVAssetExportSession export = new AVAssetExportSession(sourceVideoPath); string outputFilePath = Path.Combine(path, $"{DateTime.Now.ToString(DateString.strDMYHMS, AppState.CultureInfo)}.mp4"); export.OutputPath = outputFilePath; await export.ExportTaskAsync(); MemoryStream output = new MemoryStream(); using (Stream source = File.OpenRead(outputFilePath)) await source.CopyToAsync(output); output.Seek(0, SeekOrigin.Begin); return outputFilePath;
}
public async Task ExportTaskAsync() {
DefaultVideoStrategy videoStrategy = new DefaultVideoStrategy.Builder() .AddResizer(new ExactResizer(720, 1280)) .BitRate(4096) .FrameRate(40) .KeyFrameInterval(3f) .Build(); DefaultAudioStrategy audioStrategy = new DefaultAudioStrategy.Builder() .SampleRate(DefaultAudioStrategy.SampleRateAsInput) .BitRate(DefaultAudioStrategy.BitrateUnknown).Build(); await _semaphore.WaitAsync(); Transcoder.Into(this.OutputPath) .AddDataSource(_assetPath) .SetVideoTrackStrategy(DefaultVideoStrategies.For720x1280()) .SetAudioTrackStrategy(audioStrategy) .SetListener(this) .Transcode(); await _semaphore.WaitAsync();
The text was updated successfully, but these errors were encountered:
No branches or pull requests
We are using OtaliaStudios.TranscoderLib ITranscoderListener to compress the video in our application.
Current behavior:
Sometimes the compressed video file would be corrupted and getting exceptions in our application.
Expected behavior:
After compressing the video, the video should be playable and not corrupt.
In our application, please see the code snippet that we were used for compressing the video.
VideoTranscoder.TranscodeVideoAsync(inputPath, outputPath);
public static async Task TranscodeVideoAsync(string sourceVideoPath, string outputpath)
{
}
public async Task ExportTaskAsync()
{
}
The text was updated successfully, but these errors were encountered: