Skip to content

Commit

Permalink
add ffmpeg test & set default enc args to libx264
Browse files Browse the repository at this point in the history
  • Loading branch information
couleurm committed Feb 4, 2022
1 parent 3cb02ca commit 508b6f1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
26 changes: 25 additions & 1 deletion install/post.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,28 @@ Invoke-WebRequest -UseBasicParsing -Uri 'https://raw.githubusercontent.com/bjaan
while (-not(Test-Path "$env:TMP\SVPFlow.7z")){$null}
7z x "$env:TMP\SVPFlow.7z" -o"$env:TMP\SVPFlow"
Move-Item "$env:TEMP\svpflow\x64_vs\*.dll" "$DIR\vapoursynth64\plugins" -Force
Remove-Item "$env:TMP\SVPFlow.7z","$env:TMP\SVPFlow" -Force -Ea Ignore -Recurse
Remove-Item "$env:TMP\SVPFlow.7z","$env:TMP\SVPFlow" -Force -Ea Ignore -Recurse

Write-Warning "Testing FFmpeg encoders.."
@(
'hevc_nvenc -rc constqp -preset p7 -qp 18'
'h264_nvenc -rc constqp -preset p7 -qp 15'
'hevc_amf -quality quality -qp_i 16 -qp_p 18 -qp_b 20'
'h264_amf -quality quality -qp_i 12 -qp_p 12 -qp_b 12'
'hevc_qsv -preset veryslow -global_quality:v 18'
'h264_qsv -preset veryslow -global_quality:v 15'
'libx265 -preset medium -crf 18'
'libx264 -preset slow -crf 15'
) | ForEach-Object -Begin {
$script:shouldStop = $false
} -Process {
if ($shouldStop -eq $true) { return }
Invoke-Expression "ffmpeg.exe -loglevel fatal -f lavfi -i nullsrc=3840x2160 -t 0.1 -c:v $_ -f null NUL"
if ($LASTEXITCODE -eq 0){
$script:valid_args = $_
$shouldStop = $true # Crappy way to stop the loop since most people that'll execute this will technically be parsing the raw URL as a scriptblock

}
}

(Get-Content "$DIR\Smoothie\settings\recipe.ini") -replace ('-c:v libx264 -preset slow -crf 15',"-c:v $valid_args") | Set-Content "$DIR\Smoothie\settings\recipe.ini"
2 changes: 1 addition & 1 deletion settings/recipe.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ intensity=1.27

[encoding] # How your video will be encoded
process=ffmpeg
args=-c:v hevc_nvenc -preset p7 -rc constqp -qp 18
args=-c:v libx264 -preset slow -crf 15

[misc]
folder=
Expand Down

0 comments on commit 508b6f1

Please sign in to comment.