Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
16th January 2012, 16:08 | #701 | Link | |
Registered User
Join Date: May 2007
Posts: 109
|
Quote:
If you would try the latest code, please download this executable file. Before running it, make sure to put it under your AvsPmod folder. |
|
17th January 2012, 12:48 | #702 | Link | ||
Registered User
Join Date: Sep 2006
Location: Russia
Posts: 14
|
Quote:
options.dat was default. Quote:
I know |
||
17th January 2012, 18:21 | #703 | Link |
Registered User
Join Date: Sep 2006
Posts: 72
|
Great program. Is it possible to batch-script a whole directory full of images with just one single script for them all, using AvsPmod ?
For example, I have well over a thousand images of the last 10 years my family's lives, pets, mates, etc.. all taken on different devices from camera, to digital cameras, to mobile phones. They all exhibit varying levels of noise, most of it is jpeg noise, but I would just like to give them a once-over image clean with TNLMEANS, with a script similar to this. SetMTMode(2,6) SetMemoryMax(512) SetMTMode(5,6) ImageSource("D:\Camera_Pics\pic1.jpg", end = 300, use_DevIL=true) ConvertToYV12(interlaced=false) SetMTMode(2,6) TNLMeans(Ax=10,Ay=10, Sx=3,Sy=3, Bx=0,By=0, a=1.0, h=1.0, sse=true) At least 9 out of 10 pics come out really great with this simple script, some may need a slight sharpen at the end, but I'm happy with the result. So, instead of doing this task one by one, I am wondering if it's possible to use that one script on the whole directory ? Thanks for any help. |
17th January 2012, 18:38 | #704 | Link |
Registered User
Join Date: Dec 2001
Posts: 1,219
|
Yes, take a look at the Batch example macro in a text editor, and you should be able to see how to do it.
You can use SaveImage(filename='', framenum=None, index=None) in the macro to output to an image file. However, this does not allow you to specify any options as to image type or settings. |
17th January 2012, 18:48 | #705 | Link | |
Registered User
Join Date: Dec 2007
Location: Enschede, NL
Posts: 301
|
Quote:
Code:
file=GetSystemEnv("filename") FFVideoSource(file) etc. etc. Code:
setlocal set filename=%%~dpnP.mp4 "C:\Program Files\x264\x264.exe" "wrapper.avs" etc.etc. endlocal This way each directory can have his own wrapper.avs.
__________________
Roelofs Coaching |
|
19th January 2012, 15:34 | #706 | Link | |
Registered User
Join Date: Sep 2006
Posts: 72
|
Thanks for the two replies. I have been out of avisynth editing for the best part of a year, and so I am a little rusty.
Quote:
Is there no way of simply executing the script I posted above on a whole directory ? I am not worried about filenames, the images will be burned to DVD to be used on a home DVD upscaler so me and my family can sit back and look at them on a big HDTV. This is why they need a slight clean because when viewed upscaled they look a little grainy and noisy. If you have the time, could you do me a simple walk through using Avspmod and my script above ? I would be most appreciated if possible, many thanks. |
|
19th January 2012, 16:52 | #707 | Link |
Registered User
Join Date: Dec 2001
Posts: 1,219
|
You might want to take a look at Fritz Photo: http://forum.doom9.org/showthread.php?t=150291
I have never used it, but it is an interface for avisynth which is specifically designed for processing images. |
19th January 2012, 19:48 | #708 | Link | |
Registered User
Join Date: Dec 2007
Location: Enschede, NL
Posts: 301
|
Quote:
__________________
Roelofs Coaching |
|
19th January 2012, 20:31 | #709 | Link | |
Registered User
Join Date: Aug 2011
Posts: 15
|
Quote:
Do you accept donations? |
|
20th January 2012, 00:26 | #711 | Link |
Registered User
Join Date: Dec 2011
Posts: 192
|
@ChrisW77
This should work: Code:
suffix = ' new' format = '.png' using_jpg_quality_no_dialog_fix = False jpg_quality = 90 # Avisynth script. Replace the input path with "in_path". script = ur""" SetMTMode(2,6) SetMemoryMax(512) SetMTMode(5,6) ImageSource("in_path", end = 300, use_DevIL=true) ConvertToYV12(interlaced=false) SetMTMode(2,6) TNLMeans(Ax=10,Ay=10, Sx=3,Sy=3, Bx=0,By=0, a=1.0, h=1.0, sse=true) """ from os import listdir from os.path import splitext, basename, join dir_path = avsp.GetDirectory(title='Select a directory') if not dir_path: return avsp.NewTab() avs = avsp.GetWindow().currentScript progress = avsp.ProgressBox(max=1000, title='Batch processing progress') paths = [join(dir_path, filename) for filename in filter( lambda x: x.endswith('.jpg'), listdir(dir_path))] for i, path in enumerate(paths): progress.Update(i*1000.0/len(paths), basename(path)) # avsp.SetText(script.replace('in_path', path)) # converts to ascii avs.SetText(script.replace('in_path', path)) try: if using_jpg_quality_no_dialog_fix: avsp.SaveImage(splitext(path)[0] + suffix + format, quality=jpg_quality) else: avsp.SaveImage(splitext(path)[0] + suffix + format) except: avsp.MsgBox('Processing failed at ' + basename(path)) break progress.Destroy() avsp.CloseTab() UPDATE: the modification is included in AvsPmod 2.3.0. An improved version of this script is available at https://github.com/vdcrim/avsp-macros Last edited by vdcrim; 9th June 2012 at 13:02. Reason: update for AvsPmod 2.3.0 |
20th January 2012, 01:43 | #712 | Link |
Registered User
Join Date: Sep 2006
Posts: 72
|
vdcrim, many thanks, will try that a bit later. Quality will be PNG, although I will see what 90% jpeg looks like, it depends on how well TNLMeans handles some of my older, low megapixel camera and phone pics. And Zarxrax, thanks for the Fritz Photo suggestion.
|
28th January 2012, 20:45 | #713 | Link |
Oz of the zOo
Join Date: May 2005
Posts: 208
|
Avisynth itself loads dlls and reports names of functions in a table, there is no parsing of dlls in AvsPmod.
And anyway there's nothing wrong in autoloading of your plugins if you use all of them in most of your scripts. |
29th January 2012, 07:48 | #714 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Tis a shame that there is no way to relate argument ranges within a plug description (Avisynth General).
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 29th January 2012 at 07:53. |
3rd February 2012, 17:28 | #715 | Link |
Registered User
Join Date: Dec 2011
Posts: 192
|
Improved GetTextEntry macro function
I was trying to find out if it was possible to add a button to search for file in a dialog box generated by the GetTextEntry macro function, and I ended up rewriting almost the whole thing. It adds some new functionality:
- New entry types in addition to simple text field. - A single line can contain multiple entries. - Horizontal separator between entries. - Customizable dialog box width. This new version of GetTextEntry is backwards compatible with the current one. It adds two new optional parameters and extend the existing ones. I'd be happy if it were to be incorporated to an eventual next AvsPmod release. UPDATE: Added in AvsPmod 2.3.0 This is an example of dialog box showing the new different types of entry. It was generated with this macro demo: Code:
title = 'Improved GetTextEntry macro function demo' message = [ 'Separator, both text and line optional', ['Regular text field 1', 'Regular text field 2'], 'Text field with browse for file button ("open" dialog)', 'Text field with browse for file button ("save" dialog)', 'Text field with browse for directory button', '', ['Drop-down list (writable)', 'Drop-down list (read only)'], ['Spin', 'Check'], 'Slider (horizontal)', 'No type specified, defaults to regular text field ' ] default = [ 200, 'default text', 'default file path 1', ('default file path 2', 'Avisynth Script (*.avs)|*.avs'), 'default directory path', '', [('list1 1', 'list1 2', 'list1 3', 'list1 2'), ('list2 1', 'list2 2', 'list2 3', 'list2 3')], [(4, 0, 10, 2, 1), True], (71, 0, 100, 25) ] types = [ 'sep', '', 'file_open', 'file_save', 'dir', 'sep', ['list_writable', 'list_read_only'], ['spin', 'check'], 'slider_h' ] width = 300 options = avsp.GetTextEntry(message, default, title, types, width) if not options: return avsp.MsgBox((u'Field #{}: {}\n' * len(options)).format( *[i[j] for i in zip(range(1, len(options) + 1), options) for j in range(2)]), 'Returned values') Last edited by vdcrim; 9th June 2012 at 13:35. Reason: update for AvsPmod 2.3.0 |
4th February 2012, 16:03 | #719 | Link |
Registered User
Join Date: Sep 2009
Posts: 378
|
Also for dual monitor+ setups a way to run one instance of an external player if possible outside of that app, currently using mplayer on seperate screen but can't get it to only run one instance each time I want to run amended script in the external player it starts a new one. :-(
|
7th February 2012, 00:19 | #720 | Link | |
Registered User
Join Date: Dec 2011
Posts: 192
|
Quote:
Edit: added this too. Edit 2: corrected small mistake. Edit 3: cosmetics. Edit 4: fixed error. This is the last update. UPDATE: link removed, changes incorporated in AvsPmod 2.3.0 Last edited by vdcrim; 9th June 2012 at 13:40. Reason: update for AvsPmod 2.3.0 |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|