Jelajahi Sumber

chore: small fixes for the tools to run over all the backgrounds recording screen

Almamu 11 bulan lalu
induk
melakukan
3683558343

+ 1 - 1
src/WallpaperEngine/Application/WallpaperApplication.cpp

@@ -447,7 +447,7 @@ void WallpaperApplication::show () {
         // wait for a full render cycle before actually starting
         // wait for a full render cycle before actually starting
         // this gives some extra time for video and web decoders to set themselves up
         // this gives some extra time for video and web decoders to set themselves up
         // because of size changes
         // because of size changes
-        if (m_videoDriver->getFrameCounter () > this->m_context.settings.render.maximumFPS) {
+        if (m_videoDriver->getFrameCounter () > (uint32_t) this->m_context.settings.render.maximumFPS) {
             if (!initialized) {
             if (!initialized) {
                 width = this->m_renderContext->getWallpapers ().begin ()->second->getWidth ();
                 width = this->m_renderContext->getWallpapers ().begin ()->second->getWidth ();
                 height = this->m_renderContext->getWallpapers ().begin ()->second->getHeight ();
                 height = this->m_renderContext->getWallpapers ().begin ()->second->getHeight ();

+ 11 - 7
tools/run-over-all-backgrounds.sh

@@ -2,6 +2,7 @@
 if [ $# -eq 0 ]
 if [ $# -eq 0 ]
   then
   then
     echo "Please provide the current build's executable path. You might want to run this script off the same folder."
     echo "Please provide the current build's executable path. You might want to run this script off the same folder."
+    exit
 fi
 fi
 
 
 # ensure the output and images directory exists
 # ensure the output and images directory exists
@@ -14,12 +15,15 @@ for folder in ~/.steam/steam/steamapps/workshop/content/431960/*; do
 
 
     echo "Running wallpaperengine for background $bgid and waiting for it to finish"
     echo "Running wallpaperengine for background $bgid and waiting for it to finish"
     # run and wait for it to finish
     # run and wait for it to finish
-    $1 $bgid
-    # move output.webm to the output folder with the right name
-    mv output.webm output/$bgid.webm
-    # take a screenshot
-    ffmpeg -ss 00:00:03 -i output/$bgid.webm -frames:v 1  output/$bgid.jpg
-    # copy over the project.json so we have it on hand
-    cp $folder/project.json output/$bgid.json
+    $1 $bgid 2>&1 | grep -v "Error receiving video packet: " > output/$bgid.log
+
+    if [ -f "output.webm" ]; then
+      # move output.webm to the output folder with the right name
+      mv output.webm output/$bgid.webm
+      # take a screenshot
+      ffmpeg -ss 00:00:03 -i output/$bgid.webm -frames:v 1  output/$bgid.jpg
+      # copy over the project.json so we have it on hand
+      cp $folder/project.json output/$bgid.json
+    fi
   fi
   fi
 done
 done