Comskip Support Forum

Comskip is a free commercial detector, browse the forum for more information
It is currently Sun May 19, 2013 4:20 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: multiple ini's?
PostPosted: Thu Nov 17, 2011 7:54 pm 
Offline

Joined: Tue Nov 15, 2011 10:09 pm
Posts: 2
ive read around that comskip can use different ini files for different channels.. the way i want it to work is by drag and drop.. as in drag and drop my recorded files and output them via videredo automatically.. i stumbled across this script which i am currently using http://www.dvbviewer.tv/forum/topic/44842-automatic-commercial-removal-script/ because i am using dvbviewer software to record.

i would like to be able to just drag and drop my files and have it look in the file name for the channel and use that ini file.

can anyone help ?

i am using uk freesat channels btw!

Cheers,
Rob


Top
 Profile  
 
 Post subject: Re: multiple ini's?
PostPosted: Fri Nov 18, 2011 2:32 pm 
Offline
Site Admin

Joined: Sun Aug 21, 2005 3:49 pm
Posts: 2438
Make a script which uses one parameter, the filename to process, then analyse the parameter to extract the channel name and use that information to select the ini file to use. Then invoke comskip with the right ini file.
To know how to make such a script I suggest you open a cmd window and use "help for" and "help if" commands to learn about conditional processing and parameters in a command script.


Top
 Profile  
 
 Post subject: Re: multiple ini's?
PostPosted: Fri Nov 18, 2011 11:47 pm 
Offline

Joined: Fri Nov 18, 2011 11:14 pm
Posts: 1
Firstly, congratulations on producing a fantastic piece of software :D

At the moment, the big challenge is to produce a .ini that works for ALL channels... which is never really going to be possible as each channel is different (eg some channels have logos, other channels do not).

Since MCE and I guess the other PVRs embed the recording TV channel in the filename, it really seems a waste not to use this valuable piece of information, so that comskip can be really tuned to the behaviour of a particular channel.

Imagine if a library of .ini files is made available, eg

Comskip-BBC1.ini
Comskip-BBC2.ini
Comskip-Film4.ini
Comskip-Movies4Men.ini

When Comskip is launched, it could parse the recording TV channel from the filename and then load the .ini that is absolutely tuned to the channel. This can only improve advert detection even more.

Moving forward,
It actually becomes easier to share ini files then, because they are specific, and easy to compare.

ie My Comskip-Film4.ini works better than your Comskip-Film4.ini :)

A simple FTP directory could hold the files for each channel, and users could submit their tuned files.
There could also be a summary for each channel -eg

Name UsesAdverts UsesLogo UsesBlankFrames
Film4 Yes Yes No

Name UsesAdverts UsesLogo UsesBlankFrames
BBC1 No

Even holding a summary table for all users, would get some greater clarity for everyone.

Just a thought on how to move comskip from being brilliant to awesome !


Top
 Profile  
 
 Post subject: Re: multiple ini's?
PostPosted: Tue Mar 20, 2012 7:16 am 
Offline

Joined: Mon Mar 19, 2012 4:10 am
Posts: 5
My $0.02

It'd be great if the INI file were XML with some tags to tie blocks of config settings to specific file name sub strings. This would make building a config for a particular system a bit more manageable. I'd imagine there would be a set of global settings, and then sub sections for each file name matching string...

A wrapper for comskip would be be pretty trivial (design wise) to do in C# (or any language with robust string/xml parsing support).


Top
 Profile  
 
 Post subject: Re: multiple ini's?
PostPosted: Tue Mar 20, 2012 5:40 pm 
Offline
Site Admin

Joined: Sun Aug 21, 2005 3:49 pm
Posts: 2438
This set of batch files will recursively go through all folders below the start folder and run comskip on all .ts files without a corresponding .txt file
A part of the filename of the recording will be used to select a ini file.
Multiple comskips will be run in paralell to maximize the processor load.
You will need to adapt to your folder setup and path to executables.
A sleep.exe program is used to sleep for some seconds, you need to google to find one or find another solution.

Rather complex. Will cause windows to pop up so more geared towards use on a server.
I removed some more complexity you will not need so there may be errors in the script.

Hope this will provide some inspiration.

Top level batch file
Code:
@echo off
cmd /v /k call recurse.bat  "." *.ts


This calls the recursive tree walker recurse.bat
Code:
@echo off
if exist lock.1 del /q lock.1
if exist lock.2 del /q lock.2
if exist lock.3 del /q lock.3
if exist lock.4 del /q lock.4
if exist lock.5 del /q lock.5
if exist lock.6 del /q lock.6
if exist lock.7 del /q lock.7
if exist lock.8 del /q lock.8

:recurse
pushd "%1"
rem do not enter folders that have ".svn" name
if not "%~1"==.svn (
    for /d %%i in (*) do call :recurse "%%i" %2
   for %%f in ("%2") do if not exist "%%~dpnf.txt" (
      set INI=%%~nf.ini
rem extract the part of the filename used to identify the associated ini file. In this case the part of the filename starting at character 19.
      call :schedule "%%f" "F:\Capture\!INI:~19!"
   )
)
popd
goto :eof

:schedule
:again
rem The for loop will start workers and waits for a free slot to become available. Current amount of workers set to 3, max can be 8.
for /L %%c in (1,1,3) do if not exist "F:\Capture\lock.%%c"  (
   echo lock > "F:\Capture\lock.%%c"
   start "worker" F:\Capture\processsingle.bat %1 %2 %%c
   goto :eof
)
F:\Capture\sleep.exe 1
goto :again
:started
goto :eof


This starts the worker for every file that needs to be processed, possible starting multiple workers if needed.
processsingle.bat
Code:
@echo on
 F:\Capture\comskip.exe -q --quality --ini=%2 %1           
del "F:\Capture\lock.%3"
exit


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group