Created
September 14, 2024 12:46
-
-
Save ChandanShakya/49c0feea4e5aed4452f49c3300a03dc0 to your computer and use it in GitHub Desktop.
Powershell alias for conversion using ffmpeg
This file contains hidden or 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
function ConvertVideoWithCV { | |
param ( | |
[string]$inputFile, | |
[string]$outputFile | |
) | |
if ([string]::IsNullOrEmpty($inputFile) -or [string]::IsNullOrEmpty($outputFile)) { | |
Write-Host "Invalid input. Please provide both input and output file paths." | |
return | |
} | |
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i $inputFile -c:v h264_nvenc -preset slow $outputFile | |
} | |
Set-Alias -Name CV -Value ConvertVideoWithCV | |
function Convert-Using-FFmpeg { | |
param ( | |
[string]$inputFile, | |
[string]$outputFile | |
) | |
if ([string]::IsNullOrEmpty($inputFile) -or [string]::IsNullOrEmpty($outputFile)) { | |
Write-Host "Invalid input. Please provide both input and output file paths." | |
return | |
} | |
ffmpeg -i $inputFile $outputFile | |
} | |
Set-Alias -Name ffc -Value Convert-Using-FFmpeg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment