forked from j62/ctbrec
Add post-processing examples for Windows and Linux
This commit is contained in:
parent
1d632e6ce1
commit
9db844b5d1
|
@ -0,0 +1,17 @@
|
||||||
|
REM This script is just a wrapper to call the actual powershell script.
|
||||||
|
REM But you do something complete different here, too.
|
||||||
|
REM
|
||||||
|
REM If you want to use powershell, make sure, that your system allows the execution of powershell scripts:
|
||||||
|
REM 1. Open cmd.exe as administrator (Click on start, type cmd.exe, right-click on it and select "Run as administrator")
|
||||||
|
REM 2. Execute powershell
|
||||||
|
REM 3. Execute Set-ExecutionPolicy Unrestricted
|
||||||
|
|
||||||
|
@echo off
|
||||||
|
|
||||||
|
set directory=%1
|
||||||
|
set file=%2
|
||||||
|
set model=%3
|
||||||
|
set site=%4
|
||||||
|
set unixtime=%5
|
||||||
|
|
||||||
|
powershell -F C:\Users\henrik\Desktop\ctbrec\pp.ps1 -dir "%directory%" -file "%file%" -model "%model%" -site "%site%" -time "%unixtime%"
|
|
@ -0,0 +1,17 @@
|
||||||
|
# parse command line parameters
|
||||||
|
param (
|
||||||
|
[Parameter(Mandatory=$true)][string]$dir,
|
||||||
|
[Parameter(Mandatory=$true)][string]$file,
|
||||||
|
[Parameter(Mandatory=$true)][string]$model,
|
||||||
|
[Parameter(Mandatory=$true)][string]$site,
|
||||||
|
[Parameter(Mandatory=$true)][string]$time
|
||||||
|
)
|
||||||
|
|
||||||
|
# convert unixtime into a date object
|
||||||
|
$epoch = get-date "1/1/1970"
|
||||||
|
$date = $epoch.AddSeconds($time)
|
||||||
|
|
||||||
|
# print out a theoretical new file name, you could use "rename" here, to rename the file
|
||||||
|
# or move it somewhere or ...
|
||||||
|
$newname = "$($model)_$($site)_$($date.toString("yyyyMMdd-HHmm")).ts"
|
||||||
|
ren $file $newname
|
Loading…
Reference in New Issue