add ability to customize ffmpeg path

This commit is contained in:
Luke Pulverenti
2014-09-14 11:26:33 -04:00
parent 5c615fa024
commit 10cb5a8bf6
6 changed files with 75 additions and 36 deletions

View File

@@ -14,6 +14,7 @@ using System.Threading.Tasks;
#if __MonoCS__
using Mono.Unix.Native;
#endif
using MediaBrowser.ServerApplication.IO;
namespace MediaBrowser.ServerApplication.FFMpeg
{
@@ -39,8 +40,21 @@ namespace MediaBrowser.ServerApplication.FFMpeg
_fileSystem = fileSystem;
}
public async Task<FFMpegInfo> GetFFMpegInfo(IProgress<double> progress)
public async Task<FFMpegInfo> GetFFMpegInfo(StartupOptions options, IProgress<double> progress)
{
var customffMpegPath = options.GetOption("-ffmpeg");
var customffProbePath = options.GetOption("-ffprobe");
if (!string.IsNullOrWhiteSpace(customffMpegPath) && !string.IsNullOrWhiteSpace(customffProbePath))
{
return new FFMpegInfo
{
ProbePath = customffProbePath,
EncoderPath = customffMpegPath,
Version = "custom"
};
}
var rootEncoderPath = Path.Combine(_appPaths.ProgramDataPath, "ffmpeg");
var versionedDirectoryPath = Path.Combine(rootEncoderPath, FFMpegDownloadInfo.Version);