Last active
December 3, 2019 15:34
-
-
Save prajaybasu/883a0ff97850f3559a3fc48933ac58a5 to your computer and use it in GitHub Desktop.
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
$inputFolderPath = $args[0] | |
Get-ChildItem $inputFolderPath -Filter *.mov | | |
Foreach-Object { | |
$inputFilePath = $_.FullName; | |
$outputWavPath = [System.IO.Path]::Combine([System.IO.Path]::GetDirectoryName($inputFilePath), [System.IO.Path]::GetFileNameWithoutExtension($inputFilePath) + ".wav") | |
$outputM4aPath = [System.IO.Path]::Combine([System.IO.Path]::GetDirectoryName($inputFilePath), [System.IO.Path]::GetFileNameWithoutExtension($inputFilePath) + ".m4a") | |
$outputMp4Path1 = [System.IO.Path]::Combine([System.IO.Path]::GetDirectoryName($inputFilePath), [System.IO.Path]::GetFileNameWithoutExtension($inputFilePath) + "1"+ ".mp4") | |
$outputMp4PathFinal = [System.IO.Path]::Combine([System.IO.Path]::GetDirectoryName($inputFilePath), [System.IO.Path]::GetFileNameWithoutExtension($inputFilePath) + ".mp4") | |
ffmpeg.exe -i $inputfilePath -vn -acodec copy $outputWavPath | |
qaac64.exe $outputWavPath -v 0 -q 2 -o $outputM4aPath | |
ffmpeg.exe -i $inputfilePath -vcodec libx265 -pix_fmt yuv420p -crf 18 -an $outputMp4Path1 | |
ffmpeg.exe -i $outputMp4Path1 -i $outputM4aPath -acodec copy -vcodec copy $outputMp4PathFinal | |
Remove-Item $outputWavPath | |
Remove-Item $outputM4aPath | |
Remove-Item $outputMp4Path1 | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment