public ITranscoder TranscodeVideo(IMediaItem video, TranscodeType type, uint quality, bool isDirect, uint? width, uint? height, bool maintainAspect, uint offsetSeconds, uint lengthSeconds)
        {
            if (!this.Running)
            {
                logger.Error("TranscodeService is not running!");
                return null;
            }

            logger.IfInfo("Asked to transcode video: " + video.FileName);
            lock (transcoders)
            {
                ITranscoder transcoder = null;;
                switch (type)
                {
                    case TranscodeType.X264:
                        transcoder = new FFMpegX264Transcoder(video, quality, isDirect, width, height, maintainAspect, offsetSeconds, lengthSeconds);
                        break;
                    case TranscodeType.MPEGTS:
                        transcoder = new FFMpegMpegtsTranscoder(video, quality, isDirect, width, height, maintainAspect, offsetSeconds, lengthSeconds);
                        break;
                }

                transcoder = StartTranscoder(transcoder);

                return transcoder;
            }
        }
        public ITranscoder TranscodeSong(IMediaItem song, TranscodeType type, uint quality, bool isDirect, uint offsetSeconds, uint lengthSeconds)
        {
            if (!this.Running)
            {
                logger.Error("TranscodeService is not running!");
                return null;
            }

            logger.IfInfo("Asked to transcode song: " + song.FileName);
            lock (transcoders)
            {
                ITranscoder transcoder = null;
                switch (type)
                {
                    case TranscodeType.MP3:
                        transcoder = new FFMpegMP3Transcoder(song, quality, isDirect, offsetSeconds, lengthSeconds);
                        break;
                    case TranscodeType.OGG:
                        transcoder = new FFMpegOGGTranscoder(song, quality, isDirect, offsetSeconds, lengthSeconds);
                        break;
                    case TranscodeType.OPUS:
                        transcoder = new FFMpegOpusTranscoder(song, quality, isDirect, offsetSeconds, lengthSeconds);
                        break;
                    case TranscodeType.AAC:
                        transcoder = new FFMpegAACTranscoder(song, quality, isDirect, offsetSeconds, lengthSeconds);
                        break;
                }

                transcoder = StartTranscoder(transcoder);

                return transcoder;
            }
        }