EncodingProfile.vala 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. namespace Webmify {
  2. public abstract class EncodingProfile {
  3. public string size { get; protected set; }
  4. public string codec_names { get; protected set; }
  5. public double fps { get; protected set; }
  6. public EncodingProfile? alternative_to { get; set; }
  7. protected double get_low_framerate(double input_framerate) {
  8. if(input_framerate >= 50) {
  9. return input_framerate / 2;
  10. }
  11. return input_framerate;
  12. }
  13. public abstract string[] get_first_pass_command(string input_path, string output_path);
  14. public abstract string[] get_second_pass_command(string input_path, string output_path);
  15. public abstract string output_name();
  16. public abstract string version_label();
  17. public abstract bool suitable_for(VideoInfo info);
  18. public abstract void setup_for(VideoInfo info);
  19. }
  20. public static Invercargill.Enumerable<EncodingProfile> construct_profiles() {
  21. var vp9_720 = new Vp9Video720pProfile();
  22. var vp9_480 = new Vp9Video480pProfile();
  23. var vp9_360 = new Vp9Video360pProfile();
  24. var vp9_240 = new Vp9Video240pProfile();
  25. return Invercargill.Convert.ate(new EncodingProfile[] {
  26. new Vp9Video1080pHighFramerateProfile (),
  27. new Vp9Video1080pLowFramerateProfile (),
  28. vp9_720,
  29. vp9_480,
  30. vp9_360,
  31. vp9_240,
  32. });
  33. }
  34. }