Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of reencoding video using nvenc with metadata removal
# converts all files specified in FileGlob using ffmpeg and nvenc
function ConvertWith-Nvenc(parameter(mandatory=$true)[string]$FileGlob){ # FileGlob can contain path and wildcards
$OutputDir = "$(Split-Path -Parent "$FileGlob")\out"
mkdir "$OutputDir"
foreach($vid in (gi "$FileGlob")){
echo "converting $vid..."
ffmpeg -i "$($vid.name)" -c:v h264_nvenc -preset slow `
-ac 2 -c:a aac -strict -2 -b:a 128k `
-map_metadata -1 `
"$OutputDir\$($vid.name)"
}
}
ConvertWith-Nvenc "c:\some_path\*.mp4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.