jellyfin-server/MediaBrowser.MediaEncoding/Encoder/AudioEncoder.cs

63 lines
2.2 KiB
C#
Raw Normal View History

2016-03-27 21:11:27 +00:00
using MediaBrowser.Controller.Configuration;
2015-01-02 06:12:58 +00:00
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging;
using System;
2016-11-01 04:07:12 +00:00
using MediaBrowser.Model.Diagnostics;
2015-01-02 06:12:58 +00:00
namespace MediaBrowser.MediaEncoding.Encoder
{
public class AudioEncoder : BaseEncoder
{
2016-11-01 04:07:12 +00:00
public AudioEncoder(MediaEncoder mediaEncoder, ILogger logger, IServerConfigurationManager configurationManager, IFileSystem fileSystem, IIsoManager isoManager, ILibraryManager libraryManager, ISessionManager sessionManager, ISubtitleEncoder subtitleEncoder, IMediaSourceManager mediaSourceManager, IProcessFactory processFactory) : base(mediaEncoder, logger, configurationManager, fileSystem, isoManager, libraryManager, sessionManager, subtitleEncoder, mediaSourceManager, processFactory)
2015-01-02 06:12:58 +00:00
{
}
2017-03-19 18:59:05 +00:00
protected override string GetCommandLineArguments(EncodingJob state)
2015-01-02 06:12:58 +00:00
{
var encodingOptions = GetEncodingOptions();
2017-04-27 18:13:16 +00:00
return EncodingHelper.GetProgressiveAudioFullCommandLine(state, encodingOptions, state.OutputFilePath);
2015-01-02 06:12:58 +00:00
}
protected override string GetOutputFileExtension(EncodingJob state)
{
var ext = base.GetOutputFileExtension(state);
if (!string.IsNullOrEmpty(ext))
{
return ext;
}
var audioCodec = state.Options.AudioCodec;
if (string.Equals("aac", audioCodec, StringComparison.OrdinalIgnoreCase))
{
return ".aac";
}
if (string.Equals("mp3", audioCodec, StringComparison.OrdinalIgnoreCase))
{
return ".mp3";
}
if (string.Equals("vorbis", audioCodec, StringComparison.OrdinalIgnoreCase))
{
return ".ogg";
}
if (string.Equals("wma", audioCodec, StringComparison.OrdinalIgnoreCase))
{
return ".wma";
}
return null;
}
2015-01-05 06:00:13 +00:00
protected override bool IsVideoEncoder
{
get { return false; }
}
2016-11-01 04:07:12 +00:00
2015-01-02 06:12:58 +00:00
}
}