Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

 
Threshold Filter
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
limona
  Posted: Apr 17 2013, 09:24 AM


Newbie


Group: Members
Posts: 7
Member No.: 36442
Joined: 17-April 13



hi, i'm trying to put two filters on one video. both filters should use the opened, unfiltered video.
for example "threshold" and "Sketch Effect (Image Processor Plugin)" to get black / white shadows and sketchy lines

but the second filter normaly uses the first filtered material.
is there any possibility / plugin / script for virtualdub (or avisynth)?

hope i've described it clear smile.gif

thanks and greetings, limona
 
     Top
dloneranger
Posted: Apr 17 2013, 01:51 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



It it's a new virtualdub 1.10.1.test8 or greater then there are filter naming/blend/merging options
http://forums.virtualdub.org/index.php?act...hl=blend+layers

It's a bit weird, and this is the first time i've looked at it, but here's a first steps walkthrough

I'll just use box blur and threshold as two example filters

Add a filter threshold - right click on it and select 'name output' I called it thresh
Add a filter box blur and config it for lots of blur - right click on it and name output, I called it blur
Right click on the blur filter again and pick add input - right click on the new 'no connection' and change it to 'source' so that filter uses the original frame, not the one affected by the threshold filter
...phew almost there
Add the bland layers filter - pick normal for the mode
Right click on the blend layers filter and 'add input' twice
Change 1 of the blend layers 'no connection' to 'blur' and the other to 'thresh'
The go back to the blend layers config and you can alter the blend %



--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
limona
Posted: Apr 17 2013, 02:40 PM


Newbie


Group: Members
Posts: 7
Member No.: 36442
Joined: 17-April 13



great! your tutorial works very well!
thanks for the fast reply.

unfortunately if i take the "MSU Cartoonizer" filter i need (instead of "box blur") virtualdub crashes.

MSU Cartoonizer isn't working with this virtualdub release at all.
seems that MSU Cartoonizer isn't compatible with this release . Is it possible?
Do you have any suggestion?

Thanks and best, limona



crashinfo:
Crash reason: Access Violation

Crash context:
An out-of-bounds memory access (access violation) occurred in module 'MSU_Cartoonizer'...

...reading address 06D26002...

...while running filter "MSU Cartoonizer v 3.0" (FilterInstance.cpp:2157).
 
     Top
dloneranger
Posted: Apr 17 2013, 03:09 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



They never updated the older msu ones to work properly with newer virtualdubs
There is a 'try and fix it' option that was introduced just for them
In the filters dialog, select the msu filter you added then click the options button, and tick the 'force single framebuffer'

It's not a 100% guarantee but might help

--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
limona
Posted: Apr 19 2013, 12:49 AM


Newbie


Group: Members
Posts: 7
Member No.: 36442
Joined: 17-April 13



GREAT! It works! Thanks a lot
 
     Top
limona
Posted: Apr 19 2013, 11:40 AM


Newbie


Group: Members
Posts: 7
Member No.: 36442
Joined: 17-April 13



hy, one more question. is it also possible to batch "convert" jpg images in virtualdub? batch video files with this filters works nice.
if i open an image and export image sequence it works. but i can't batch this step. i understand if vd is not made for image processing...
kind regards
 
     Top
dloneranger
Posted: Apr 19 2013, 12:38 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



Yes you can

The easiest way to create a base script is to do everything like you normally would but instead of saving as avi, use the file menu's 'queue batch operation'
That'll save a .jobs file in the virtualdub directory. That .jobs file will have the script that will be used to automate the steps you went through.
(You could also use the 'save processing settings' to save a script file)

You copy and alter that .jobs file and use vdub.exe in a batch file to automate it all
(The normal file extension for scripts is .vdscript)

So here's an example saved job that loads images blurs them and exports the images as targa files

CODE
// VirtualDub job list (Sylia script format)
// This is a program generated file -- edit at your own risk.
//
// $signature 0 1
// $numjobs 1
//

// $job "Job 1"
// $input "C:\Users\Karl\Desktop\New folder\test0000.tga"
// $output "C:\Users\Karl\Desktop\New folder\test*.tga"
// $state 0
// $id 614773c704549230
// $start_time 00000000 00000000
// $end_time 00000000 00000000
// $script

VirtualDub.Open("C:\\Users\\Karl\\Desktop\\New folder\\test0000.tga","",0);
VirtualDub.audio.SetSource(1);
VirtualDub.audio.SetMode(0);
VirtualDub.audio.SetInterleave(1,500,1,0,0);
VirtualDub.audio.SetClipMode(1,1);
VirtualDub.audio.SetEditMode(1);
VirtualDub.audio.SetConversion(0,0,0,0,0);
VirtualDub.audio.SetVolume();
VirtualDub.audio.SetCompression();
VirtualDub.audio.EnableFilterGraph(0);
VirtualDub.video.SetInputFormat(0);
VirtualDub.video.SetOutputFormat(7);
VirtualDub.video.SetMode(3);
VirtualDub.video.SetSmartRendering(0);
VirtualDub.video.SetPreserveEmptyFrames(0);
VirtualDub.video.SetFrameRate2(0,0,1);
VirtualDub.video.SetIVTC(0, 0, 0, 0);
VirtualDub.video.SetCompression();
VirtualDub.video.filters.Clear();
VirtualDub.video.filters.Add("blur");
VirtualDub.audio.filters.Clear();
VirtualDub.subset.Clear();
VirtualDub.subset.AddRange(0,18);
VirtualDub.video.SetRange();
VirtualDub.project.ClearTextInfo();
 // -- $reloadstop --
VirtualDub.SaveImageSequence("C:\\Users\\Karl\\Desktop\\New folder\\test", ".tga", 4, 4, 95);
VirtualDub.audio.SetSource(1);
VirtualDub.Close();

// $endjob
//
//--------------------------------------------------
// $done


Next is to strip out most of the bits it doesn't need, and change the filenames to use cmdline parameters
CODE
VirtualDub.Open(VirtualDub.params[0],"",0);
VirtualDub.audio.SetSource(1);
VirtualDub.audio.SetMode(0);
VirtualDub.video.SetInputFormat(0);
VirtualDub.video.SetOutputFormat(7);
VirtualDub.video.SetMode(3);
VirtualDub.video.SetSmartRendering(0);
VirtualDub.video.SetPreserveEmptyFrames(0);
VirtualDub.video.SetFrameRate2(0,0,1);
VirtualDub.video.SetIVTC(0, 0, 0, 0);
VirtualDub.video.SetCompression();
VirtualDub.video.filters.Clear();
VirtualDub.video.filters.Add("blur");
VirtualDub.audio.filters.Clear();
VirtualDub.SaveImageSequence(VirtualDub.params[1], ".tga", 4, 4, 95);
VirtualDub.Close();


Then you'd set up a batch file to automate just dragging the first source image to it
Here's one that will process the files and save them with 'Modified-' at the start of the filename, in the same folder
CODE
@echo off

rem save to the same folder
set newfilepath=%~dp1
set newfilename=Modified-%~n1.tga

rem change the paths fo these to match your real exe and .vdscript locations
set VDubExe="C:\Users\Karl\Desktop\VirtualDub-1.10.3-test11\vdub.exe"
set MyScriptToRun="C:\Users\Karl\Desktop\VirtualDub-1.10.3-test11\BlurAndSaveAsTarga.vdscript"

%VDubExe% /i %MyScriptToRun% %1 "%newfilepath%%newfilename%"
if errorlevel 1 echo Oh dear an error happened
pause



--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
limona
Posted: Apr 19 2013, 02:08 PM


Newbie


Group: Members
Posts: 7
Member No.: 36442
Joined: 17-April 13



nice! it almost works.

the images have different resolutions. after saving the first image successfully it says:

"doesn't match the image dimensions of the first image"
 
     Top
dloneranger
Posted: Apr 19 2013, 02:28 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



Ahh, virtualdub does require the images to be the same for sequences
If it finds an images with a number 1 higher than the loaded one it'll assume it's a sequence
(Can't see any way around that)

There's a few ways you could work around that
1) make sure the files aren't numbered sequentially
2) resize them all to be the same size
3) make the batch file temporarily rename them before converting, then rename back after

Here's an example for #3 that'll separately process files dragged to it
CODE
@echo off
:loop
if %1.==. goto done
rem save to the same folder
set newfilepath=%~dp1
set newfilename=Modified-%~n1.tga
set origionalfilename=%~nx1
set tmpfilename=tmp_%newfilename%

set VDubExe="C:\Users\Karl\Desktop\VirtualDub-1.10.3-test11\vdub.exe"
set MyScriptToRun="C:\Users\Karl\Desktop\VirtualDub-1.10.3-test11\BlurAndSaveAsTarga.vdscript"

ren %1 "%tmpfilename%"

%VDubExe% /i %MyScriptToRun% "%newfilepath%%tmpfilename%" "%newfilepath%%newfilename%"
if errorlevel 1 echo Oh dear an error happened
ren "%newfilepath%%tmpfilename%" "%origionalfilename%"
shift
goto loop
:done
echo done
pause


--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
limona
Posted: Apr 19 2013, 02:53 PM


Newbie


Group: Members
Posts: 7
Member No.: 36442
Joined: 17-April 13



marvelous! now it works perfect. thanks again!
 
     Top
limona
Posted: Apr 19 2013, 07:27 PM


Newbie


Group: Members
Posts: 7
Member No.: 36442
Joined: 17-April 13



me again, maybe a new topic :-)
i saw on a "video cartoon app" a filter that smoothes threshold, it looked perhaps like the Oilpaint Filter (Pixel Bender Plugin) from PhotoShop Filtermenue.

tooncamera app:
http://a518.phobos.apple.com/us/r1000/111/....320x480-75.jpg
http://25.media.tumblr.com/b2d8ae808efe213...hv6x8o1_500.jpg

photoshop filter:
http://farm6.staticflickr.com/5018/5466337...8f8451547_z.jpg

i haven't seen the effect on videos or editing programs before.
is there a virtualdub filter like this or has it a different name?

greets
 
     Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
10 replies since Apr 17 2013, 09:24 AM Track this topic | Email this topic | Print this topic

<< Back to VirtualDub Filters and Filter Development