-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptimized_beat_saber.ps1
More file actions
74 lines (61 loc) · 1.72 KB
/
optimized_beat_saber.ps1
File metadata and controls
74 lines (61 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#windows only, optimize beat saber for youtube and youtube shorts with quick cuts
$InputFile = Read-Host "Pfad zur Eingabedatei"
$Start = Read-Host "Startzeit Full (HH:MM:SS)"
$Duration = Read-Host "Dauer Full (HH:MM:SS)"
$StartShort = Read-Host "Startzeit Short (HH:MM:SS)"
$DurationShort = Read-Host "Dauer Short (HH:MM:SS)"
$OutputName = Read-Host "Basisname der Ausgabedateien"
$OutputPath = "F:\Videos\Aufnahmen\Beat Saber Optimized"
if (-not (Test-Path $OutputPath)) {
New-Item -ItemType Directory -Path $OutputPath | Out-Null
}
# --- Validierung ---
if (-not (Test-Path -LiteralPath $InputFile)) {
Write-Error "Eingabedatei existiert nicht."
exit 1
}
if (-not (Get-Command ffmpeg -ErrorAction SilentlyContinue)) {
Write-Error "ffmpeg nicht im PATH."
exit 1
}
# --- Full Video ---
$fullOutput = Join-Path $OutputPath "$OutputName.mkv"
Write-Host "Erzeuge Full Video:"
Write-Host $fullOutput
& ffmpeg `
-hwaccel_device qsv `
-i $InputFile `
-ss $Start `
-t $Duration `
-vf "scale=3840:2160" `
-c:v av1_qsv `
-q:v 19 `
-preset veryslow `
-pix_fmt p010le `
-c:a copy `
$fullOutput
if ($LASTEXITCODE -ne 0) {
Write-Error "Fehler beim Full-Encode."
exit 1
}
# --- Short ---
$shortOutput = Join-Path $OutputPath "$OutputName Short.mkv"
Write-Host "Erzeuge Short:"
Write-Host $shortOutput
& ffmpeg `
-hwaccel_device qsv `
-i $InputFile `
-ss $StartShort `
-t $DurationShort `
-vf "crop=607:1080:706:1080,scale=2160:3840" `
-c:v av1_qsv `
-q:v 19 `
-preset veryslow `
-pix_fmt p010le `
-c:a copy `
$shortOutput
if ($LASTEXITCODE -ne 0) {
Write-Error "Fehler beim Short-Encode."
exit 1
}
Write-Host "Beide Encodes abgeschlossen."