diff options
Diffstat (limited to 'MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs')
| -rw-r--r-- | MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs | 82 |
1 files changed, 72 insertions, 10 deletions
diff --git a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs index fc50df216..596c9d234 100644 --- a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs +++ b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs @@ -1,19 +1,81 @@ - +using System; + namespace MediaBrowser.ServerApplication.FFMpeg { public static class FFMpegDownloadInfo { - public static string Version = "ffmpeg20131209"; + // Windows builds: http://ffmpeg.zeranoe.com/builds/ + // Linux builds: http://ffmpeg.gusari.org/static/ + + public static string Version = ffmpegOsType("Version"); + + public static string[] FfMpegUrls = GetDownloadUrls(); + + public static string FFMpegFilename = ffmpegOsType("FFMpegFilename"); + public static string FFProbeFilename = ffmpegOsType("FFProbeFilename"); + + public static string ArchiveType = ffmpegOsType("ArchiveType"); - public static string[] FfMpegUrls = new[] - { - "http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20131209-git-a12f679-win32-static.7z", - "https://www.dropbox.com/s/d38uj7857trbw1g/ffmpeg-20131209-git-a12f679-win32-static.7z?dl=1" - }; + private static string ffmpegOsType(string arg) + { + OperatingSystem os = Environment.OSVersion; + PlatformID pid = os.Platform; + switch (pid) + { + case PlatformID.Win32NT: + switch (arg) + { + case "Version": + return "20140105"; + case "FFMpegFilename": + return "ffmpeg.exe"; + case "FFProbeFilename": + return "ffprobe.exe"; + case "ArchiveType": + return "7z"; + } + break; + case PlatformID.Unix: + case PlatformID.MacOSX: + switch (arg) + { + case "Version": + return "20140104"; + case "FFMpegFilename": + return "ffmpeg"; + case "FFProbeFilename": + return "ffprobe"; + case "ArchiveType": + return "gz"; + } + break; + } + return ""; + } - public static string FFMpegFilename = "ffmpeg.exe"; - public static string FFProbeFilename = "ffprobe.exe"; + private static string[] GetDownloadUrls() + { + var pid = Environment.OSVersion.Platform; + + switch (pid) + { + case PlatformID.Win32NT: + return new[] + { + "http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20140105-git-70937d9-win32-static.7z", + "https://www.dropbox.com/s/oghurnp5zh292ry/ffmpeg-20140105-git-70937d9-win32-static.7z?dl=1" + }; + + case PlatformID.Unix: + case PlatformID.MacOSX: + return new[] + { + "http://ffmpeg.gusari.org/static/32bit/ffmpeg.static.32bit.2014-01-04.tar.gz", + "https://www.dropbox.com/s/b7nkg71sil812hp/ffmpeg.static.32bit.2014-01-04.tar.gz?dl=1" + }; + } - public static string ArchiveType = "7z"; + return new string[] {}; + } } } |
