View Full Version : Does x64 have any advantage vs x86?


Dreamject
30th April 2019, 17:21
Most videoplayers have 64 version, but it does not see that they have any advantages in perfomance, for example. May be avs has better perfomance or something that makes x64 better?

manolito
30th April 2019, 18:44
In 64-bit the CPU and the software can address much more memory than in 32-bit. To see a big performance advantage your software needs to make use of a lot of memory (like HD video rendering, high resolution image processing etc). AND your computer must have a lot of memory.

Example:
You have a 64-bit CPU, but only 2 GB of system RAM. This is the minimum amount of RAM which lets you install a 64-bit Windows version. But since the 64-bit OS has a much higher memory foot print than the 32-bit version you will actually see a decrease in overall speed, because more swapping needs to be done.

Dreamject
30th April 2019, 19:29
Yeah, I know theory, but what about practice? Anyway I have 8gb ram on laptop, I can rub a lot of process and can have 40+ tabs in browser. Usually I prefer 32bit player cause it (maybe) eats little less ram. But it's a very wide point that 64bit is better and now it like default, but still no comparing in perfomance, ram usage for players (and other software too)... If 64bit players and it's plugins like avisynth is faster-better, how much is it?

poisondeathray
30th April 2019, 19:35
In what context ?

It depends on what you are doing. In practice, if your script uses a lot of memory intensive filters, x64 can be 10x or 100x or more faster . The x86 path can be incredibly slow from memory swapping / page file

In the absence of memory bottlenecks, x64 is still usually a few % faster . You can benchmark it with avsmeter, and avsmeter64 . It will tell you speed, memory consumption, gpu usage (if script uses GPU) , etc...

In the context of encoding only, in the absence of other bottlenecks, usually the x64 version is a few % faster .

LoRd_MuldeR
30th April 2019, 19:36
In 64-bit the CPU and the software can address much more memory than in 32-bit. To see a big performance advantage your software needs to make use of a lot of memory (like HD video rendering, high resolution image processing etc). AND your computer must have a lot of memory.

Most important, a 64-Bit operating system allows addressing more (virtual) memory in a single process. On a 32-Bit operating system, the memory limit for a single process is 4 GB – in theory. But it's only 2 GB in practice (on Windows), because Windows reserves the upper "half" of the process' address space for internal purposes. This can be extended to 3 GB, by adding the "/3GB" boot parameter to Windows and compiling the individual EXE with the "/LARGEADDRESSAWARE" flag.

On 64-Bit systems, there is no practical limit on how much (virtual) memory a single 64-Bit process can address. 32-Bit processes running on a 64-Bit system are still limited to at most 4 GB.

BTW: The system, as a whole, can address more than 4 GB of physical memory, even in 32-Bit mode, thank to PAE (https://de.wikipedia.org/wiki/Physical_Address_Extension) (Physical Address Extension). Some 32-Bit versions of Windows have an "artificial" 4 GB limit, purely for license reasons, though!

Dreamject
30th April 2019, 19:40
>In what context ?
As usual player + svp/motion interpolation. In my cases even 1080p 15 threads do not eat more than 1gb of memory. I heard from svp dev that avsmeter just drops rendered frames and not objective benchmark for real player.

poisondeathray
30th April 2019, 19:48
>In what context ?
As usual player + svp/motion interpolation. In my cases even 1080p 15 threads do not eat more than 1gb of memory. I heard from svp dev that avsmeter just drops rendered frames and not objective benchmark for real player.

It's objective up to the point of the player. It can tell you what script is faster or slower, and statistics like memory, cpu usage etc...

But after that there are a bunch of other things going on - the type of player, the type of renderer, the type of RGB conversion (high vs. low quality), additional post processing like dithering. Some are fast, some are slow. Some can make use of GPU offloading some processes

So look at the specific player you're interested in, and compare x64 or x86 versions .

Look at the CPU usage, memory consumption, fps of the player +/- gpu usage

LoRd_MuldeR
30th April 2019, 19:59
May be avs has better perfomance or something that makes x64 better?

One of the reasons why "AMD64" (aka "EM64T", aka "x64") often results in faster program code, compared to "x86", is because "AMD64" did not only widen all general purpose registers from 32-Bit to 64-Bit, but also added more registers!

These additional registers can help a lot to speed up certain computations. That plus: SSE2 (including SSE) is an integral part of "AMD64", whereas on "x86" it is an optional extension.

So, all code generated for "x64" CPUs can (and usually does) use SSE2 instructions, because all "x64" CPUs have to support it. Code generated for "x86" still often is compiled with compatibility for pre-SSE2 CPUs, which means no SSE/SSE2.

wonkey_monkey
30th April 2019, 20:56
Code generated for "x86" still often is compiled with compatibility for pre-SSE2 CPUs, which means no SSE/SSE2.

Funnily enough I found out just today that Visual Studio does compile with SSE2 even if you set Extended Instruction Set to Not Set.

Dreamject
30th April 2019, 20:58
>Look at the CPU usage, memory consumption, fps of the player +/- gpu usage
Some days peoples liked benchmark, overclocking, scores, but I did not. Now it's too hard to get simple answer 'does x64player with svp better than x86?'. Actually I'm not good in correct test, I tried see cpu load, but with hyperthread and multithread it s not so simple, I do not see differences and can not catch up all information, convert threads/perfomance/wattage in one graphic, analyse it...

StainlessS
30th April 2019, 21:02
Funnily enough I found out just today that Visual Studio does compile with SSE2 even if you set Extended Instruction Set to Not Set.

Not good. Which ver$ Visual Studio is doing that ?
(I think you use Community VS 2017 ???)

LoRd_MuldeR
30th April 2019, 21:15
Not good. Which ver$ Visual Studio is doing that ?
(I think you use Community VS 2017 ???)

VS2012 and later defaults to "/arch:SSE2" for "x86" targets, if "/arch" is not set all. You have to explicitly set "/arch:IA32", if you want compatibility for ancient CPUs.

I actually think it's a reasonable default, as CPUs have been supporting SSE2 about for 19 years now (since the Pentium 4, released in 2000). Also, Windows 8 and later require SSE2 + NX anyway.

BTW: For "x64" targets there is neither "/arch:SSE2" nor "/arch:IA32", because SSE2 is the baseline here.

StainlessS
30th April 2019, 22:57
Arh good, I thought that meant that you could not switch it off at all.

FranceBB
1st May 2019, 04:53
If 64bit players and it's plugins like avisynth is faster-better, how much is it?

x64 has more registers, so whenever you compile a program and target certain assembly optimizations (SSE2, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX512) if the program is gonna make use of them, it's gonna be faster, however it might also not use them.
If you take a look at x264, x265 as encoders, they make extensive use of registers and assembly optimizations with manually written intrinsics and if you compare the encode with the very same assembly optimization (let's say SSE4.2) with x86 and x64, the latter is gonna be faster.
Now, let's talk about Avisynth...
On Avisynth the story is pretty different, 'cause Avisynth itself as frameserver doesn't do anything in terms of assembly optimizations as it lets filters/plugin writers optimize them (don't get me wrong, you can compile Avisynth core yourself and target SSE4.2 but anything over SSE2 it's probably gonna be irrelevant).
You may think:
"fair enough, then if I use Avisynth x64 and I use x64 plugins/filters they are gonna be faster if the creator wrote intrinsics?"

- Yes

"So I should definitely use Avisynth x64!"

- No.

Avisynth x86 has been the de facto standard for years and years and back in the days people have been writing C++ Code with manually written intrinsics, while for the x64 version, the porting is generally done on the "plain" C++ Code.
What does it mean?
Suppose we have our filter called "filter1.dll" which has been written in C++ with manually written intrinsics and makes use of SSE4.2 x86.
Let's also suppose that we have a x64 equivalent porting which has been ported using the C++ code but the one who ported it didn't wrote brand new intrinsics for the x64 registers/assemblies, but compiled the ported C++ Code and targeted SSE4.2.
When you are gonna compare the x86 version and the x64 version, the 32bit one is gonna be faster, 'cause compilers "don't know" how to make use of a certain instruction set as efficiently as a human.

One more thing: Avisynth x64 has never been fully stable and still lacks some filters compared to the x86 one, however, since Avisynth x86 cannot allocate more than 2 GB of RAM in a single process, you would have to split post-processing in steps as I do; for instance:

#Indexing 4K UHD 10bit -> Process 1
#Conversion to 16bit -> Process 2
#Conversion to RGB -> Process 3
#Applying LUT with 16bit precision -> Process 4
#Going back to YUV -> Process 5

This way, Avisynth x86 is gonna be able to use 2GB per process and max out your amount of RAM, however it's definitely gonna be slower compared to Avisynth x64 in which you can do everything in a single process.

In other words, the answer to your question about which one is better (x86 or x64), as it often happens, is "it depends".

pinterf
1st May 2019, 06:54
One more thing: Avisynth x64 has never been fully stable
? As for Avisynth+ I don't think there is any difference between 32 or 64 bit versions.

FranceBB
1st May 2019, 07:34
? As for Avisynth+ I don't think there is any difference between 32 or 64 bit versions.

Yep, I mean the legacy Avisynth, 64bit build.
The situation has pretty much evolved ever since you started working at Avisynth+.

Groucho2004
1st May 2019, 11:23
On Avisynth the story is pretty different, 'cause Avisynth itself as frameserver doesn't do anything in terms of assembly optimizations as it lets filters/plugin writers optimize them (don't get me wrong, you can compile Avisynth core yourself and target SSE4.2 but anything over SSE2 it's probably gonna be irrelevant).There are plenty of internal (core) functions in Avisynth that benefit from AVX or SSE4.x intrinsics.

Avisynth x86 has been the de facto standard for years and years and back in the days people have been writing C++ Code with manually written intrinsicsI think you're confusing intrinsics and inline asm (which was what people used "back in the days").

Avisynth x86 cannot allocate more than 2 GB of RAM in a single processGeneralization and not quite true - On a 64 bit OS it only takes a linker switch ('LARGEADDRESSAWARE') in the client program to get 32 bit Avisynth allocate up to 4 GB.

Dreamject
1st May 2019, 15:29
-_- but mostly I (and most people even geeks) do not need >1gb for player, even 2gb for player is too bloatware, uses hardware decoders (okay, I can see 10p anime/SW VP9 in player sometime)... As I get it's not easy quest even get how some soft load logical *2 cores when even you load 1 real core for 100% manager shows you use 50% of CPU, as I read. Also x86 support multithread anyway, I simply can not imagine how can I measure that. Symthetic tests like avsmeter are too synthetic imho. Imho real but halfsynthetic test for motion interpolation should looks like ~2frames in the loop videofile, use player to render them, then you need measure them somehow and find the difference...

StainlessS
1st May 2019, 16:31
Symthetic tests like avsmeter are too synthetic imho.
AvsMeter is to measure speed in Avisynth only, nuttin synthetic about it, if you need measure speed of player, then you need something else.

EDIT: Given that different players have different settings/capabilities, the something else to measure on equal footing probably dont exist.
Pick a player that you like and forget about it.

Dreamject
3rd May 2019, 23:32
I got the answer with weak 2 core CPU without ht and svp. So, x64 really faster and d3d11 faster than d3d9 copyback. Faster means less CPU load. IMHO to get correct performance comparison in real life you need weak 2 core cpu without ht, if CPU is weak graphics are more sensible

Dreamject
6th May 2019, 13:31
Hmm... By the way. I thought most nearest to reallife test is just encoding real video and measure time. It's not 'reallife' like playing video, but it's better than not real cpu load or launch as I get fake avsmeter

StainlessS
6th May 2019, 15:54
as I get fake avsmeter

The only thing fake is that which seems to be in your head.
AvsMeter is for tuning avs scripts, hence the name.

Dreamject
9th May 2019, 10:52
%) i did not know that avss use avisource as default and you need to set up like avisource(file), I thought avs gets filename/source only as external argument and avsmeter uses it as synthetic static picture :D. Even old batch file supports %1 ...

Groucho2004
9th May 2019, 11:07
%) i did not know that avss use avisource as defaultWhat's avss?
I thought avs gets filename/source only as external argument and avsmeter uses it as synthetic static pictureWhat?


Have you considered using Google translate?

Dreamject
9th May 2019, 11:32
avss > 1 avs https://vk.com/emoji/e/f09fa494.png

I got my mistake, I thought avs works like "1.avs c:\file.mkv" and potplayer/ffdshow_source inside it is only special case. I could not imagine that 'script' can not work with argument. If you create batch file like 'ren %1 zopa', you can use drag and drop to rename file 1.txt to zopa, you do not need to write 'ren 1.txt zopa' for each file. avisynth does not support any argument directly as I got, I did not see avsmeter uses any argument so I thought it uses argument like 'blankclip'...

StainlessS
9th May 2019, 13:41
What's avss?

DirectShowSource2():- https://forum.doom9.org/showthread.php?t=134275

According to http://forums.animesuki.com/showthread.php?t=48608, there is an AviSynth plugin called avss.dll created by Haali (which can be obtained from the Haali Media Splitter).

DSS2 is Haali's implementation of Directshowsource. It has the advantage of being frame-accurate, but only supports VFR by converting it to CFR; at least that was the case when I tried it last time, it might have changed.

The point being is whether it is based on DSS, since DSS2 is closed source. I will ask him about it.

Dreamject
9th May 2019, 14:10
Why there is (as I get) no way to add argument support for transcoding? For example potplayer supports argument, so "potplayermini64 %1"->potplayer_source->avisynth works with it->potplayer plays it. So it could be filesource, but encoder with argument could just put any videofile in script? It's strange that so geeky program as I get for videoediting does not supports even drag and drop and playing video with it much more usable to generate timescode file and follow this

http://avisynth.nl/index.php/FAQ_loading_clips#How_do_I_load_MPEG-1.2FMPEG-2.2FDVD_VOB.2FTS.2FPVA_into_AviSynth.3F

When you play video you absolutely not care about this things

Groucho2004
9th May 2019, 14:16
DirectShowSource2():- https://forum.doom9.org/showthread.php?t=134275You got that from his explanation "avss > 1 avs"? Wow. You must have some decrypter built into your brain that I lack.

StainlessS
9th May 2019, 14:41
You got that from his explanation "avss > 1 avs"? Wow. You must have some decrypter built into your brain that I lack.

Nope, I just got avss.dll in my plugs and know what it is (although I always forget where it came from).

I have a script (not ready for publication) that uses AviSource, MPeg2Source, FFMS2, LSMash (both varieties) DSS2 and last resort DSS. (might have forgot some).
It checks in best guess sequence first (based on file extension), and then repeats all missed out ones until finally trying DSS (and then DSS with forced RGB).
Audio likewise uses video partner source filter where available, and then iterates so far untried ones.
Martin53 loved it (messages via PM) although made some small changes for his specific needs (for getting AspectRatio resize 1:1 and one or two other things).
I also used MediaInfo stuff and my own DGIndex info extaction routines.

Anyways, I knew what avss.dll is.

EDIT: Also Google "Avisynth avss" would find it.

Groucho2004
9th May 2019, 15:06
Nope, I just got avss.dll in my plugs and know what it is (although I always forget where it came from).
...
Anyways, I knew what avss.dll is.But he never mentioned "avss.dll", just "avss" which could well have been a typo, especially after this cryptic comment:
%) i did not know that avss use avisource as default:confused::confused::confused:

See what I mean? Anyway, never mind.

StainlessS
9th May 2019, 15:26
See what I mean? Anyway, never mind.

Yep, I gave up trying to figure that out.

Dreamject
9th May 2019, 15:34
I think that when you try to get me and I try to get avisynth we have same faces ¯\_(ツ)_/¯
https://cs11.pikabu.ru/post_img/2018/11/11/4/154191578519656586.jpg

StainlessS
9th May 2019, 15:35
Dreamject,
[EDIT: Avisynth is not so much a program, more a sort of system integrated file translator (where translation governed by a scripting language). It has no GUI nor any command line, nor any means to drag/drop.]
Avisynth script uses various source filters to load a video clip.
The output of an AVS script appears to the program that loads it as an uncompressed *.AVI file, so most video related programs can load the output video without problems.
The video editing/frame serving function of Avisynth was of most use years ago (when hard drive size was very limited), and allowed editing video prior
to using an eg Encoder, without having to write an intermediary file (of probable too large a size for the hard drive).
[EDIT: DVD Standard Def uncompressed RGB clip of maybe two minutes would require something like 16GB of drive space (I dont remember exactly how much).]

Scripting video editor

AviSynth acts as a non-linear video editor controlled entirely by scripting (without a GUI).[3] It stands as an intermediary between a digital video source, like an AVI or MPEG file, and a VFW receiving program, which is typically a media player, video editing software, or an encoder.

AviSynth communicates with any program that supports AVIs through the Video for Windows system by acting as a "fake" AVI file.[4] It can apply a large variety of editing and processing functions (called filters) to a video stream before passing along the results as if it were a legitimate file being read. Filter capabilities include trimming, cropping, deinterlacing, inverse telecine, loading and splicing still images, doing color corrections, denoising, and many other things.

Technically, it acts as a codec for AviSynth scripts, which represent edit decision lists in the form of text files written in the AviSynth scripting language. The scripting language can be extended through the use of external plugins (as opposed to internal plugins, which are included with AviSynth itself). An external plugin list is maintained at AviSynth Filter Collection.

AviSynth filters work in several color spaces including RGB, YUY2 and YV12 (Also YV16, YV24, YV411 and Y8 in Avisynth 2.6).[5] This is necessary to allow all kinds of video input and output. Certain functions only work on specific color spaces, requiring conversion beforehand.

WikiPedia:- https://en.wikipedia.org/wiki/AviSynth

Dreamject
9th May 2019, 18:05
Okay thanks... Do not take me seriously ~_~. Every human has delusions I have a lot too. I just never thought than any of regular program/script does not support argument. It's like you can not replace x to y in txt in batch mode, you need to write separate 'script' for each file like 'txtsource c:\Users\Zabivan\Desktop\Current\1.txt , replace x to y ' and then launch this script in notepad, so notepad thinks this is fake text file, but you cant convert it, just watch it. Also, it support only ASCII , so you need... o.O
https://s18.directupload.net/images/190509/oegz6hpv.png

StainlessS
9th May 2019, 18:15
Maybe something like Avisynthesizer (batch avs script creator) of use to you:- https://forum.doom9.org/showthread.php?t=166820&highlight=AviSynthesizer

A SendTo App that allows Windows Explorer selection of video files and fills in a user supplied Template with the filenames.
Can concatenate (join/splice) selected files (default as original non mod version) and create a single output AVS file OR,
batch create multiple AVS files, one for each input source file (MOD version only).
Has a GUI to select required template and sort input files if multiple input files selected.


A simple source script template. (with square brackets)

#ASYNTHER Simple AVISource reader
[AVISource("___FILE___")]


Right click "Send to : Avisynthesizer" on some AVI file, , and creates eg below

#ASYNTHER Simple AVISource reader
AVISource("D:\SomeVideoFile.avi")


You can create templates for whatever purpose/sourcefilter type.

Where you select multiple files for above template, produces something like below

#ASYNTHER Simple AVISource reader
AVISource("D:\SomeVideoFile_A.avi") ++ AVISource("D:\SomeVideoFile_B.avi") ++ AVISource("D:\SomeVideoFile_C.avi")


Batch mode template (no square brackets), produces a separate avs script for each selected source file.

#ASYNTHER Simple AVISource reader
AVISource("___FILE___")


Simple image file reader.

#ASYNTHER Simple ImageSource reader
[ImageSource("___FILE___",End=0)]


Simple template to load avi file, and signal to MeGUI 16:9 aspect ratio

#ASYNTHER BATCH-simple-avisource_169
AVISource("___FILE___")
RT_SignalDar2(16,9)
Return Last


Simple template for LSmash source filter, splicing source files together (some of the template removed)

#ASYNTHER LSmash_RoboSplice

###########################
Function GetSeq(string s) {
c = LSMASHVideoSource(s)
a = LSMASHAudioSource(s)
return AudioDubEx(c,a)
}

[GetSeq("___FILE___")]



Template to select version of LSmash source filters (based on file type ISO [eg Mp4]), only just knocked it up, UNTESTED. (clips must be same size etc for multi select splice)


#ASYNTHER LSmash_Splice

# Requires RT_Stats
Function IsISOFileName(String s) {s=RT_GetFileExtension(s) Return(s==".mov"||s==".mp4"||s==".m4v"||s==".3gp"||s==".3g2"||s==".mj2"||s==".dvb"||s==".dcf"||s==".m21")}

###########################
Function GetSeq(string s) {
IsISO = s.IsISOFileName
c = (IsISO) ? LSMASHVideoSource(s) : LWLibavVideoSource(s)
a = (IsISO) ? LSMASHAudioSource(s) : LWLibavAudioSource(s)
return AudioDubEx(c,a)
}

[GetSeq("___FILE___")]

# Some additional processing
# ...
# And some more

Return last

Dreamject
9th May 2019, 18:50
~_~ is there any reason from dev's side why avisynth's scripts still does not support external arguments like %1 %2..? It uses functions with arguments inside, it has gpu acceleration, mt mode and a lot of math plugins but does not have simplest thing. It will be much more usable and attractive in this case imho

PS: I opend last avi file about 15 years ago :D

StainlessS
9th May 2019, 19:02
No, because it behaves just like an avi file, and an avi video file does not take arguements.

Avi file is old, but supported by a lot of video apps, this is why it is chosen for editing purposes. (back in 2002)

EDIT: Avs files are sort of opened from the output result, not the input, eg a movie player does not give arguments to the video files it opens,
you might give argments to the video player, but the only real use of that would be to select which avs file to open.

EDIT: I believe AvsPMod can drag/drop, I dont use it (but even then, it still would only open the existing avs file).

EDIT: The two scripts here (MakeMultiPartScripts):- https://forum.doom9.org/showthread.php?t=176386
use an RT_Stats FileSelector to select and open an avs file, I guess you could select a source file using the file selector,
and feed that filename into a script, BUT, your script would need to be able to select the best source filter to open the video file,
and that is not always as easy as it sounds. (not much different to using the batch thing above, but batch thing allows user select of template and therefore source filter).

Maybe you ought to be looking at some other app, avisynth seems not to be for you.

Dreamject
9th May 2019, 19:41
I get that if you want it really strong, you could use it. But anyway I think that developers/people who need should care of it. If these filters are really useful, they could be used in extended avs with encoders/editing program as 'open/encode this videofile using this avs template'. So, more peoples use it without to avi conversion, better community supports, developers could write plugins for many people and have better feedback. Imho, mostly its even don't need to process audio. If it's even support external %1 parameter without crazy tricks, it will be much less popular than it could be. At least one unified crazy trick that every program could use. Imho it's much more easy to add this than mt mode, cuda support etc.

Only today I got why , for example, avisynth has best wide available motion interpolation, but there is mostly no program (svpcode works bad and still uses workarounds) that support avisynth - it's just unusable

stax76
9th May 2019, 19:52
@Dreamject

You mean command line arguments? AviSynth is a library and not an application, you have to find a suitable host application.

Dreamject
9th May 2019, 20:17
Any other program could support something like
Ffms(%1)

But it's not standard using and nobody use that, it's not declared as standard or whatever.

As a trick ffdshow source do not need absolutely paths, but only player support it

LoRd_MuldeR
9th May 2019, 21:26
@Dreamject

You mean command line arguments? AviSynth is a library and not an application, you have to find a suitable host application.

Well, the library interface of AviSynth could be changed to pass arguments into the script.

But this would mean that every host application would have to be adapted to the changed AviSynth interface. Also, every host application would have to be extended, so that the user can enter the desired parameters somehow.

The closest thing I know to passing parameters into an AviSynth script is a plug-in to read environment variables:
http://www.avisynth.nl/users/stickboy/

Dreamject
9th May 2019, 21:58
What should be adapted and what's wrong with that? If you extend avisynth, you still can use wesource(c:\1.avi). Replace absolute paths to %1 is not big deal cause now you need to adapt script for every file.

Even avisynth supports arguments inside functions like brightness=170, fontsize=40. If avisynth support it as command-line parameters, so users should adapt it more, but it's optionally and still much easy than adapting for every file if you need it a lot. But devs should care of it if then interesting in popularization. If library is not good, as I know ff project has libraries and exe

LoRd_MuldeR
9th May 2019, 22:11
What should be adapted and what's wrong with that? If you extend avisynth, you still can use wesource(c:\1.avi). Replace absolute paths to %1 is not big deal cause now you need to adapt script for every file.

If the AviSynth library was extended to allow "passing through" variables into the script, then every single host application (VirtualDub, x264, avs2yuv, etc. pp.) would have to be adapted to actually make use of that feature.

This is very unlikely to happen, I think.

Of course it would also possible that the host application itself "expands" variables in the script, prior to passing the script into AviSynth. But that would be purely a feature of the individual host application, not a feature of the Avisynth library.

Dreamject
9th May 2019, 22:30
May be, but I thought that >99.99% of software especially if it designed for working with something should support base keys, at least something like 'open/use x with y', not 'open this file using z which generates alpha and then use alpha', I at least from user side it never looks like that. And avisynth development is not stopped, may be them add it, IMHO it's not more difficult than adding cuda support.

Also every program/dll which uses avisynth even avsmeter supports keys too, it can't be impossible

Groucho2004
9th May 2019, 22:58
If the AviSynth library was extended to allow "passing through" variables into the script, then every single host application (VirtualDub, x264, avs2yuv, etc. pp.) would have to be adapted to actually make use of that feature.

This is very unlikely to happen, I think.

Of course it would also possible that the host application itself "expands" variables in the script, prior to passing the script into AviSynth. But that would be purely a feature of the individual host application, not a feature of the Avisynth library.
I have always thought of the frame server (Avisynth) as the host and the application that requests the frames and data (x264, ...) as the client. It just makes more sense to me.

Dreamject
9th May 2019, 23:37
Every program can parse and replace at least %1 without avisynth changing it's hello world level. If avisynth changes behavior it should make it more easy, not difficult. Mostly I don't care of it too, but from user side I know only 2 thing that for video improvement, it's deband shader, to get it I spent about 3 months and motion interpolation SVP, it costs 25$ but works very bad (for me) and based on free mvtools. If avisynth be more usable, free and better motion interpolation will exist. Now even monkey like me ported svp to clear avs, but I used potplayer+notepad++ as ide cause avsp is unusable, SVPs generator what they sell (libraries are free) absolutely not protected. IMHO these strange things happened
cause avisynth is very unfriendly for most of people

stax76
10th May 2019, 00:32
@Dreamject

I can't follow you, first sentence for instance:

Every program can parse and replace at least %1

I don't do such kind of thing in my player or remember having ever written a program that deals with %1. Programs typically get arguments like file paths, some kind of shell like cmd or explorer might expand a macro like %1.

You have to write much clearer and more detailed to make people to understand your goal.

qyot27
10th May 2019, 01:05
I have always thought of the frame server (Avisynth) as the host and the application that requests the frames and data (x264, ...) as the client. It just makes more sense to me.
Exactly this.

I *think* some of the confusion here is down to AviSynth not having a dedicated shell the way scripting languages/interfaces like Bash or Python are implemented. The simplest answer to that, of course, is that AviSynth is not a general-purpose scripting language the way that those are. Other scripting languages allow scripts to define actions to take on inputted files through generic placeholders like %1 or $1 because the script itself is being treated as an executable program.

AviSynth scripts are not executable programs, they're media files (or inert loadable functions, in the case of .avsi stuff). The interpreter is AviSynth.dll.

You don't use AviSynth to play anything, either. Sure, it's possible that a very lightweight script can be played back by AviSynth-supporting media players (like mpv or anything else that uses libavformat) on most even halfway-decent CPUs, but for just light filtering, said media players probably have their own solutions that don't require using AviSynth as a middleman (or they just interface with AviSynth internally to reuse its plugins).

StainlessS
10th May 2019, 01:36
Entering a filename into a script aint too difficult a task, the hard bit is writing the rest of the script.
If entering a filename into an existing script is the requirement, then any batch creation app can do that as already pointed out.

By the way, you can drag drop an avs script onto VirtualDub2 and open it [it also has an avs script editor builtin].

(I'm still unclear as to whether question is where %1 is an avs script name, or a souce video file name to be entered into an already existing avs script.)

EDIT:
System NotePad is perhaps not the best choice of editor.
There are many file editors that can be configured to be used with Avisynth, I use PsPad, others use NotePad+, or NotePad2, or Context + others.
Can set up to press a key combo and will open avs file in some player (eg PotPlayer which you seem to like), using a %1 style arrangement.
Can also set up to open an Avisynth docs file on some key press combo.
Also, has avisynth syntax hilighter, and will open avs files by default on double click.

EDIT: Some script editors with avs specific capability:::
Which script editor for Avisynth do you use? :- https://forum.doom9.org/showthread.php?t=128690

Setting up PSPad for Avisynth use:-
http://www.pspad.com/

Get Avisynth.ini for PSPAD, See MediaFire in my sig, DATA folder (better than Avisynth.ini on PSPad site)
Copy Avisynth.ini into eg "C:\Program Files\PSPad\Syntax"


Menu/Settings/Hilighters Settings/
Click on a <not assigned> entry and choose Avisynth from list.

Set to use Avisynth help + SDK docs Compressed CHM file (see MediaFire\DATA\ in my sig)
Tab/Specification/
Help File:- C:\NON-INSTALL\Avisynth_Help\engsdk26.chm

File Masks:- *.avs
*.avsi

Tab Width:- 4

Tab/External Applications/
Application List:-
NAME:- "MPC-HC" APPLICATION:- "C:\Program Files\MPC-HC\mpc-hc.exe" "%File%"
NAME:- "MPLAYER2" APPLICATION:- "C:\Program Files\Windows Media Player\mplayer2.exe" "%File%"


Of course choose the correct path to files on YOUR system.
Help available via ALT-F1.
MPC-HC runs via F9 key
MPLAYER2 runs via ALT-F9

In PsPad 'Use Highliter', you can tick both '#' and '/*...*/ to have both types of comments (usually only '#' is ticked).
Dont forget to click on SAVE.

Also might want to access "Program Settings..." menu to set eg TAB size = 4 etc.


Your favorite editor for Avisynth? :- https://forum.doom9.org/showthread.php?t=170684
Busy setting up XP64 and wanting to have several Avs editors available so here is ConTEXT Programmer Editor for editing avs files.

ConTextSetUp.txt [EDIT: Also in the highlighter zip]

ConText Programmers Editor v0.98.6 (No Longer Developed)
SetUp for Avisynth Script Edit & Play. [on x64, keypress access to MPC-HC/VDub2 using both Avisynth x86 OR x64]

Download (~1.57MB) :- http://www.contexteditor.org/downloads/
Avisynth Highlighter, by LigH :- http://www.contexteditor.org/highlighters/ {Alternative at bottom of THIS page)

Execute Setup (Best Not 'Replace Windows NotePad', you will no longer be able to access it easily)

Run Context at least once.

Copy highlighter (avisynth.chl) to eg C:\Program Files\ConTEXT\Highlighters\

Create "Test.avs" containing single line "Return Version", and save somewhere.

Right Click Text.avs and select OpenWith "Context Programmers Editor" (or navigate to exe).

Check Menu/Tools/Set Highlighter/Avisynth is ticked.

###

Setup Keys F9 -> F12 for play of script in some player or VDub2.
Menu/Options/Environment Options/Execute Keys/User Exec Keys
Click 'Add', and add 'avs'

Select F9, (Set F9 to execute player with current avs script)
Execute = C:\Program Files (x86)\MPC-HC\mpc-hc.exe (or in 'Program Files' on XP32)
Start In = (ie nothing EDIT: means folder containing script)
Parameters = %n [EDIT:- %n Means script FullPathName]
Hint = MPC-HC_x86 (Displayed in Menu/Tools/User Commands)

Select F10,
Execute = C:\Program Files\MPC-HC\mpc-hc64.exe (Assumes both 32 & 64 bit MPC-HC separate installs)
Start In = (or something else eg MPlayer2 on XP32)
Parameters = %n
Hint = MPC-HC_x64

Select F11,
Execute = C:\TOOLS\VirtualDub2\VirtualDub.exe (x86 & x64 both in same directory)
Start In =
Parameters = %n
Hint = VDub2_x86

Select F12,
Execute = C:\TOOLS\VirtualDub2\VirtualDub64.exe
Start In =
Parameters = %n
Hint = VDub2_x64

###

Setup Avisynth compressed help file to open on F1 Key Press. (I Prefer setup via [EDIT: Global] shortcut HotKey on CTRL/ALT/H)
Menu/Options/Environment Options/Execute Keys/Miscellaneous
File Type = Avisynth
HelpFile = C:\TOOLS\AVS\english.chm (or eg AvisynthEngHelp+SDK26_FINAL-2015-05-31.chm)

###

Alternative highlighter, based on LigH ver$ (Added functions etc new in v2.60 Standard)
via Doom9 User, StainlessS MediaFire account (link in sig below any post), DATA folder.
Avisynth docs, compressed HTML file in same folder as above highlighter, AvisynthEngHelp+SDK26_FINAL-2015-05-31.chm


Both Alternative Hightlighter [EDIT: ContextTextEditor_AvisynthHighlighter_ssS.7z] & Compressed Help files available via MediaFire/DATA folder, from sig below this post.

More Editor stuff here:- http://avisynth.nl/index.php/Syntax_Highlighting#Notepad.2B.2B_Avisynth_Syntax_Highlighting

VDub2 here:- https://forum.doom9.org/showthread.php?t=172021

EDIT: I'm using latest Pinterf Avs+ from here (r2728):- https://forum.doom9.org/showthread.php?p=1845734#post1845734
Seems to have installed both simultaneously OK (unless I did something I'm not aware of).
Not sure if Universal Installer will only install one at once.

EDIT: There is also a Portable version of ConTEXT from first link at top of post, runs from USB stick, dont know if easy to
setup for AVS+ @ x86 and x64, post something if you get it working OK, I'm sure others will appreciate (probably need Admin access).

EDIT: By the way, VirtualDub2, also has a builtin basic script editor, similarish to VDubMod, but better [Menu/tools/]. Can eg edit out commercials, and on simple keypress insert entire trimset into the script, and without VDubMod off by 1 frame errors that are present in many/most versions of VDMod. Also much better than VDMod, and believe it or not also better than VDub Official latest v1.10.xx,
and is also 100.0% vegan :)

EDIT: ConText is as supplied a Light Theme Only, not good for those that prefer dark theme unless you change all the colors yourself
(about 10 or 12 colors).


Try one of the above linked editors (with an avisynth hilighter) and also try VirtualDub2 [dont use VirtualDubMod or AvsEdit, it's awful (I used it for years despite hating it)].

Dreamject
10th May 2019, 11:35
~_~
@AvsPmod avisynth's "best IDE" - does not support ffdshow_source like players does, can not inject code like ffdshow from 2014 does - it has option 'add ffdshow_source()', ide does not have option like 'insert avisource("yourPath"), has not very readable fonts - different fontsize, bold etc. It has sliders for easier control, but they can not be called until you start to play the video and port avs for avsp
@ffdshow - to apply the script you need press 'okay/apply', has very big windows
@PotPlayer - has popup menu, if you type anything in window it will be applyed immediately. It does not have any advanced feature like syntax highlight, it's ~windows notepad, it just has obvious things and could be more comfortable in some cases than IDE
https://s18.directupload.net/images/190510/mx4atbkq.jpg

Potentially, avisynth has easier syntax than shaders, can be used for players and editors, but on practice it's quite unfriendly for most of people :(

Imho good avisynth enviroment should have:
IDE/programs which can open any videofile with script
avisynth should be focused on video editing (if it helps and will be faster/stable), cause for audio edit you could use better program/you do not need to recompress audio stream
you could see what happened if you change something in script immidiately (with optionally delay)
you can encode videos like any videoconverter does
may be useful if you could create gui for script with sliders, checkboxes, popup menus so you could use only mouse to edit it. it aosulutely do not need to load libraries, dependencies, avisynth. avpmod already started to realize this feature and generates 2 avisynth inside one, but it's unusable anyway

LoRd_MuldeR
10th May 2019, 18:16
I have always thought of the frame server (Avisynth) as the host and the application that requests the frames and data (x264, ...) as the client. It just makes more sense to me.

Regardless of how you want to look at it, AviSynth is a library (DLL) that needs a “host”* application (executable) that loads the DLL and invokes it. Technically, the “host” application queries frames from the Avisynth DLL.

Anyhow, the crux of the matter is: Even if the interface of the AviSynth DLL was extended, so that user-provided parameters can be passed from the respective application into the AviSynth library and from there handed over to the current AVS script, still every single application out there would have to be modified to actually make use of that feature. Most important, the application would need to provided some way for the user to enter the desired parameters.

For example, a CLI program, such as x264 or FFmpeg, would need to implement a new CLI option, e.g. "--avs-param foo=bar". And a GUI program, such as VirtualDub, would need to implement a new dialog window for that purpose.


(*) or however you prefer to call it

Dreamject
10th May 2019, 21:55
It should work like hmm... Usually developers do not introduce 'new' features, only if users request that. Even user need it, usually they do not ask developer to change something.
I saw a lot of examples when developers do not use obviously (from my side) features. For example, there is subtitles synchronization problem when you have movie but you should find subtitles, then sync it with video using commands like (sync +-0.1 sec). I asked for potplayer dev one button solution - when you select some line in subtitles browser wait when human start to talk, press this button and it calculates offset automatically that much more easy to find offset for example in 20sec. But subtitles manager still not ideal if you wanna reread something quickly cause it does not use autowrap and line break, colums hiding like right

https://s18.directupload.net/images/190510/zozsx2fw.png

It's not developers fault, they has another logic, usually they do something like something already exists (for example in another project) and fix bugs, many of features (if project is big it could contain hundreds of them) are not used by devs. If project is not commertial/closed source/user can not inject new feature or it will be useless if only he use that, it's user responsibility to prove that something is needed, but users are not active too. So if after 20 years of existence avisynth or programs (except players) even IDE still can not get how to open file without writing it inside script, it only prooves above

wonkey_monkey
10th May 2019, 21:58
Your posts are quite hard to parse but I think the problem is that you have a fundamental misunderstanding of what Avisynth actually is.

Dreamject
10th May 2019, 22:15
¯\_(ツ)_/¯

Even if I use native language I spent a lot of time to prove dev that people and me can not read and use manuals >40 of PC screen to read something like that, especially from phone https://vk.com/@chatmanage-commands , something like https://vk.com/page-153955265_54988436 is much more readable. Dev of chat manager thinks I'm stupid asshole, but in my communities it works better than him :). In my cases bot prevent flooding and people learn to build sentences, not sending 5-10 messages with 1-2 word per minute, dev just bans everyone who send any link/sticker or have another point of view. So he thinks that I am bad guy when I say he is wrong even if his methods absolutely not work.

Groucho2004
10th May 2019, 22:30
Regardless of how you want to look at it, AviSynth is a library (DLL) that needs a “host”* application (executable) that loads the DLL and invokes it. Technically, the “host” application queries frames from the Avisynth DLL.Technically, I suppose you're right. I'm taking a rather abstract view of the concept which may be easier to grasp for someone who is not familiar with the inner workings of Avisynth.

ChaosKing
10th May 2019, 23:17
If you want to batch encode you can fake parameters like this.
encode.bat: echo file="c:\video.mp4" > myvars.avs
x264.exe ...
Your main script:
import("myvars.avs")
ffms2(file)

_Al_
11th May 2019, 00:14
@Dreamject Btw. Python & Vapoursynth is exactly what you are trying to have here, using *.py you can have it as executable with arguments. You can encode video from script itself, designing loading module that constructs clip from video etc.
Or using *.vpy extension and loading it to application (VirtualDub2, ffmpeg, vspipe).

With any approach you can use Python modul/importing system for whatever you want.

Dreamject
11th May 2019, 16:22
~_~ imho python just for playing videos is tooo bloatware (at least I never can install it)

I tried it now, so...
http://www.vapoursynth.com->I found 'download' button hardly, it's not big->okay I found 'download windows binares->github\releases->in top place only 'source code', maybe it's mistake, but it's really source code->previous release has exe, I downloaded 10 mb with 200kb/sec from github->launch exe and...
https://s18.directupload.net/images/190511/cucuxi42.png (it does not have any online python installer/intergrated libraries like avspmod has)
Okay, let's find python, install vapoursynth, but... Imho, it can not be more popular than avisynth now.

Same things on avs and python

super=SVSuper(input, super_params)
vectors=SVAnalyse(super, analyse_params, src=input)
smooth=SVSmoothFps(input, super, vectors, smoothfps_params, mt=threads, src=src)

super = core.svp1.Super(input_m8,super_params)
vectors = core.svp1.Analyse(super["clip"],super["data"],input_m8,analyse_params)
smooth = core.svp2.SmoothFps(input_m,super["clip"],super["data"],vectors["clip"],vectors["data"],smoothfps_params,src=input_um,fps=src_fps)

Even potplayer has 10 examples for avisynth and only 2 vapoursynth examples, vs is not extended by dev (potplayer's svisynth has potplayer_source , #CPU and other variables). I do not want to offend anyone, but mostly users are quite stupid (me too) and do not read manuals a lot, just do something like we do it usually, usability and compatibility with previous experience is most important thing. Now avisynth usability it's like browser which crashes if you start it cause it has no 'urlsource' until you write script 'chrome urlsource ('pikabu.ru')' can not just open any link, has no tabs, to open each page you should write script with urlsource too and launch it. vs is like the browser which can open links, but you should to load dependecies manually and build it before using, you should know python language to use it

StainlessS
12th May 2019, 00:04
Now avisynth usability it's like browser which crashes if you start it cause it has no 'urlsource'
until you write script 'chrome urlsource ('pikabu.ru')' can not just open any link,#
has no tabs, to open each page you should write script with urlsource too and launch it.

:Translate:
Now avisynth usability it's like PLAYER which crashes if you start it cause it has no 'VIDEOSOURCE'
until you write script "MEDIAPLAYER VIDEOSOURCE('SOMEFILE.AVS')" can not just open any (UNNAMED) AVS,
to open each VIDEO you should write command script with AVS filename too and launch it. eg "MEDIAPLAYER VIDEOSOURCE('SOMEFILE.AVS')"


A WebPage might or might not use some image/video, or even dozens of them, (same for an avs script), or just use frames/tables/layout/text created
wholly within the page (same for avs, blankclip/colorbars/stackhorizontal/stackvertical/subtitle plus other stuff).

With Avisynth YOU! are the webpage designer.
If you wanted to pass some arguments (via command line and MEDIAPLAYER) into an avs file, you would also need in-depth info on what arguments (if any) the avs required,
and whether any particular arg was video/audio/text/coords (or whatever, and if video/audio/image, a filename, url).

You could of course just pay someone to read the avisynth docs & write your avs scripts for you.

Again, I dont think avisynth is ideally suited to you.

Dreamject
12th May 2019, 14:25
-_- I already made avs as i want in PotPlayer and them works well (with your helps), https://github.com/Onemeshnik/supersvp , but I was very suprised that if I prefered official way it was more difficult and gived me more pain than intuitive noob's way. I needed to test script on different situation, cloaser to reallife - shaders, 1080p mkv, subtitles rendering, but just opening ~10 different iles and switch them fastly modern video (mkv) files, switching betwee what IDE understands and what player gets is just way of pain. As I get you can not even measure perfomance correctly with something like 'encode "10sec example.mkv" -avs=1.avs -videotype=raw 0.avi'

Vapoursynth as more modern filter does not even have integrated python libs (like avspmod which can not open videofile does) and just crashs until you install python, even when I install 64bit python, installer did not just unpacked x86 vapourthynth - i've checked and libraries could be integrated easily in vapoursynth folder. So using python/vs to do quite simple thing is bigger pain. For using avisynth with potplayer (may be another player) you just need to put AviSynth.dll with exe and sometimes to do unobvious things, but if you wanna vapoursynth... ¯\_(ツ)_/¯

EDIT: Normal people in 2k19 can not even get what is 'AviSynth communicates with any program that supports AVIs ' or imagine something like that
https://3dnews.ru/assets/external/illustrations/2018/06/26/971746/02.jpg
videomakers imho can not use that mostly (avisynth has at least good svp plugin), I do not know how vapoursynth works, but as I get using it looks like
https://s18.directupload.net/images/190512/abwaokde.png (https://s18.directupload.net/images/190512/azbjbyod.png)

User needs to just move sliders, click some buttons by mouse, not to code parameters, especially with something like vapousynth. Mostly, 25$ version of paid quite succesful SVP is just shell for only one slider which is not very correct, based on mvtools last message was 3 years ago (it's wiki error, but it's not very active anyway). Why is it succesfull even it's not very good? It just has usabiliity ¯\_(ツ)_/¯