NextPVR Forums

Full Version: Recording naming pattern - channel name?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've searched a fair amount and can't figure this one out. Is it possible to include the channel name somewhere in the file naming pattern for recorded shows? Currently when I record an OTA show it is named like "Blindspot_20160303_20002100.ts" and I want to include something like "Blindspot_CBS2-HD_20160303_20002100". I need the channel info somewhere in the name so I can use different comskip ini's for different channels to strip out commercials correctly.
buckeyestargazer Wrote:I need the channel info somewhere in the name so I can use different comskip ini's for different channels to strip out commercials correctly.

Are you calling Comskip from PostProcessing.bat (or ParallelProcessing.bat)? If so, the 2nd parameter is the channel number of the recording. See this sample PostProcessing.bat for some examples:
Code:
@echo off
Rem PostProcessing.bat
Rem This script will be run automatically by NextPVR when found after a recording is finished

cd C:\Users\Public\NPVR\Scripts\

Rem The script is called with four parameters
Rem %1 is the fully qualified name of the recorded mpeg file.
Rem %2 is the channel number of the recording
echo Postprocessing.bat invoked for recording %1 (OID %3) from channel %2 at %date% %time% >>..\logs\postprocessing.log

Rem The part below can be used to not run Comskip on certain channels, please modify for your conveniance.
Rem The channel numbers that should be skipped are the numbers between the double quotes ("").
Rem You can add "if" lines as much as you want
Rem To disable this behaviour use channel numbers outside the normal range, put a "rem" before the "if" or delete the "if" lines

Rem list of channels to not run comskip on
Rem if "%2" == "27" goto eof
Rem if "%2" == "36" goto eof

Rem If desired, limit the number of simultaneous instances of comskip running concurrently (to limit CPU or disk I/O)

:next
set /a "delay=%2%%60"
echo   ---  sleeping a pseudo-random number of seconds (%delay%) to avoid simultaneous execution >>..\logs\postprocessing.log
timeout %delay%

:check
tasklist | find /c "comskip" > ..\logs\%3.txt
set /p count= <..\logs\%3.txt
if %count% geq 1 (
  echo ...%count% comskips running now, waiting 1 minute >>..\logs\postprocessing.log
  timeout 60
  goto check
)
del ..\logs\%3.txt

rem continuing now

Rem this trick also makes it possible to have dedicated comskip.ini file for certain channels.
Rem if "%2" == "79" goto channel79
Rem if "%2" == "72" goto channel72
Rem if "%2" == "65" goto channel65
Rem use the default comskip.ini for all other channels
goto generic

:channel79
comskip --ini=channel79.ini %1
goto continue
:channel72
comskip --ini=channel72.ini %1
goto continue
:channel65
rem This is an example of how to reuse a previously learned logo to prevent Comskip from learning the wrong logo
comskip --ini=channel65.ini --logo=channel65.logo.txt %1
goto continue

:generic
Rem The actual run of Comskip. Only one parameter, the name of the mpeg file to process.
Rem Comskip will read its settings from the Comskip.ini found in the same directory as Comskip.exe
Rem Both are supposed to be in the GBPVR default program directory. (C:\Program Files\devnz\gbpvr\)
echo Launching comskip on %1 at %date% %time% >>..\logs\postprocessing.log
"c:\program files (x86)\Comskip\comskip.exe" %1
:continue

Rem Once the commercials have been identified you can run comclean to delete the commercials from the recording.
Rem Do this only when you are not using the Skip function in the GBPVR viewer.
Rem To enable comclean remove the word "Rem" from the following line.
rem call comclean %1

:eof
Rem Now run CCextractor to get the subtitles
Rem echo Launching ccextractor at %date% %time% >>.\logs\postprocessing.log
Rem "C:\program files\ccextractor\ccextractorwin.exe" -srt %1 -o "%~dpn1.srt"


REM ok, ready to rename the file... but first check to make sure no one is watching it!
REM try renaming the file to the same name, see if gets an error
:checkopen
ren %1 "%~nx1"
if errorlevel 1 goto waitandcheck
goto rename
:waitandcheck
REM if we got here, the rename failed so wait a minute and try again
sleep 60
goto checkopen

:rename
Rem Run imageGrabLite to get any new image files and rename the recording files
"C:\Program Files (x86)\NPVR\imageGrabLite.exe" --oid %3 --zap2it --rename --nfo

echo PostProcessing.bat for %1 completed at %date% %time% >>..\logs\postprocessing.log
Thanks for the reply. I'm actually using MCEBuddy to process the recordings, which uses comskip. Unfortunately I don't have a clue what postprocessing.bat and parallelprocessing.bat mean.

However if the second set of numbers indicates the channel, I think I might be able to set up MCEBuddy to use a certain comskip ini for certain channels. Instead of the actual channel designation (like "CBS2-HD" etc) I can use that second set of numbers to tell MCEBuddy which ini file to use.

But now you've got me curious about using nextpvr and comskip. Can you point me to any resources that explains how to do it? Is it possible to watch a recording at the same time it is being processed by comskip?
buckeyestargazer Wrote:Unfortunately I don't have a clue what postprocessing.bat and parallelprocessing.bat mean.

ParallelProcessing.bat gets executed by NextPVR when it begins a recording. PostProcessing.bat gets executed after a recording completes. You can put whatever commands you'd like in those files. (Note: I don't believe that any shell files are installed when you do a NextPVR install, so you would need to create one or both of them.) See this page in the wiki for more details.
buckeyestargazer Wrote:But now you've got me curious about using nextpvr and comskip. Can you point me to any resources that explains how to do it? Is it possible to watch a recording at the same time it is being processed by comskip?

See this page in the wiki for more information about using Comskip with NextPVR.