Created
June 29, 2023 22:53
-
-
Save itorr/fc4872604c84e0765c9329c2a218a93e to your computer and use it in GitHub Desktop.
批量加速视频.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$outputDir = "./output_fast2" | |
if (!(Test-Path -Path $outputDir)) { | |
New-Item -ItemType Directory -Path $outputDir | |
} | |
Get-ChildItem -Path $sourceDir -Filter *.mp4 | ForEach-Object { | |
$outputFilename = Join-Path $outputDir ("$($_.BaseName)_fasted.mp4") | |
ffmpeg -i $_.FullName -vf "select='not(mod(n,300))',setpts=N/(FRAME_RATE*TB)" -r 60 -an -c:v libx264 -preset ultrafast -crf 20 -pix_fmt yuv420p $outputFilename | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment