Browse Source

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

Almamu 11 months ago
parent
commit
3683558343

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

@@ -447,7 +447,7 @@ void WallpaperApplication::show () {
         // wait for a full render cycle before actually starting
         // this gives some extra time for video and web decoders to set themselves up
         // 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) {
                 width = this->m_renderContext->getWallpapers ().begin ()->second->getWidth ();
                 height = this->m_renderContext->getWallpapers ().begin ()->second->getHeight ();

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

@@ -2,6 +2,7 @@
 if [ $# -eq 0 ]
   then
     echo "Please provide the current build's executable path. You might want to run this script off the same folder."
+    exit
 fi
 
 # 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"
     # 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
 done