Created
May 23, 2024 20:48
-
-
Save sickmz/f074d71a6af5ccec2ef361e59d12e09e to your computer and use it in GitHub Desktop.
convert iPhone MOV to MP4 with nvidia hardware acceleration (h264_nvenc)
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
# 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