Skip to content

Process Priority

Matt McManis edited this page May 30, 2020 · 2 revisions
TOC

Priority Levels

  • Default
  • Low
  • Below Normal
  • Normal
  • Above Normal
  • High

CMD

1 Pass / CRF

start "" /b /wait /belownormal ffmpeg -i "C:\path\to\video.mpg" -c:v libvpx -b:v 1300K "C:\path\to\video.webm"

2 Pass

start "" /b /wait /belownormal ffmpeg -i "C:\path\to\video.mpg" -c:v libvpx -b:v 1300K -pass 1 NUL &&
start "" /b /wait /belownormal ffmpeg -i "C:\path\to\video.mpg" -c:v libvpx -b:v 1300K -pass 2 "C:\path\to\video.webm"

Batch

1 Pass / CRF

cd /d "C:\path\to\" && 

for %f in (*.mpg) do (echo) && 

start "" /b /wait /belownormal ffmpeg 

-i "C:\path\to\%f" -c:v libvpx -b:v 1300K "C:\path\to\%~nf.webm"

PowerShell

1 Pass / CRF

($Process = Start-Process ffmpeg -NoNewWindow -ArgumentList '-i "C:\path\to\video.mpg" -c:v libvpx -b:v 1300K "C:\path\to\video.webm"' -PassThru).PriorityClass = [System.Diagnostics.ProcessPriorityClass]::BelowNormal; Wait-Process -Id $Process.id

2 Pass

($Process = Start-Process ffmpeg -NoNewWindow -ArgumentList '-i "C:\path\to\video.mpg" -c:v libvpx -b:v 1300K -pass 1 NUL' -PassThru).PriorityClass = [System.Diagnostics.ProcessPriorityClass]::BelowNormal; Wait-Process -Id $Process.id;

($Process = Start-Process ffmpeg -NoNewWindow -ArgumentList '-i "C:\path\to\video.mpg" -c:v libvpx -b:v 1300K -pass 2 "C:\path\to\video.webm"' -PassThru).PriorityClass = [System.Diagnostics.ProcessPriorityClass]::BelowNormal; Wait-Process -Id $Process.id;

Batch

1 Pass / CRF

$files = Get-ChildItem "C:\path\to\" -Filter *.mpg;

foreach ($f in $files) {

    $fullName = $f.FullName; 
    $inputName = $f.Name; 
    $outputName = (Get-Item $inputName).Basename; 

    ($Process = Start-Process ffmpeg -NoNewWindow -ArgumentList '-i "C:\path\to\video.mpg" -c:v libvpx -b:v 1300K "C:\path\to\video.webm"' -PassThru).PriorityClass = [System.Diagnostics.ProcessPriorityClass]::BelowNormal; Wait-Process -Id $Process.id
}

Call Operator

If Process Priority is Default

If using FFmpeg / FFprobe Full Path, uses Call Operator &

& "C:\path\to\ffmpeg\bin\ffmpeg.exe" 
& "C:\path\to\ffmpeg\bin\ffprobe.exe" 

If Process Priority is Low, Normal, High, etc. uses Start-Process

Start-Process "C:\path\to\ffmpeg\bin\ffmpeg.exe" 

If using Environment Variable

ffmpeg
ffprobe
Clone this wiki locally