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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th June 2019, 17:03   #1241  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by StainlessS View Post
Just a little question, is this script known to work ok (fast) where source are image files rather than video clip ?

EDIT: Perhaps try timing with same set up on video source, any difference ?
I played with the script quite a bit, the type of source does not make a difference. It's mostly the high resolution that slows it down and consumes lots of memory/CPU.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 20th June 2019, 17:12   #1242  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by johnmeyer View Post
I assume the breakthrough increase in speed was from the avstp.dll addition since it didn't appear that he was getting any MT even with the hard-wired threads(4) statement. I also assume that the SetMemoryMax increase had no impact on speed since, in my experience, memory allocation is entirely a setting for stability, not performance.

Feel free to correct me, if these assumptions are incorrect.
They are partially incorrect. The number of threads you pass to prefetch and the resolution make it necessary to increase the value for SetMemoryMax(). With 64 logical cores you need a pretty high prefetch value to get that CPU working. Avstp.dll helps but does not perform miracles.
__________________
Groucho's Avisynth Stuff

Last edited by Groucho2004; 20th June 2019 at 17:32.
Groucho2004 is offline   Reply With Quote
Old 20th June 2019, 17:30   #1243  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by Meloware View Post
Wow -what a change! I have never seen this CPU so active. The same script is now rendering at 2.5 frames per second. The script has threads set at 16, yet the CPU is at 96% utilization with all 64 threads fully active. Memory consumption is at 20% of the available 64GB. I don't believe I have any more computer available to improve this performance more.
Well, you just widened the AVS script bottleneck a bit. In order to optimise the script you have to play with the variables I mentioned and test without ffmpeg obfuscating the script performance.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 20th June 2019, 17:59   #1244  |  Link
Meloware
Registered User
 
Join Date: Dec 2018
Location: Massachusetts USA
Posts: 25
The following is the results from a series of tests I just performed with the script I posted earlier, plus the changes suggested by Groucho2004. Each test runs the same script and conditions, except for the indicated thread count settings.

The system is based on a Threadripper 2990WX, (32 cores/ 64 threads) with 64GB available ECC ram. The frame source and destination reads and writes are using SSD and M.2 drives. The video source is an image sequence of JPGs, at a resolution of 2604 x 1738 pixels. The output is another frame sequence, cropped and resized to 1640 x 1280. The chosen script processing option is “result1” (Autolevels, Autowhite).

The idle system is using 9% of memory, as reported by CPUID. The script is run via command line, using ffmpeg, and is allowed to run 500 frames, before the frame rendering rate is recorded from ffmpeg and CPU and memory utilization is read out of CPUID.

I hope this summary is useful for the developers and those who are considering a serious investment in a new machine.

Code:
Threads         CPU         Memory      FPS
     8          65%         17%        1.5
    16          97%         20%        2.4
    24          99%         30%        2.6
    32          99%         34%        2.6
Meloware is offline   Reply With Quote
Old 20th June 2019, 18:28   #1245  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
This is the best result I get with that script on my 9 year old i5 2500K (4 cores/threads @4GHz):

Code:
SetMemoryMax(16000)
Using prefetch(10)

[Runtime info]
Frames processed:               100 (1000 - 1099)
FPS (min | max | average):      0.085 | 155632 | 1.679
Process memory usage (max):     6426 MiB
Thread count:                   25
CPU usage (average):            98.9%
Command line was "avsmeter64 test.avs -range=1000,1099 -log". Even though the CPU only has 4 cores, the best performance was with 10 threads passed to prefetch().
__________________
Groucho's Avisynth Stuff

Last edited by Groucho2004; 20th June 2019 at 18:31.
Groucho2004 is offline   Reply With Quote
Old 20th June 2019, 18:50   #1246  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,377
If a 4C/4T older CPU can get 1.6fps , that suggests that there are still some inefficiencies and his numbers still are low

Could it be that many plugins used Intel optimized compilers in the past ? IIRC there were some investigations into this in the past about unexpectedly poor AMD performance
poisondeathray is offline   Reply With Quote
Old 20th June 2019, 19:05   #1247  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by poisondeathray View Post
If a 4C/4T older CPU can get 1.6fps , that suggests that there are still some inefficiencies and his numbers still are low

Could it be that many plugins used Intel optimized compilers in the past ? IIRC there were some investigations into this in the past about unexpectedly poor AMD performance
His numbers are with ffmpeg encoding. He has not used AVSMeter.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 20th June 2019, 19:10   #1248  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Terneuzen, Zeeland, the Netherlands, Europe, Earth, Milky Way,Universe
Posts: 689
Quote:
Originally Posted by Meloware View Post

Why Blender 3D? Blender is my Open Source "Swiss Army Knife" for graphics.
Ok I understand. But then why Avisynth?

Fred.
__________________
About 8mm film:
http://www.super-8.be
Film Transfer Tutorial and example clips:
https://www.youtube.com/watch?v=W4QBsWXKuV8
More Example clips:
http://www.vimeo.com/user678523/videos/sort:newest
videoFred is offline   Reply With Quote
Old 20th June 2019, 19:45   #1249  |  Link
Meloware
Registered User
 
Join Date: Dec 2018
Location: Massachusetts USA
Posts: 25
Quote:
Originally Posted by videoFred View Post
Ok I understand. But then why Avisynth?

Fred.
It is a different tool, and does 95% of everything I need, very well, without a lot of hand editing. The occasional bump from the stabilizer gets corrected, in Blender, the minutia of levels/gamma differences, and center box cropping, from scene to scene, but your scripts and AVISynth is an excellent "wide brush" tool which, in my opinion, is absolutely needed in the work flow! This horrible pink fade we see, in old Eastman Color, I have yet to correct well in either Blender or Photoshop, but this script probably makes the best color corrections I could expect from a red faded film!
Meloware is offline   Reply With Quote
Old 20th June 2019, 19:50   #1250  |  Link
Meloware
Registered User
 
Join Date: Dec 2018
Location: Massachusetts USA
Posts: 25
Quote:
Originally Posted by Groucho2004 View Post
His numbers are with ffmpeg encoding. He has not used AVSMeter.
Correct. And thank you for the polite nudge into using your amazing tool. Your posted example of the command was very tactful in helping someone not so familiar with AVSMeter's features.

So, below are the same tests, as monitored by AVSMeter64. It would seem my system's sweet spot is in setting the script to about 20 threads...
Code:
[Clip info]
Number of frames:                 1586
Length (hh:mm:ss.ms):     00:01:06.083
Frame width:                      1640
Frame height:                     1280
Framerate:                      24.000 (24/1)
Colorspace:                       YV12
Audio channels:                    n/a
Audio bits/sample:                 n/a
Audio sample rate:                 n/a
Audio samples:                     n/a

[Runtime info] Setting in script for 8 Threads
Frames processed:               500 (1 - 500)
FPS (min | max | average):      0.226 | 196079 | 2.078
Process memory usage (max):     4668 MiB
Thread count:                   138
CPU usage (average):            57.5%

Time (elapsed):                 00:04:00.601

[Runtime info]  Setting in script for 16 Threads
Frames processed:               500 (1 - 500)
FPS (min | max | average):      0.181 | 104167 | 2.378
Process memory usage (max):     7818 MiB
Thread count:                   146
CPU usage (average):            95.8%

Time (elapsed):                 00:03:30.231

[Runtime info] Setting in script for 20 Threads
Frames processed:               500 (1 - 500)
FPS (min | max | average):      0.220 | 105263 | 3.223
Process memory usage (max):     8662 MiB
Thread count:                   150
CPU usage (average):            89.4%

Time (elapsed):                 00:02:35.153

Time (elapsed):                 00:03:23.059

[Runtime info] Setting in script for 24 Threads
Frames processed:               500 (1 - 500)
FPS (min | max | average):      0.205 | 96154 | 3.231
Process memory usage (max):     9305 MiB
Thread count:                   153
CPU usage (average):            89.2%

Time (elapsed):                 00:02:34.740

[Runtime info] Setting in script for 32 Threads
Frames processed:               500 (1 - 500)
FPS (min | max | average):      0.098 | 69444 | 3.147
Process memory usage (max):     13708 MiB
Thread count:                   162
CPU usage (average):            87.6%

Time (elapsed):                 00:02:38.894
Meloware is offline   Reply With Quote
Old 20th June 2019, 20:29   #1251  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,377
Maybe 2 instances of 6-8 threads would yield higher numbers overall
poisondeathray is offline   Reply With Quote
Old 20th June 2019, 22:06   #1252  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by poisondeathray View Post
Maybe 2 instances of 6-8 threads would yield higher numbers overall
Quite possible. Maybe Avisynth becomes less and less efficient with an increasing number of threads, particularly with scripts that run various temporal filters.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 20th June 2019, 23:28   #1253  |  Link
Meloware
Registered User
 
Join Date: Dec 2018
Location: Massachusetts USA
Posts: 25
Quote:
Originally Posted by poisondeathray View Post
Maybe 2 instances of 6-8 threads would yield higher numbers overall
I ran 2 instances of AvsPmod, and pointed one instance to frame 1, and the other to frame 750. I then hit "play" on each and allowed the ImageWriter function to write out frames as set in my result option "C1". Each instance of the script was set to operate with 12 threads.
CPUID reported the CPU was 95%+ occupied, with 35% memory use. I then reviewed the time stamps over a complete 6 minute period of rendering. There were 1050 frames total rendered frames, which suggests a total system performance of about 2.9 frames per second. This doesn't appear to be an exciting option, compared to a single instance running at 20 threads.

Groucho2004 - I noticed AVSMeter will allow me to run the script and the Imagewriter() function will write frames. Is this an option for rendering out of the script? The images are low quality. Do you know if there is a setting option to improve jpg quality? Lastly, AVSMeter will only allow a single instance to be run, at a time. Was this intentional? Maybe the option to run multiple instances might be good.

Since getting this system, it has been rare to find any software that shows any interest in using 64 threads. Blender tries, hard, but it seems like many of the legacy libraries and compile options have no concept of what to do with 32 cores.

The help I have been offered, here, has pegged all 64 threads to the limit. This is the first time I have seen a single instance of an app even come close. Perhaps the future processing algorithms may become more efficient, for my AMD chip, but at least I am seeing the resources in my investment finally being used. Life has already improved, dramatically. I certainly hope further development will improve performance on multi-core AMD chips, but I already appreciate the current improvement!
Meloware is offline   Reply With Quote
Old 20th June 2019, 23:38   #1254  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by Meloware View Post
Groucho2004 - I noticed AVSMeter will allow me to run the script and the Imagewriter() function will write frames. Is this an option for rendering out of the script? The images are low quality. Do you know if there is a setting option to improve jpg quality? Lastly, AVSMeter will only allow a single instance to be run, at a time. Was this intentional? Maybe the option to run multiple instances might be good.
There is an option in the AVSMeter.ini file ("AllowOnlyOneInstance" ) which, if set to '0', allows multiple instances of the program. Check the included documentation. However, if you just want to write an image sequence from a script I recommend using avsr.

As for the quality of the images I can imagine that png or tif will produce better results than jpeg. Check the documentation.
__________________
Groucho's Avisynth Stuff

Last edited by Groucho2004; 21st June 2019 at 12:53. Reason: clarification
Groucho2004 is offline   Reply With Quote
Old 21st June 2019, 11:47   #1255  |  Link
bassquake
Registered User
 
Join Date: Jan 2007
Posts: 45
Quote:
Originally Posted by johnmeyer View Post
I forgot to take Autolevels out once I added GamMac. Autolevels never worked for me and I never, ever used it.

Also, I second Fred's recommendation to use a lower resolution.
I'd rather keep the high resolution capture for future proofing!

Anyhoo, took out Autolevels and the Denoise stuff as I prefer to maintain the film grain. Results are now at around 7fps in ffmpeg which will do for now.

Edit: Cranking threads variable to 64 when changing the Prefetch(4) to Prefetch(threads) gives me up 12fps! Looks like it forces the cpu to render at a much higher percentage. Nice

Last edited by bassquake; 21st June 2019 at 16:52. Reason: Removed uneeded info
bassquake is offline   Reply With Quote
Old 21st June 2019, 12:39   #1256  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by Groucho2004 View Post
Quite possible. Maybe Avisynth becomes less and less efficient with an increasing number of threads, particularly with scripts that run various temporal filters.
I suppose that memory bandwidth is also a significant limiting factor if not the biggest one.
pinterf is offline   Reply With Quote
Old 2nd July 2019, 19:59   #1257  |  Link
minusthebear
Registered User
 
Join Date: Oct 2018
Posts: 10
Hey guys

Over the past year I have modified and updated this script to all 64 bit versions and equivalents as well as versions that use the GPU over CPU.

I will be posting my script here in the next month for everyone. Im still having a bit of trouble getting Mtools2 to utilize the GPU version of SVP, but im hoping to fix it soon.

The last plugin I cannot find a good 64 bit equivalent for is the unsharpen mask. So if anyone knows a good version for that let me know please.

Works great with 4k, 8k etc content. Much faster with GPU utilization.
minusthebear is offline   Reply With Quote
Old 9th July 2019, 09:04   #1258  |  Link
felicialee
Registered User
 
Join Date: Jun 2019
Posts: 3
Thanks for a wonderful script and the results are great for colour 8mm film.
I've also got some black and white 8mm films as well.
felicialee is offline   Reply With Quote
Old 10th July 2019, 16:58   #1259  |  Link
SnillorZ
Registered User
 
Join Date: Jan 2019
Location: Lake District UK
Posts: 48
Unsharp Mask Warpsharp DLL

Quote:
Originally Posted by minusthebear View Post
The last plugin I cannot find a good 64 bit equivalent for is the unsharpen mask. So if anyone knows a good version for that let me know please.
@Bear did you see the earlier posts?

AVS+ Script Unsharpmask function

Warpsharp x64 DLL

Interested to see what your numbers are like on GPU vs CPU processing (based on these scripts)
SnillorZ is offline   Reply With Quote
Old 12th July 2019, 16:26   #1260  |  Link
bassquake
Registered User
 
Join Date: Jan 2007
Posts: 45
If anyones interested, I posted a video showing the different stages of post-processing. I used VirtualDub2 mostly as have better control, but use AviSynth+ for some mild dirt removal and sharpening using settings posted on this thread.

Youtube Video

Appreciate comments.
bassquake is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 14:58.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.