Sfoglia il codice sorgente

More readable FPS labels, note down bugs

Billy Barrow 2 anni fa
parent
commit
16dd7e2d34
3 ha cambiato i file con 27 aggiunte e 12 eliminazioni
  1. 5 0
      README.md
  2. 5 5
      nz.barrow.billy.publicate.svg
  3. 17 7
      src/Video/Vp9Profiles.vala

+ 5 - 0
README.md

@@ -29,3 +29,8 @@ It is still a work in progress, and also depends on some of my other home grown
 - Ability to generate PPIX files (PPub IndeX) once LibPpub has the functionality.
 - Updating the PPUB `date` metadata automatically on all saves (currently only updates when metadata is saved).
 - Drag and drop files into PPUB
+
+## Known bugs
+
+- Under some circumstances the lowest video quality in the PPVM file gets duplicated and put at the top of the list (as if it was the highest quality)
+- Sometimes the PPVM files loses reference to the description file when it is saved.

+ 5 - 5
nz.barrow.billy.publicate.svg

@@ -27,11 +27,11 @@
      inkscape:deskcolor="#d1d1d1"
      showgrid="false"
      showguides="true"
-     inkscape:zoom="2.2235194"
-     inkscape:cx="106.36291"
-     inkscape:cy="72.182866"
+     inkscape:zoom="6.1636223"
+     inkscape:cx="66.194841"
+     inkscape:cy="75.037044"
      inkscape:window-width="1920"
-     inkscape:window-height="1011"
+     inkscape:window-height="1043"
      inkscape:window-x="0"
      inkscape:window-y="0"
      inkscape:window-maximized="1"
@@ -261,7 +261,7 @@
      width="104.00001"
      height="96"
      x="-116.5764"
-     y="-116.20497"
+     y="-115.77655"
      rx="8"
      ry="9.4549999"
      clip-path="none"

+ 17 - 7
src/Video/Vp9Profiles.vala

@@ -19,10 +19,10 @@ namespace Publicate.Video {
             return get_command (input_path, output_path, 2);
         }
         public override string output_name () {
-            return @"1080p_$(fps)fps.webm";
+            return @"1080p_$(get_clean_fps(fps))fps.webm";
         }
         public override string version_label (){
-            return @"1080p $(fps)fps";
+            return @"1080p $(get_clean_fps(fps))fps";
         }
         public override bool suitable_for (VideoInfo info) {
             return info.height >= 1080 && get_low_framerate (info.frame_rate) != info.frame_rate;
@@ -45,7 +45,7 @@ namespace Publicate.Video {
                 "-maxrate", "2610k",
                 "-tile-columns", "2",
                 "-g", "240",
-                "-threads", "8",
+                "-threads", get_num_processors().to_string(),
                 "-quality", "good",
                 "-crf", "31",
                 "-c:v", "libvpx-vp9",
@@ -58,6 +58,16 @@ namespace Publicate.Video {
             };
         }
 
+
+        private string get_clean_fps(double fps) {
+            var clean = (int)fps;
+            if(fps - (double)clean > 0.0) {
+                clean++;
+            }
+            return clean.to_string ();
+        }
+
+
     }
 
     public class Vp9Video1080pLowFramerateProfile : EncodingProfile {
@@ -88,14 +98,14 @@ namespace Publicate.Video {
             return new string[] {
                 "ffmpeg",
                 "-i", input_path,
-                "-r", fps.to_string(),
+                "-r", fps.to_string (),
                 "-vf", @"scale=$(size)",
                 "-b:v", "1800k",
                 "-minrate", "900k",
                 "-maxrate", "2610k",
                 "-tile-columns", "2",
                 "-g", "240",
-                "-threads", "8",
+                "-threads", get_num_processors().to_string(),
                 "-quality", "good",
                 "-crf", "31",
                 "-c:v", "libvpx-vp9",
@@ -145,7 +155,7 @@ namespace Publicate.Video {
                 "-maxrate", "1485k",
                 "-tile-columns", "2",
                 "-g", "240",
-                "-threads", "8",
+                "-threads", get_num_processors().to_string(),
                 "-quality", "good",
                 "-crf", "32",
                 "-c:v", "libvpx-vp9",
@@ -195,7 +205,7 @@ namespace Publicate.Video {
                 "-maxrate", "1088k",
                 "-tile-columns", "2",
                 "-g", "240",
-                "-threads", "8",
+                "-threads", get_num_processors().to_string(),
                 "-quality", "good",
                 "-crf", "33",
                 "-c:v", "libvpx-vp9",