FFMpegDownloadInfo.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. namespace MediaBrowser.ServerApplication.FFMpeg
  3. {
  4. public static class FFMpegDownloadInfo
  5. {
  6. public static string Version = ffmpegOsType("Version");
  7. public static string[] FfMpegUrls = ffmpegOsType("FfMpegUrls").Split(',');
  8. public static string FFMpegFilename = ffmpegOsType("FFMpegFilename");
  9. public static string FFProbeFilename = ffmpegOsType("FFProbeFilename");
  10. public static string ArchiveType = ffmpegOsType("ArchiveType");
  11. private static string ffmpegOsType(string arg)
  12. {
  13. OperatingSystem os = Environment.OSVersion;
  14. PlatformID pid = os.Platform;
  15. switch (pid)
  16. {
  17. case PlatformID.Win32NT:
  18. switch (arg)
  19. {
  20. case "Version":
  21. return "ffmpeg20131221";
  22. case "FfMpegUrls":
  23. return "http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20131221-git-70d6ce7-win32-static.7z,https://www.dropbox.com/s/d38uj7857trbw1g/ffmpeg-20131209-git-a12f679-win32-static.7z?dl=1";
  24. case "FFMpegFilename":
  25. return "ffmpeg.exe";
  26. case "FFProbeFilename":
  27. return "ffprobe.exe";
  28. case "ArchiveType":
  29. return "7z";
  30. }
  31. break;
  32. case PlatformID.Unix:
  33. case PlatformID.MacOSX:
  34. switch (arg)
  35. {
  36. case "Version":
  37. return "ffmpeg20131221";
  38. case "FfMpegUrls":
  39. return "http://ffmpeg.gusari.org/static/32bit/ffmpeg.static.32bit.2013-12-21.tar.gz,https://www.dropbox.com/s/b9v17h105cps7p0/ffmpeg.static.32bit.2013-10-11.tar.gz?dl=1";
  40. case "FFMpegFilename":
  41. return "ffmpeg";
  42. case "FFProbeFilename":
  43. return "ffprobe";
  44. case "ArchiveType":
  45. return "gz";
  46. }
  47. break;
  48. }
  49. return "";
  50. }
  51. }
  52. }