Skip to content

Instantly share code, notes, and snippets.

@RyanHirsch
Last active August 28, 2016 15:38
Show Gist options
  • Select an option

  • Save RyanHirsch/ba5c76d16eb6a168b403b98ec0c86d07 to your computer and use it in GitHub Desktop.

Select an option

Save RyanHirsch/ba5c76d16eb6a168b403b98ec0c86d07 to your computer and use it in GitHub Desktop.
Scripts for converting a video into `avi` for use in MediaShout
@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%'"
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