Last active
August 28, 2016 15:38
-
-
Save RyanHirsch/ba5c76d16eb6a168b403b98ec0c86d07 to your computer and use it in GitHub Desktop.
Scripts for converting a video into `avi` for use in MediaShout
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
| @echo off | |
| rem the name of the script is drive path name of the Parameter %0 | |
| rem (= the batch file) but with the extension ".ps1" | |
| set PSScript=%~dpn0.ps1 | |
| set args=%1 | |
| :More | |
| shift | |
| if '%1'=='' goto Done | |
| set args=%args%, %1 | |
| goto More | |
| :Done | |
| powershell.exe -NoExit -Command "& '%PSScript%' '%args%'" |
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
| Param( | |
| [string]$filePath | |
| ) | |
| if(!(Test-Path C:\tools)) { | |
| Write-Host "The required tools are not on the current computer" | |
| Write-Host "Please copy the tools folder from S:\media\ to your C: drive" | |
| exit | |
| } | |
| $fileName=[io.path]::GetFileNameWithoutExtension("$filePath") | |
| $directoryName=[io.path]::GetDirectoryName("$filePath") | |
| Write-Host "Converting $filePath to $directoryName\$fileName.avi" | |
| C:\tools\ffmpeg\bin\ffmpeg -i "$filePath" -qscale 0 "$directoryName\$fileName.avi" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment