Script to Back Up Starlight Mini Temp Files and Prevent Progress Loss

OK, So like everyone here, I got tired of losing all progress Starlight made on a video when it will decide to error out. SO, I coded a simple robocopier BAT program that will make copies of the temp file Starlight makes so you will have a video (audio is not saved, but you can always source that in later) to at least work with and will allow you to trim in where it left off in Topaz video. The script is designed to make a backup copy of the starlight temp video every 60 seconds, and keep the last 5 backups. After 5, it will simply erase the oldest file while creating the latest file.

Open Notebook and copy the below contents of the script into it, and save it as Startlight_Autosave.bat (I save the BAT file to my source folder of my videos)

On the user settings, fill in the appropriate folders/file names for your own application. Keep the quotes.

And that’s it. When starlight crashes, you don’t loose the progress made, and you can edit it all back together in your favorite video editor. This is what I have been doing upscaling old Viper tv episodes, and sometimes ill have a few minutes rendered, or a few seconds, but I can sew them all back together in Premiere and export all at once when done.

======================PASTE BELOW THIS LINE INTO .BAT FILE=======================

@echo off
setlocal EnableExtensions EnableDelayedExpansion
title Topaz Checkpoint Monitor (60s)

REM ========= USER SETTINGS =========
set “SRC=C:\WHATEVER FOLDER YOU ARE SAVING TO/SOURCING FROM”
set “FILE=THIS WILL BE THE TEMP FILE STARLIGHT CREATE_LONG NUMBER.mp4”
set “DST=C:\WHEREEVER FOLDER YOU WANT THE BACKUPS SAVED TO”
set “INTERVAL_SECONDS=60”
set “KEEP_CHECKPOINTS=5”

REM ========= SETUP =========
if not exist “%DST%” mkdir “%DST%”

set “LAST_DST_SIZE=”

:loop
REM Timestamp
for /f %%I in (‘powershell -NoProfile -Command “Get-Date -Format yyyy-MM-dd HH:mm:ss”’) do set “NOW=%%I”

REM Source size
set “SRC_SIZE=—”
if exist “%SRC%%FILE%” (
for %%A in (“%SRC%%FILE%”) do set “SRC_SIZE=%%~zA”
)

REM Copy attempt
robocopy “%SRC%” “%DST%” “%FILE%” /Z /R:0 /W:0 /NFL /NDL /NP /NJH /NJS >nul

REM Destination size
set “DST_SIZE=—”
if exist “%DST%%FILE%” (
for %%A in (“%DST%%FILE%”) do set “DST_SIZE=%%~zA”
)

REM Checkpoint only if size changed
set “CHECKPOINT=NO”
if not “%DST_SIZE%”==“—” (
if not “%DST_SIZE%”==“%LAST_DST_SIZE%” (
for /f %%T in (‘powershell -NoProfile -Command “Get-Date -Format yyyy-MM-dd_HH-mm-ss”’) do set “TS=%%T”
copy /Y “%DST%%FILE%” “%DST%\checkpoint_%TS%.mp4” >nul
set “CHECKPOINT=YES”
set “LAST_DST_SIZE=%DST_SIZE%”
)
)

REM Cleanup: keep newest N checkpoints
for /f “skip=%KEEP_CHECKPOINTS% delims=” %%F in (’
dir /b /a:-d /o:-d “%DST%\checkpoint_*.mp4” 2^>nul
') do del /q “%DST%%%F” >nul 2>&1

REM Countdown display
set /a COUNT=%INTERVAL_SECONDS%

:countdown
cls
echo ==========================================================
echo Topaz Checkpoint Monitor (Ctrl+C to stop)
echo ==========================================================
echo Time : %NOW%
echo Source Size : %SRC_SIZE% bytes
echo Backup Size : %DST_SIZE% bytes
echo Checkpoint : %CHECKPOINT%
echo Keeping : %KEEP_CHECKPOINTS% newest checkpoints
echo ----------------------------------------------------------
echo Next copy in %COUNT% seconds…
echo ==========================================================

if %COUNT% LEQ 0 goto loop
set /a COUNT-=1
timeout /t 1 /nobreak >nul
goto countdown

3 Likes

Thanks for that. This is, in fact, the best method since the built-in recover/restart functionality in TV is severely broken (I.e. doesn’t work at all).

Thank you! I have stitched together, so far, 14 clips that would have otherwise been lost so far on a 46 min long video and this method is saving my butt for sure.

Does Starlight Mini crash often for you? I haven’t had an issue yet on my new rig (RTX 5090). It is painfully slow though…1.6-1.7FPS at 720p.

Yes, it would error out anywhere from 20 minutes into the process to about 2 hours and then either “Error” or say it was exported when there was clearly more video left. I created the backup program above to save any progress that would have been lost when the temp file disappears upon error.

As a twist of fate though, the last few days, I have had three 45 min long videos go through, beginning to end, with no error at all. and my speed increased from 0.7 FPS to 0.8 FPS (13900f, 4090)

Just curious, is your 0.7-0.8FPS at 1080p or 720p?

I’m getting 1.6FPS at 720p and around 0.7-1.0FPS at 1080p.

I’m running a 9950X3D + RTX 5090

Starlight Mini @ 1080p with interlaced footage

Very nice, great result!

here is the youtube playlist to see my results from the old tv series ‘Viper”: