pinterf / avisynthplus Goto Github PK
View Code? Open in Web Editor NEWThis project forked from avisynth/avisynthplus
AviSynth with improvements
Home Page: http://avs-plus.net
This project forked from avisynth/avisynthplus
AviSynth with improvements
Home Page: http://avs-plus.net
Lets consider small script with example of speed up with pitch compensation for audio.
For old AVS it works.
For AVS+
audio = WavSource("d.wav").ConvertAudioToFloat().SSRC(48000)
video = Version()
scene = AudioDub(video, audio)
function SpeedUpByX(scene, times) {
origaudiorate = scene.AudioRate
scene = scene.AssumeFPS(scene.FrameRate*times, sync_audio=true).ChangeFPS(24)
scene = scene.TimeStretch(pitch=100.0/times)
scene = scene.ResampleAudio(origaudiorate)
return scene
}
#return SpeedUpByX(scene, 4) #ok
return SpeedUpByX(scene, 5) #NOT ok [avisynth @ 037e77c0] Evaluate: Unhandled C++ exception!
Sample files https://drive.google.com/file/d/1FFOJPMH32IaIFVPGHucQSEsouwMi0oAe/view?usp=sharing (41K)
AVS+ 32bit, debug, from
commit 4c4635eaa32689336d45a26c5b326598242d6b2b
Author: Pinterf <[email protected]>
Date: Mon Nov 25 12:33:11 2019 +0100
Pinterf,
It seems converting 16bit-> 8bit darkens by 1 step. Please see the linked post and my response.
https://forum.doom9.org/showthread.php?p=1820991#post1820991
cheers,
raffriff42
G'day! Currently in avs+ cropping is limited to mod4 whereas in vs mod2 cropping is permitted. Is it possible to get this feature implemented in avs+?
Kind Regards!
Seems the MSVC version check didn't work fine with clang.
The C compiler identification is Clang 3.8.0
The CXX compiler identification is Clang 3.8.0
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/ClangC2/14.10.25903/bin/HostX86/clang.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/ClangC2/14.10.25903/bin/HostX86/clang.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/ClangC2/14.10.25903/bin/HostX86/clang.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/ClangC2/14.10.25903/bin/HostX86/clang.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at CMakeLists.txt:26 (MESSAGE):
Visual C++ 2017 or newer required.
Multithreads based on threads, it's logical to link them with numbers of cores. IMO at least info about numbers of logical/physical CPUs should be included.
There is sysinfo plugin,
https://forum.doom9.org/showthread.php?t=176131
but it's much faster end easier to set threads number nanually that load plugin. Using internal variables is much easier
MixAudio() produces stitches.
When using MeGUI's downmix function
function c6_stereo(clip a)
{
fl = GetChannel(a, 1)
fr = GetChannel(a, 2)
fc = GetChannel(a, 3)
lf = GetChannel(a, 4)
sl = GetChannel(a, 5)
sr = GetChannel(a, 6)
fl_sl = MixAudio(fl, sl, 0.2929, 0.2929)
fr_sr = MixAudio(fr, sr, 0.2929, 0.2929)
fc_lf = MixAudio(fc, lf, 0.2071, 0.2071)
l = MixAudio(fl_sl, fc_lf, 1.0, 1.0)
r = MixAudio(fr_sr, fc_lf, 1.0, 1.0)
return MergeChannels(l, r)
}
It produces stitches. Additionally, the process speed is much lower than using official avs2.6 when MixAudio() is engaged.
Here's the file that can reproduce the issue without difficulty.
test.zip
When using official avs2.6, I tried to find anything wrong, but it works well.
AnimeIVTC uses some old plugins that exist only in x86 versions and when I try to load them using LoadPlugin get message "Cannot load a 32 bit DLL in 64 bit Avisynth". My OS is Windows 10 x64, so is there any way to make Avisynyh+ r2772 start in x86 mode?
I've been staring at the code for months and completely failed to figure out how to change the hardcoded subtitle halo width without breaking 100% of the subtitle functionality. I don't know why it was made so unbearably cryptic, fixed, and unexpandable.
Do you know if it's even possible at this point to make it more configurable? On standard DVD footage resolution it might look fine, but once you go HD or higher, increasing subtitle font size accordingly, halo gets vanishingly smaller compared to font size.
Many conversion functions give weird results with 32-bit Y sources, most probably due to not being adapted to the new range for the U and V channels. It looks like they want to fill the U and V planes with half_range
but they fill them with 0.5
instead of 0.0
.
ConvertBits(32)
ConvertToYV12() #or YV16, or YV24, or RGB48, or RGB64, or PlanarRGB
ConvertBits(8)
ConvertBits(32)
ConvertToYV12() #or YV16, or YV24
Expr("x","x 0.5 -")
ConvertBits(8)
ConvertBits(16)
ConvertToYV12() #or YV16, or YV24
ConvertBits(8)
In addition, converting Y to YUY2 at any bitrate other than 8 will cause a severe crash:
I'm sorry.
When trying SupTitle plugin with Avisynth+ x86 on Windows Server 2008 R2 x64 Standard, there is no output and the Avisynth process is hanging - example. Tested different older versions, the behavior is the same.
Removing SupTitle, there is no problem - example.
Using SupTitle plugin with AviSynth 2.6.0/2.6.1, there is no problem - example.
Using SupTitle x64 and Avisynth+ x64, there is no problem.
Here SupTitle plugin x86.
On Windows 10 there is no such problem.
Hi,
I have found the following to cause a crash instead of throwing an error:
#Source colorspace: YV12
Expr(last,"x 255.0 /","x 255.0 /","x 255.0 /",format="RGBPS") # or any other RGB bitdepth
I guess because input planes U, V have a different width and height (in pixels) than the output G, B planes?
In addition, imagine my intention was to process the source Y channel for each output RGB plane, instead of processing U and V. Isn't there any way to do so?
Anyway, thank you, pinterf. This is a very great function.
Hi.
r2728-MT x64/r2664-MT x64 - these version are crashing when I have:
cLeft=2
StackHorizontal(Crop(cLeft, 0, cLeft, 0).mt_convolution("0 1 0", "0 1 1", y=3, u=3 , v=3),Crop(cLeft, 0, 0, 0))
or
cRight=2
StackHorizontal(Crop(0, 0, width-cRight, 0),Crop(width-2*cRight, 0, cRight, 0).mt_convolution("0 1 0", "1 1 0", y=3, u=3, v=3))
When cLeft/cRight > 2, no problem. Removing mt_convolution(...) = no problem.
r2728-MT x86 doesn't crash with cLeft/cRight = 2 + mt_convolution(...).
Here both x64 and x86 doesn't crash:
cTop=2
StackVertical(Crop(0, cTop, 0, cTop).mt_convolution("0 1 1", "0 1 0", y=3, u=3, v=3),Crop(0, cTop, 0, 0))
cBottom=2
StackVertical(Crop(0, 0, 0, height-cBottom),Crop(0, height-2*cBottom, 0, cBottom).mt_convolution("1 1 0", "0 1 0", y=3, u=3 , v=3))
Thanks for everything you're doing.
Hi there,
I have experienced some issues with the performance of the ConvertToYV12
and ConvertToYV16
functions (and their ConvertToYUV4xx
equivalents).
In summary, doing a RGB->YV24->YV1*
conversion path results in a higher processing speed than a direct RGB->YV1*
conversion, in my IvyBridge (up to AVX) processor. I have made some measurements which show what I'm saying (the numbers are average FPS measured with AVSMeter):
I used the following source to run these tests. Then I added the Convert calls below:
ImageSource("tivissa-turisme-terres-ebre-ribera-catalunya-2.jpg",end=400)
The picture (1746x1200) can be found here: http://www.turismeriberaebre.org/municipi/tivissa/tivissa-turisme-terres-ebre-ribera-catalunya-2/. However, the issue is not exclusive to image sources.
Cheers.
Hi, using this script with 8-bit video everything is fine. When the video is > 8-bit there is crash without any error message.
Replacing NumComponents(input) > 1 ? input == ExtractY(input) : NOP()
with if (NumComponents(input) > 1) { input = ExtractY(input) }
works fine with every bit depth.
Used avs+ r2915 / 3.4.
Hi,
I have "the named argument "clamp_float" to Expr had the wrong type" error when something like that is used:
mt_lut("...", use_expr=3)
Used masktools2 2.2.20@64efe33, avs+ 3.5.0@a34ede9.
line 31 should be
#include "..\core\internal.h"
not
#include "..\avs_core\core\internal.h"
ffmpeg (all versions, from 2016 to 2019) and VirtualDub crashed (randomly, but with probablility > 50%) after some manipulations
(SSRC and clip concatenation).
Minimal sample to reproduce:
https://drive.google.com/open?id=1g8HKn2CVYAbQ1pRsNNiVmxcELLIA_OX9
AVS++ on 4c4635e
Old AVSynth works OK with this.
Just calling LoadVirtualdubPlugin(..) doesn't cause any problems. But trying to apply the filter to a clip causes exceptions. The exceptions are "ignored" by AvsPmod or MPC-HC (AvsPmod might show notifications on its error window without crashing, and MPC reports the exception when closing).
I'm using the last version of Avs+ (r2508) and AVSMeter (264), which reports:
AviSynth+ 0.1 (r2508, MT, i386) (0.1.0.0)
System exception - Access Violation
The same error is reported by VirtualDub FilterMod, so it can't run the script.
I've tried filters like colorize and gradation. Everything works fine in AviSynth 2.6.
I can provide more information about how I'm using the filters in my script if you need it, but I expect you to reproduce the error easily, so I'll leave it here.
Thanks!
When video width is less than modulo 16, the expressions for the second and third planes (alpha not tested) may produce wrong results.
optAVX2=false
prevents the issue, so it seems to be related to AVX2.
Sample code:
expr_r = "x 127 < 0.98 x * -0.02 1.02 x * + ?"
expr_g = "x 127 < 1.02 x * 0.02 0.98 x * + ?"
expr_b = "x 127 < 0.9864 x * -0.0136 1.0136 x * + ?"
ColorBarsHD(1024 + 8, pixel_type="YV24") # Module 8, bug triggers
Y = ConvertToY()
# One Expr per channel
R = Expr(Y, expr_r)
G = Expr(Y, expr_g)
B = Expr(Y, expr_b)
# All at once
e = Expr(Y, expr_r, expr_g, expr_b, format="RGBP8")
Compare(R, e.ExtractR(), "Y") # Equal
Compare(G, e.ExtractG(), "Y") # Not equal!
Compare(B, e.ExtractB(), "Y") # Not equal!
Bug report: it seems that the standard resizers (spline16, bicubic, and bilinear, at least) don't process the alpha planes of YUVA clips. Report from: https://forum.doom9.org/showthread.php?p=1891701#post1891701
If you want to mix video (containing audio track, but probably it doesn`t matter) with a distinct audio track, like this:
video = FFMS2("some.video")
audio = FFAudioSource("some_audio.mp3")
audio = DelayAudio(AudioTrim(audio, 10.0, 0.0), 10.0)
MixAudio(video, audio)
Then audio will not be trimmed from the beginning, it simply shifts "start_time" seconds to the beginning of the clip. Audio in example above will start from very beginning of the video.
1st one is colors_rgb.avsi it's not work in avs+ at all unless you load it, for more info see https://forum.doom9.org/showpost.php?p=1714618&postcount=1045
(this one is fixed)
2nd one is the order of directories https://forum.doom9.org/showthread.php?p=1800799#post1800799 and https://forum.doom9.org/showthread.php?p=1880154#post1880154
(this one is fixed too)
3rd is avs+ don't unload the loaded plugins after autoload like normal avs https://forum.doom9.org/showthread.php?p=1814912#post1814912
(this one not fixed yet)
and thanks
If you go to https://github.com/pinterf/AviSynthPlus you see fistly was changed 6 years ago. I was confused when finded active branch. Imho its more logical to move mt branch to master
All navigation like releases->code returns old branch
I see
violation "_ASSERTE(index<array_size)" on "const AVSValue& AVSValue::OPERATOR_INDEX(int index) const"
(actually, I see index=4 on array_size=2, array=args
static AVSValue __cdecl Create(AVSValue args, void* user_data, IScriptEnvironment* env) {
...
const int vtrack = args[4].AsInt(0);
const int atrack = args[5].AsInt(0);
...
To reproduce
audio = WavSource("wtf.wav")
( sample file to reproduce:
https://drive.google.com/file/d/1NHjeJiKFPz4otu9h1x5dm-3ZB9eUNr2W/view?usp=sharing
https://cloud.mail.ru/public/5eRX/5yNVrUpkr )
If I use released version of AVS+, I got crush on ffmpeg/VirtualDub exit.
On debug version I got this assert violation.
As title really. Crashes using built in UnSharpMask with ConverttoYV24.
Simply put this in an avs file:
AVIFileSource("test.avi", audio=true).converttoYV24().UnsharpMask(strength=60, radius=3, threshold=8)
And render it in ffmpeg or open in AvsPMod. It will crash out in AvsPMod and ffmpeg just doesn't output anything, just returns to command.
Tested with DirectShowSource which also crashes.
Crashes with ConverttoYUV444 as well.
It doesn't mention any limitations in the wiki for UnSharpMask.
Works fine with ConverttoYV12 though.
Edit:
Program Versions
Avisynth+ v2772 (20181220)
FFMpeg 4.2
Hi. Probably the instructions from the original post still fully apply, but it feels like it's better to get an official confirmation.
@pinterf what's your current setup for building avs+? At least the VS version is different now. I just want to contribute some code, so it's better to have everything fully compatible.
You extended script language for using
If (x>0) {
}
Instead of
x>0? eval("""
""")
But if you want to use easier format, you need to rewrite your script.
If you allow {} instead eval(""" """) you just can find and replace eval(""" to { and """) to }
So you get syntax highlight and you do not need rewrite script
Addborders really should have the option not to convert the background to TV Range when adding borders to a YUV clip. Maybe it could be updated to adopt the color_yuv parameter of blankclip?
Idea: https://forum.doom9.org/showthread.php?p=1891701#post1891701
[Documentation] Would it be possible to list which platforms are currently supported by AviSynthPlus? E. g. Linux, Windows and so forth? Ideally in the main README.md if possible.
I just discovered the project. I used to use AviSynth back when I was using windows.
These days I use linux and program as well, although mostly in ruby (lighter weight than C, C++, C# etc...).
I was sad when avisynth 3.0 never came, and discovered other projects I think ... and just now avisynth+.
Hello
Could it be possible to provide a zipped version for the fileonly? AvisynthPlus-r2728-MT-filesonly.zip
The reason of a such request is that it make it available for developpers to directly script the extraction from Maven, Gradle or Ant...
7Z is not widely supported as Zip or Tar.gz so the direct extraction is often not possible, also if some specific plugin sometimes exist, so it ask us host such compressed files on sites like Sourceforge or Bintray, for example, and uncompressed them.
Cheers
VC1 video, decoded with AviSynth+ r2772 has reddish colors.
K-Lite Codec Pack settings window:
FFmpegSource2("Equilibrium-001.mkv")
DirectShowSource("Equilibrium-001.mkv")
ffmpeg.exe -i Equilibrium-001.mkv -frames:v 1 ff.png
All screenshots (when AviSynth+ was used) above were taken with ffmpeg: ffmpeg.exe -i 01.avs -frames:v 1 ff.png
As you can see ffmpeg decoder provides natural colors.
http://www.framecompare.com/image-compare/screenshotcomparison/10J1NNNU
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.