Last active
January 23, 2020 10:01
-
-
Save outsidecontext/4757165558d676ff9d674baa901281aa to your computer and use it in GitHub Desktop.
Convert all videos in the working directory to h264 mp4s
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 = $PSScriptRoot | |
| Write-Output "In directory: "$path | |
| $files = Get-ChildItem -Filter *.mp4 | |
| foreach ($file in $files) | |
| { | |
| $fileNameIn = $file.Name | |
| $date = get-date -format "yyyy-MM-dd-HHmmss" | |
| $fileNameOut = $date + ".mp4" | |
| Write-Output "Converting $fileNameIn to $fileNameOut" | |
| ffmpeg -i $fileNameIn -vcodec h264 -acodec aac -strict -2 $fileNameOut".mp4" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment