multiple ini's?

To discuss the tuning of comskip and for posting your ini files
Post Reply
videogamingtown
Posts: 2
Joined: Tue Nov 15, 2011 10:09 pm

multiple ini's?

Post by videogamingtown »

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/448 ... al-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
erik
Site Admin
Posts: 3369
Joined: Sun Aug 21, 2005 3:49 pm

Re: multiple ini's?

Post by erik »

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.
jflet1
Posts: 1
Joined: Fri Nov 18, 2011 11:14 pm

Re: multiple ini's?

Post by jflet1 »

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 !
ianken
Posts: 5
Joined: Mon Mar 19, 2012 4:10 am

Re: multiple ini's?

Post by ianken »

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).
erik
Site Admin
Posts: 3369
Joined: Sun Aug 21, 2005 3:49 pm

Re: multiple ini's?

Post by erik »

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: Select all

@echo off
cmd /v /k call recurse.bat  "." *.ts


This calls the recursive tree walker recurse.bat

Code: Select all

@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: Select all

@echo on
 F:\Capture\comskip.exe -q --quality --ini=%2 %1            
del "F:\Capture\lock.%3"
exit
Post Reply