Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sickmz/f074d71a6af5ccec2ef361e59d12e09e to your computer and use it in GitHub Desktop.
Save sickmz/f074d71a6af5ccec2ef361e59d12e09e to your computer and use it in GitHub Desktop.
convert iPhone MOV to MP4 with nvidia hardware acceleration (h264_nvenc)
# path input
$inputPath = "C:\Users\matteo\Desktop\transcode"
# path output
$outputPath = "C:\Users\matteo\Desktop\transcode\output"
if (-not (Test-Path -Path $outputPath -PathType Container)) {
New-Item -ItemType Directory -Path $outputPath | Out-Null
}
# check all .mov file
Get-ChildItem "$inputPath\*.mov" | ForEach-Object {
$ffmpegCommand = ".\ffmpeg.exe -i `"$($_.FullName)`" -c:v h264_nvenc -b:v 5M -c:a aac -strict experimental -b:a 192k -movflags +faststart -map_metadata 0 -metadata:s:v:0 rotate=0 `"$($outputPath)\$($_.BaseName).mp4`""
# execute ffmpeg
Invoke-Expression $ffmpegCommand
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment