IMediaEncoder.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Threading;
  4. using System.Threading.Tasks;
  5. using MediaBrowser.Model.Dlna;
  6. using MediaBrowser.Model.Entities;
  7. using MediaBrowser.Model.IO;
  8. using MediaBrowser.Model.MediaInfo;
  9. using MediaBrowser.Model.System;
  10. namespace MediaBrowser.Controller.MediaEncoding
  11. {
  12. /// <summary>
  13. /// Interface IMediaEncoder
  14. /// </summary>
  15. public interface IMediaEncoder : ITranscoderSupport
  16. {
  17. /// <summary>
  18. /// The location of the discovered FFmpeg tool.
  19. /// </summary>
  20. FFmpegLocation EncoderLocation { get; }
  21. /// <summary>
  22. /// Gets the encoder path.
  23. /// </summary>
  24. /// <value>The encoder path.</value>
  25. string EncoderPath { get; }
  26. /// <summary>
  27. /// Supportses the decoder.
  28. /// </summary>
  29. /// <param name="decoder">The decoder.</param>
  30. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
  31. bool SupportsDecoder(string decoder);
  32. /// <summary>
  33. /// Extracts the audio image.
  34. /// </summary>
  35. /// <param name="path">The path.</param>
  36. /// <param name="imageStreamIndex">Index of the image stream.</param>
  37. /// <param name="cancellationToken">The cancellation token.</param>
  38. /// <returns>Task{Stream}.</returns>
  39. Task<string> ExtractAudioImage(string path, int? imageStreamIndex, CancellationToken cancellationToken);
  40. /// <summary>
  41. /// Extracts the video image.
  42. /// </summary>
  43. Task<string> ExtractVideoImage(string[] inputFiles, string container, MediaProtocol protocol, MediaStream videoStream, Video3DFormat? threedFormat, TimeSpan? offset, CancellationToken cancellationToken);
  44. Task<string> ExtractVideoImage(string[] inputFiles, string container, MediaProtocol protocol, MediaStream imageStream, int? imageStreamIndex, CancellationToken cancellationToken);
  45. /// <summary>
  46. /// Extracts the video images on interval.
  47. /// </summary>
  48. Task ExtractVideoImagesOnInterval(string[] inputFiles,
  49. string container,
  50. MediaStream videoStream,
  51. MediaProtocol protocol,
  52. Video3DFormat? threedFormat,
  53. TimeSpan interval,
  54. string targetDirectory,
  55. string filenamePrefix,
  56. int? maxWidth,
  57. CancellationToken cancellationToken);
  58. /// <summary>
  59. /// Gets the media info.
  60. /// </summary>
  61. /// <param name="request">The request.</param>
  62. /// <param name="cancellationToken">The cancellation token.</param>
  63. /// <returns>Task.</returns>
  64. Task<MediaInfo> GetMediaInfo(MediaInfoRequest request, CancellationToken cancellationToken);
  65. /// <summary>
  66. /// Gets the input argument.
  67. /// </summary>
  68. /// <param name="inputFiles">The input files.</param>
  69. /// <param name="protocol">The protocol.</param>
  70. /// <returns>System.String.</returns>
  71. string GetInputArgument(IReadOnlyList<string> inputFiles, MediaProtocol protocol);
  72. /// <summary>
  73. /// Gets the time parameter.
  74. /// </summary>
  75. /// <param name="ticks">The ticks.</param>
  76. /// <returns>System.String.</returns>
  77. string GetTimeParameter(long ticks);
  78. Task ConvertImage(string inputPath, string outputPath);
  79. /// <summary>
  80. /// Escapes the subtitle filter path.
  81. /// </summary>
  82. /// <param name="path">The path.</param>
  83. /// <returns>System.String.</returns>
  84. string EscapeSubtitleFilterPath(string path);
  85. void SetFFmpegPath();
  86. void UpdateEncoderPath(string path, string pathType);
  87. bool SupportsEncoder(string encoder);
  88. IEnumerable<string> GetPrimaryPlaylistVobFiles(string path, IIsoMount isoMount, uint? titleNumber);
  89. }
  90. }