Example #1
0
 /// <summary>
 ///     Extract audio from file
 /// </summary>
 /// <param name="inputPath">Input path</param>
 /// <param name="outputPath">Output video stream</param>
 /// <returns>Conversion result</returns>
 public async Task<IConversion> ExtractAudio(string inputPath, string outputPath)
 {
     return await Task.FromResult(Conversion.ExtractAudio(inputPath, outputPath));
 }
Example #2
0
 /// <summary>
 ///     Convert one file to another with destination format.
 /// </summary>
 /// <param name="inputFilePath">Path to file</param>
 /// <param name="outputFilePath">Path to file</param>
 /// <returns>IConversion object</returns>
 public async Task<IConversion> Convert(string inputFilePath, string outputFilePath)
 {
     return await Task.FromResult(Conversion.Convert(inputFilePath, outputFilePath));
 }
Example #3
0
 /// <summary>
 ///     Get new instance of Conversion
 /// </summary>
 /// <returns>IConversion object</returns>
 public IConversion New()
 {
     return Conversion.New();
 }
Example #4
0
 /// <summary>
 /// Save M3U8 stream
 /// </summary>
 /// <param name="uri">Uri to stream</param>
 /// <param name="outputPath">Output path</param>
 /// <param name="duration">Duration of stream</param>
 /// <returns>Conversion result</returns>
 public async Task<IConversion> SaveM3U8Stream(Uri uri, string outputPath, TimeSpan? duration = null)
 {
     return await Task.FromResult(Conversion.SaveM3U8Stream(uri, outputPath, duration));
 }
Example #5
0
 /// <summary>
 ///     Concat multiple inputVideos.
 /// </summary>
 /// <param name="output">Concatenated inputVideos</param>
 /// <param name="inputVideos">Videos to add</param>
 /// <returns>Conversion result</returns>
 public async Task<IConversion> Concatenate(string output, params string[] inputVideos)
 {
     return await Conversion.Concatenate(output, inputVideos);
 }
Example #6
0
 /// <summary>
 ///     Change video size
 /// </summary>
 /// <param name="inputPath">Input path</param>
 /// <param name="outputPath">Output path</param>
 /// <param name="size">Expected size</param>
 /// <returns>Conversion result</returns>
 public async Task<IConversion> ChangeSize(string inputPath, string outputPath, VideoSize size)
 {
     return await Task.FromResult(Conversion.ChangeSize(inputPath, outputPath, size));
 }
Example #7
0
 /// <summary>
 ///     Get part of video
 /// </summary>
 /// <param name="inputPath">Video</param>
 /// <param name="outputPath">Output file</param>
 /// <param name="startTime">Start point</param>
 /// <param name="duration">Duration of new video</param>
 /// <returns>Conversion result</returns>
 public async Task<IConversion> Split(string inputPath, string outputPath, TimeSpan startTime, TimeSpan duration)
 {
     return await Task.FromResult(Conversion.Split(inputPath, outputPath, startTime, duration));
 }
Example #8
0
 /// <summary>
 ///     Saves snapshot of video
 /// </summary>
 /// <param name="inputPath">Video</param>
 /// <param name="outputPath">Output file</param>
 /// <param name="captureTime">TimeSpan of snapshot</param>
 /// <returns>Conversion result</returns>
 public async Task<IConversion> Snapshot(string inputPath, string outputPath, TimeSpan captureTime)
 {
     return await Task.FromResult(Conversion.Snapshot(inputPath, outputPath, captureTime));
 }
Example #9
0
 /// <summary>
 ///     Change video size
 /// </summary>
 /// <param name="inputPath">Input path</param>
 /// <param name="outputPath">Output path</param>
 /// <param name="width">Expected width</param>
 /// <param name="height">Expected height</param>
 /// <returns>Conversion result</returns>
 public async Task<IConversion> ChangeSize(string inputPath, string outputPath, int width, int height)
 {
     return await Task.FromResult(Conversion.ChangeSize(inputPath, outputPath, width, height));
 }
Example #10
0
 /// <summary>
 ///     Add subtitle to file. It will be added as new stream so if you want to burn subtitles into video you should use
 ///     BurnSubtitle method.
 /// </summary>
 /// <param name="inputPath">Input path</param>
 /// <param name="outputPath">Output path</param>
 /// <param name="subtitlePath">Path to subtitle file in .srt format</param>
 /// <param name="language">Language code in ISO 639. Example: "eng", "pol", "pl", "de", "ger"</param>
 /// <returns>Conversion result</returns>
 public async Task<IConversion> AddSubtitle(string inputPath, string outputPath, string subtitlePath, string language = null)
 {
     return await Task.FromResult(Conversion.AddSubtitle(inputPath, outputPath, subtitlePath, language));
 }
Example #11
0
 /// <summary>
 ///     Melt watermark into video
 /// </summary>
 /// <param name="inputPath">Input video path</param>
 /// <param name="outputPath">Output file</param>
 /// <param name="inputImage">Watermark</param>
 /// <param name="position">Position of watermark</param>
 /// <returns>Conversion result</returns>
 public async Task<IConversion> SetWatermark(string inputPath, string outputPath, string inputImage, Position position)
 {
     return await Task.FromResult(Conversion.SetWatermark(inputPath, outputPath, inputImage, position));
 }
Example #12
0
 /// <summary>
 ///     Add subtitles to video stream
 /// </summary>
 /// <param name="inputPath">Video</param>
 /// <param name="outputPath">Output file</param>
 /// <param name="subtitlesPath">Subtitles</param>
 /// <returns>Conversion result</returns>
 public async Task<IConversion> BurnSubtitle(string inputPath, string outputPath, string subtitlesPath)
 {
     return await Task.FromResult(Conversion.AddSubtitles(inputPath, outputPath, subtitlesPath));
 }
Example #13
0
 /// <summary>
 ///     Convert one file to another with destination format using hardware acceleration (if possible). Using cuvid. Works only on Windows/Linux with NVidia GPU.
 /// </summary>
 /// <param name="inputFilePath">Path to file</param>
 /// <param name="outputFilePath">Path to file</param>
 /// <param name="hardwareAccelerator">Hardware accelerator. List of all acceclerators available for your system - "ffmpeg -hwaccels"</param>
 /// <param name="decoder">Codec using to decoding input video (e.g. h264_cuvid)</param>
 /// <param name="encoder">Codec using to encode output video (e.g. h264_nvenc)</param>
 /// <param name="device">Number of device (0 = default video card) if more than one video card.</param>
 /// <returns>IConversion object</returns>
 public async Task<IConversion> ConvertWithHardware(string inputFilePath, string outputFilePath, HardwareAccelerator hardwareAccelerator, VideoCodec decoder, VideoCodec encoder, int device = 0)
 {
     return await Task.FromResult(Conversion.ConvertWithHardware(inputFilePath, outputFilePath, hardwareAccelerator, decoder, encoder, device));
 }
Example #14
0
 /// <summary>
 ///     Convert image video stream to gif
 /// </summary>
 /// <param name="inputPath">Input path</param>
 /// <param name="outputPath">Output path</param>
 /// <param name="loop">Number of repeats</param>
 /// <param name="delay">Delay between repeats (in seconds)</param>
 /// <returns>Conversion result</returns>
 public async Task<IConversion> ToGif(string inputPath, string outputPath, int loop, int delay = 0)
 {
     return await Task.FromResult(Conversion.ToGif(inputPath, outputPath, loop, delay));
 }
Example #15
0
 /// <summary>
 ///     Convert file to WebM
 /// </summary>
 /// <param name="inputPath">Input path</param>
 /// <param name="outputPath">Destination file</param>
 /// <returns>Conversion result</returns>
 public async Task<IConversion> ToWebM(string inputPath, string outputPath)
 {
     return await Task.FromResult(Conversion.ToWebM(inputPath, outputPath));
 }
Example #16
0
 /// <summary>
 ///     Add audio stream to video file
 /// </summary>
 /// <param name="videoPath">Video</param>
 /// <param name="audioPath">Audio</param>
 /// <param name="outputPath">Output file</param>
 /// <returns>Conversion result</returns>
 public async Task<IConversion> AddAudio(string videoPath, string audioPath, string outputPath)
 {
     return await Task.FromResult(Conversion.AddAudio(videoPath, audioPath, outputPath));
 }