
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://kb.speeddemosarchive.com/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://kb.speeddemosarchive.com/index.php?action=history&amp;feed=atom&amp;title=R%26D</id>
		<title>R&amp;D - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://kb.speeddemosarchive.com/index.php?action=history&amp;feed=atom&amp;title=R%26D"/>
		<link rel="alternate" type="text/html" href="https://kb.speeddemosarchive.com/index.php?title=R%26D&amp;action=history"/>
		<updated>2026-04-18T03:25:00Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.9</generator>

	<entry>
		<id>https://kb.speeddemosarchive.com/index.php?title=R%26D&amp;diff=4200&amp;oldid=prev</id>
		<title>Ballofsnow: R&amp;D - decimate</title>
		<link rel="alternate" type="text/html" href="https://kb.speeddemosarchive.com/index.php?title=R%26D&amp;diff=4200&amp;oldid=prev"/>
				<updated>2009-11-15T18:53:01Z</updated>
		
		<summary type="html">&lt;p&gt;R&amp;amp;D - decimate&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Auto Decimate=&lt;br /&gt;
Original topic: http://speeddemosarchive.com/forum/index.php/topic,10578.0.html&lt;br /&gt;
&lt;br /&gt;
So I revisited an AviSynth filter called Dup by Neuron2. It analyzes the video, looks for duplicate frames and has the ability to create a log file which can be parsed to determine if a video is likely F1, 2, or 3. The filter is not 100% accurate - such was my expectation the last time I visited this and subsequently became discouraged and gave up - but I don't think it needs to be.&lt;br /&gt;
&lt;br /&gt;
* Download [http://neuron2.net/dup/dupnew.html Dup] (2.30) and extract to AviSynth plugins directory&lt;br /&gt;
* Created two text files: dupcount.bat and RunNullVideoPass.vcf. Modify path to vdub.exe cli as needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;RunNullVideoPass.vcf&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VirtualDub.Open(VirtualDub.params[0]);&lt;br /&gt;
VirtualDub.RunNullVideoPass();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;dupcount.bat&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
SETLOCAL ENABLEDELAYEDEXPANSION&lt;br /&gt;
&lt;br /&gt;
SET vdubdir=C:\Program Files\VirtualDub-1.9.5&lt;br /&gt;
SET duplog=%~dp1dup.txt&lt;br /&gt;
SET unique=0&lt;br /&gt;
SET duplicate=0&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%vdubdir%\vdub.exe&amp;quot; /i RunNullVideoPass.vcf %1&lt;br /&gt;
&lt;br /&gt;
FOR /F &amp;quot;skip=2 tokens=3,6 delims=: &amp;quot; %%G IN ('type &amp;quot;%duplog%&amp;quot;') DO (&lt;br /&gt;
	IF &amp;quot;%%G&amp;quot;==&amp;quot;%%H&amp;quot; (&lt;br /&gt;
		IF !dupseq! LEQ 2 (&lt;br /&gt;
			SET /A unique= !unique! + 1&lt;br /&gt;
			SET /A duplicate= !duplicate! + !dupseq!&lt;br /&gt;
		)&lt;br /&gt;
		SET dupseq=0&lt;br /&gt;
	) ELSE (&lt;br /&gt;
		SET /A dupseq=!dupseq! + 1&lt;br /&gt;
	)&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
SET /A total = %unique% + %duplicate%&lt;br /&gt;
SET /A uniquepercent = (%unique% * 100) / %total%&lt;br /&gt;
ECHO.&lt;br /&gt;
ECHO Frames counted: %total%&lt;br /&gt;
ECHO Unique: %unique%&lt;br /&gt;
ECHO Percentage: %uniquepercent%&lt;br /&gt;
ECHO.&lt;br /&gt;
PAUSE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add following AviSynth code after separatefields&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Dup(threshold=20, blksize=16, debug=true, log=&amp;quot;dup.txt&amp;quot;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Open a command prompt: dupcount.bat avisynthscript.avs&lt;br /&gt;
&lt;br /&gt;
* Result of F1 video, short sample:&lt;br /&gt;
http://img5.imageshack.us/img5/866/dup.png&lt;br /&gt;
&lt;br /&gt;
Obviously not 100%, but if it's above 50%.... Can play with the thresholds after doing more testing... (nate? :) )&lt;br /&gt;
&lt;br /&gt;
Any thoughts?&lt;br /&gt;
&lt;br /&gt;
Extra links: [http://www.virtualdub.org/docs/vdscript.txt]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit- Menus will affect results from the dup filter... The above screenshot was a sample of sonic 2 which had a little bit of intro. Take out the intro and the percentage rises to 97 percent. May be possible to add a bit more logic to the batch file, detecting when there's a string of duplicates higher than say.. 3-5 and ignoring them.&lt;br /&gt;
&lt;br /&gt;
edit- Updated batch code with above idea, getting surprisingly accurate results: 95/49/33% on F1/F2/F3. Basically the code ignores sequences of DDDU or DDDDDDDDDU, etc. It will count only sequences of UU, DU, DDU.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://img188.imageshack.us/img188/5900/50520378.png&lt;br /&gt;
http://img188.imageshack.us/img188/4189/40394732.png&lt;br /&gt;
http://img181.imageshack.us/img181/2788/60997384.png&lt;/div&gt;</summary>
		<author><name>Ballofsnow</name></author>	</entry>

	</feed>