Skip to content

Instantly share code, notes, and snippets.

@ChandanShakya
Created September 14, 2024 12:46
Show Gist options
  • Save ChandanShakya/49c0feea4e5aed4452f49c3300a03dc0 to your computer and use it in GitHub Desktop.
Save ChandanShakya/49c0feea4e5aed4452f49c3300a03dc0 to your computer and use it in GitHub Desktop.
Powershell alias for conversion using ffmpeg
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