2014-02-04 20:19:29 +00:00
|
|
|
|
using MediaBrowser.Model.Entities;
|
|
|
|
|
using System;
|
|
|
|
|
using System.IO;
|
2013-04-07 20:55:05 +00:00
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
2014-02-20 16:37:41 +00:00
|
|
|
|
namespace MediaBrowser.Controller.MediaEncoding
|
2013-04-07 20:55:05 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interface IMediaEncoder
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface IMediaEncoder
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the encoder path.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The encoder path.</value>
|
|
|
|
|
string EncoderPath { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the version.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The version.</value>
|
|
|
|
|
string Version { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2014-03-27 19:30:21 +00:00
|
|
|
|
/// Extracts the audio image.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="path">The path.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{Stream}.</returns>
|
|
|
|
|
Task<Stream> ExtractAudioImage(string path, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Extracts the video image.
|
2013-04-07 20:55:05 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="inputFiles">The input files.</param>
|
|
|
|
|
/// <param name="type">The type.</param>
|
2013-06-27 15:59:32 +00:00
|
|
|
|
/// <param name="threedFormat">The threed format.</param>
|
2013-04-07 20:55:05 +00:00
|
|
|
|
/// <param name="offset">The offset.</param>
|
2014-02-04 20:19:29 +00:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{Stream}.</returns>
|
2014-03-27 19:30:21 +00:00
|
|
|
|
Task<Stream> ExtractVideoImage(string[] inputFiles, InputType type, Video3DFormat? threedFormat, TimeSpan? offset, CancellationToken cancellationToken);
|
2014-02-04 20:19:29 +00:00
|
|
|
|
|
2013-04-07 20:55:05 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Extracts the text subtitle.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="inputFiles">The input files.</param>
|
|
|
|
|
/// <param name="type">The type.</param>
|
|
|
|
|
/// <param name="subtitleStreamIndex">Index of the subtitle stream.</param>
|
2014-01-25 20:27:31 +00:00
|
|
|
|
/// <param name="copySubtitleStream">if set to true, copy stream instead of converting.</param>
|
2013-04-07 20:55:05 +00:00
|
|
|
|
/// <param name="outputPath">The output path.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2014-01-25 20:27:31 +00:00
|
|
|
|
Task ExtractTextSubtitle(string[] inputFiles, InputType type, int subtitleStreamIndex, bool copySubtitleStream, string outputPath, CancellationToken cancellationToken);
|
2013-04-07 20:55:05 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Converts the text subtitle to ass.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="inputPath">The input path.</param>
|
|
|
|
|
/// <param name="outputPath">The output path.</param>
|
2013-07-16 18:18:49 +00:00
|
|
|
|
/// <param name="language">The language.</param>
|
2013-04-07 20:55:05 +00:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2014-01-10 13:52:01 +00:00
|
|
|
|
Task ConvertTextSubtitleToAss(string inputPath, string outputPath, string language, CancellationToken cancellationToken);
|
2013-04-07 20:55:05 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the media info.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="inputFiles">The input files.</param>
|
|
|
|
|
/// <param name="type">The type.</param>
|
2014-01-17 16:36:01 +00:00
|
|
|
|
/// <param name="isAudio">if set to <c>true</c> [is audio].</param>
|
2013-04-07 20:55:05 +00:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2014-01-17 16:36:01 +00:00
|
|
|
|
Task<InternalMediaInfoResult> GetMediaInfo(string[] inputFiles, InputType type, bool isAudio, CancellationToken cancellationToken);
|
2013-04-07 20:55:05 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the probe size argument.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="type">The type.</param>
|
|
|
|
|
/// <returns>System.String.</returns>
|
|
|
|
|
string GetProbeSizeArgument(InputType type);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the input argument.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="inputFiles">The input files.</param>
|
|
|
|
|
/// <param name="type">The type.</param>
|
|
|
|
|
/// <returns>System.String.</returns>
|
|
|
|
|
string GetInputArgument(string[] inputFiles, InputType type);
|
2014-03-27 23:01:42 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Encodes the image.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{Stream}.</returns>
|
|
|
|
|
Task<Stream> EncodeImage(ImageEncodingOptions options, CancellationToken cancellationToken);
|
2013-04-07 20:55:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Enum InputType
|
|
|
|
|
/// </summary>
|
|
|
|
|
public enum InputType
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2014-01-12 06:31:21 +00:00
|
|
|
|
/// The file
|
2013-04-07 20:55:05 +00:00
|
|
|
|
/// </summary>
|
2014-01-12 06:31:21 +00:00
|
|
|
|
File,
|
2013-04-07 20:55:05 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The bluray
|
|
|
|
|
/// </summary>
|
|
|
|
|
Bluray,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The DVD
|
|
|
|
|
/// </summary>
|
2013-05-01 20:07:20 +00:00
|
|
|
|
Dvd,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The URL
|
|
|
|
|
/// </summary>
|
|
|
|
|
Url
|
2013-04-07 20:55:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|