Skip to content

Instantly share code, notes, and snippets.

@bryan065
Forked from sbrown7792/ffmpeg_gpu1.bat
Created January 25, 2026 18:38
Show Gist options
  • Select an option

  • Save bryan065/95d341358677bcf5cb4553ccc80b9079 to your computer and use it in GitHub Desktop.

Select an option

Save bryan065/95d341358677bcf5cb4553ccc80b9079 to your computer and use it in GitHub Desktop.
TDarr mod to run second node (same PC) on second GPU - For reference only (took me 5 hours to come up with this, I probably won't be able to help if you run into problems)
@echo off
echo %* > D:\TDarr_1\Tdarr_Node\node_modules\@ffmpeg-installer\win32-x64\arg.txt
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "D:\TDarr_1\Tdarr_Node\node_modules\@ffmpeg-installer\win32-x64\ffmpeg_gpu1.ps1"
$Logfile = "D:\TDarr_1\Tdarr_Node\PS.log"
Function LogWrite
{
Param ([string]$logstring)
Add-content $Logfile -value $logstring
}
#get the saved arguments from the batch file
$desired_args = Get-Content "D:\TDarr_1\Tdarr_Node\node_modules\@ffmpeg-installer\win32-x64\arg.txt" -First 1
LogWrite "Before: "
LogWrite $desired_args
#insert the -gpu 1 flag where it belongs. hopefully the 9999 argumenent will always be there....
$desired_args = $desired_args -replace "-i", "-gpu 1 -i"
$desired_args = $desired_args -replace "9999", "9999 -gpu 1"
LogWrite "After: "
LogWrite $desired_args
#tdarr seems to execute ffmpeg when booting to make sure it works, so allow it to run without args
if ($desired_args -eq $null) {
& D:\TDarr_1\Tdarr_Node\node_modules\@ffmpeg-installer\win32-x64\ffmpeg_gpu1.exe
} else {
Start-Process D:\TDarr_1\Tdarr_Node\node_modules\@ffmpeg-installer\win32-x64\ffmpeg_gpu1.exe -NoNewWindow -ArgumentList $desired_args
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment