Created
April 26, 2018 09:51
-
-
Save fluttr/5dac2bf6e1156279c3293404e9421056 to your computer and use it in GitHub Desktop.
Example of reencoding video using nvenc with metadata removal
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
# 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