INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: TV Post Processing  (Read 1348 times)

jachin99

  • Citizen of the Universe
  • *****
  • Posts: 559
TV Post Processing
« on: September 25, 2019, 11:30:13 am »

Is there a way to run a postprocessing script after a recording ends in MC?  I want to trigger a script that cuts commercials.  Thanks.
Logged

jachin99

  • Citizen of the Universe
  • *****
  • Posts: 559
Re: TV Post Processing
« Reply #1 on: September 25, 2019, 11:38:11 am »

I found a thread describing how to do this per recording but I'm not sure how to do it for all recordings. 

Edit: I might have figured this out but we will see. 
Logged

muzicman0

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1239
Re: TV Post Processing
« Reply #2 on: October 03, 2019, 04:58:36 pm »

If you can't get it to work globally, you can script it.  Below is my powershell script to do exactly what you want.  You would have to do 3 things to make it work:

1. Change the $watcher.path variable to your recorded TV path
2. Change the path to your copy of Comskip
3. Set the execution policy for Powershell (here is a great resource I found online)

Code: [Select]
### SET FOLDER TO WATCH + FILES TO WATCH + SUBFOLDERS YES/NO
    $watcher = New-Object System.IO.FileSystemWatcher
    $watcher.Path = "D:\OneDrive\Recorded TV"
    $watcher.Filter = "*.ts"
    $watcher.IncludeSubdirectories = $true
    $watcher.EnableRaisingEvents = $true 

### DEFINE ACTIONS AFTER AN EVENT IS DETECTED
    $action = { $path = $Event.SourceEventArgs.FullPath
                $changeType = $Event.SourceEventArgs.ChangeType
                Start-Process -FilePath "C:\Users\Steven Wittwer\Documents\Comskip\comskip.exe" -ArgumentList `"$path`"
                Write-Host "$(Get-Date), ComSkip Processing started on $path"

              }

 
### DECIDE WHICH EVENTS SHOULD BE WATCHED
    Register-ObjectEvent $watcher "Created" -Action $action
#    Register-ObjectEvent $watcher "Changed" -Action $action
#    Register-ObjectEvent $watcher "Deleted" -Action $action
#    Register-ObjectEvent $watcher "Renamed" -Action $action
    while ($true) {sleep 5}

What this does is monitor for any new .ts files, and will run comskip on them.  I run the script on startup.
Logged
Pages: [1]   Go Up