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

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th August 2007, 17:52   #81  |  Link
Xiphan
Registered User
 
Join Date: Jul 2007
Location: Durban, South Africa
Posts: 11
Quote:
Originally Posted by neuron2 View Post
Set it to true.
Ok thanks! Is true the better option to use, in my case, I'm converting an asf file to avi, and apparently it has an fps of 25?
Xiphan is offline   Reply With Quote
Old 27th August 2007, 18:06   #82  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Both false and true will result in cfr. The difference is that setting it to false, it will load the video with fps=25. If the frame rate is different, or variable, you will get video and audio which is not in sync. When setting it to true it will add/delete frames (to match the specified fps), with the result that the video and audio is in sync.

Since asf is vfr, yes, you should use it.
Wilbert is offline   Reply With Quote
Old 29th August 2007, 01:29   #83  |  Link
Xiphan
Registered User
 
Join Date: Jul 2007
Location: Durban, South Africa
Posts: 11
Quote:
Originally Posted by Wilbert View Post
Both false and true will result in cfr. The difference is that setting it to false, it will load the video with fps=25. If the frame rate is different, or variable, you will get video and audio which is not in sync. When setting it to true it will add/delete frames (to match the specified fps), with the result that the video and audio is in sync.

Since asf is vfr, yes, you should use it.
Ok thanks! That explains a lot! What exactly is happening if I don't specify any fps parameters? If I just have a script like this:
Code:
DirectShowSource("test.asf")
Would this result in audio sync errors too?
Xiphan is offline   Reply With Quote
Old 29th August 2007, 19:58   #84  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
Ok thanks! That explains a lot! What exactly is happening if I don't specify any fps parameters? If I just have a script like this:
It tries to guess the fps, but i forgot how that works. Perhaps someone else knows?

Quote:
Would this result in audio sync errors too?
Yes. Arguments have a default value (which is false for convertfps), which are used if you don't specify the arguments.
Wilbert is offline   Reply With Quote
Old 29th August 2007, 21:30   #85  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,556
It uses whatever framerate the splitter reports back. Since directshow is based on timecodes, there's no harm in returning totally off-the-wall framerates, or one framerate for everything, so some do. Others will report the average duration, the framerate muxed into the container (which can anything for the same reason, but muxers are better in this respect), the duration of the first frame, and so on. Obviously a completely unreliable value, you're better off never trusting the splitter.
foxyshadis is offline   Reply With Quote
Old 27th September 2007, 17:16   #86  |  Link
AkumaX
Registered User
 
Join Date: Mar 2007
Posts: 6
avisynth + vdm

i'm looking to use a built in filter (logo, specifically) from vdm, in avisynth. is there a way i can do that? (i'd use donald graft's logo 1.34a but it doesn't give me the intended results)

thanks in advance!
AkumaX is offline   Reply With Quote
Old 27th September 2007, 18:08   #87  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,556
Not without breaking it out as an external plugin, unfortunately.

For logo, you can use Overlay or Layer to get the same effect in avisynth. You can also try the xlogo plugin for more options.
foxyshadis is offline   Reply With Quote
Old 9th October 2007, 04:19   #88  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Guys, you won't get specific help on problems in this thread. Please start a new thread for your problems.
Guest is offline   Reply With Quote
Old 3rd January 2008, 14:23   #89  |  Link
video
moron
 
Join Date: Jan 2005
Location: Budapest, Hungary
Posts: 205
have anybody have/seen the sources of the pixiedust (dust.v5.dll) avisynth plugin?
thx.
__________________
one by one my leaves fall...
one by one my tales are told...
video is offline   Reply With Quote
Old 3rd January 2008, 15:19   #90  |  Link
unskinnyboy
Registered User
 
unskinnyboy's Avatar
 
Join Date: Feb 2004
Location: NTSC R1
Posts: 2,046
Quote:
Originally Posted by video View Post
have anybody have/seen the sources of the pixiedust (dust.v5.dll) avisynth plugin?
thx.
Nope. Steady never released the source.
__________________
unskinnyboy is offline   Reply With Quote
Old 17th December 2008, 00:54   #91  |  Link
KG6ZVP
Registered User
 
Join Date: Dec 2008
Posts: 5
AVIsynth help

I have been developing software for use on PSP: PSP_Converter

This software automatically performs the following tasks via AVIsynth:
> automatic resizing of video clips to a maximum size of 480x272, but retains their original aspect ratio

> If framerate contains more than 3 decimal places, it is rounded (ex. 23.976043 to 23.976) and converted to that rate.

> If framerate is above 30 fps, it changes it to 29.970 fps

> Loads any file that can be converted in ffmpeg without that video codec being installed



I have two problems:

> Cannot handle variable framerate video files. Audio is very far out of sync. Is there a way to tell avisynth to change the framerate to one that is in sync with the audio before it is rounded?

> Cannot convert any input file which uses DAR, SAR or PAR in it's display. Is there a way to retrieve one of those values in order to calculate the output video size?


Below is my script. I have included brief explainations along with each section. I am a developer. This script must work for ANY input file and cannot be engineered for specific files.


#Load necessary plugins
LoadPlugin("FFmpegSource.dll")
LoadPlugin("Autocrop.dll")

#Load and crop input clip
Input_Clip = FFmpegSource("C:\Users\Jim\Videos\Clip.avi", vtrack=-1, atrack=-1).autocrop(mode=0)

#Calculate video width and height based on the autocropped Input_Clip and a maximum output resolution of 480x272
i_width = Input_Clip.Width
i_height = Input_Clip.Height
d_a_r = float(i_width) / float(i_height)
p_o_height = (d_a_r < 1.7647058823529411764705882352941) ? 272 : 480/float(d_a_r)
p_o_width = (d_a_r < 1.7647058823529411764705882352941) ? 272*d_a_R : 480

#Sets output width and height to numbers divisible by 4
p2_o_width = Round(p_o_width/4)*4
p2_o_height = Round(p_o_height/4)*4
o_width = Round(float(p2_o_width))
o_height = Round(float(p2_o_height))

#Retrieve framerate of input_clip, multiply by 1000 (this will be framerate denominator) and round it to a whole number
first = Input_Clip.Framerate*1000
second = Round(Float(first))
FPS_oi = int(second)

#If the rounded framerate is greater than 30.000fps, then set it equal to 29.97 fps
FPS = (FPS_oi > 30000) ? 29970 : FPS_oi

#Output is input clip, changed to the desired framerate numerator (whole number) and a denominator of 1000. The clip is also resized maintaining aspect ratio.
Output = Input_Clip.changefps(int(FPS), 1000).LanczosResize(o_width,o_height).converttoyv12()
Return Output



I'm a noob, I'm probably missing something obvious.
KG6ZVP is offline   Reply With Quote
Old 17th December 2008, 04:59   #92  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
You're breaking two rules with this post.

1. You can't repost an issue that was closed for a rule violation in another thread. That's a 16 strike.

http://forum.doom9.org/showthread.ph...05#post1224905

2. You shouldn't be posting in this thread. Didn't you get the idea when I moved your other posts? This thread is for discussion of FAQs, not for specific problems. That's a rule 3 strike.

http://forum.doom9.org/showthread.ph...36#post1053536

Do not bring up this issue again. You can't change history. And don't start debating me here either. Send a PM if you want to challenge a moderating decision.

Last edited by Guest; 17th December 2008 at 05:09.
Guest is offline   Reply With Quote
Old 2nd June 2010, 15:39   #93  |  Link
peter71
Guest
 
Posts: n/a
period precedence

Hi,

The avisynth documentation mentions operator precedence, but does not say anything about the '.' operator.

I mean, experience shows that

v1+v2.bob() means v1+(v2.bob()) and not (v1+v2).bob()

but is this actually a defined behaviour ?

thanks,
Peter
  Reply With Quote
Old 2nd June 2010, 18:45   #94  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by peter71 View Post
experience shows that
v1+v2.bob() means v1+(v2.bob()) and not (v1+v2).bob()
but is this actually a defined behaviour ?
Yes, it is.
'.' is not really an operator (what would its right operand be?), just a syntactic element, but in effect it binds more tightly than any operator.

http://avisynth.org/mediawiki/The_fu...ar#Expressions
Gavino is offline   Reply With Quote
Old 4th January 2011, 00:56   #95  |  Link
ProDigit
Guest
 
Posts: n/a
request a clear wiki page for older anime! (low bitrate,low motion encoding).
  Reply With Quote
Old 26th August 2012, 21:47   #96  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 365
I guess this question does not need it's own thread, but fits right into this one.
Is there a bug with the behavior of Eval()?

This works:
Code:
Clip
Eval("filter_string")
This does not work, which to me is kind of weird...:
Code:
Clip.Eval("filter_string")
__________________
(i have a tendency to drunk post)
mastrboy is offline   Reply With Quote
Old 26th August 2012, 23:56   #97  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
Eval is a little strange, it parses the expression in place where the eval call is. So case 1 is
Code:
Last=Clip
Filter(Last, _string) # Implicit last handling for Arg[0]
if "filter_string" need a clip source or
Code:
Last=Clip
Filter_string # Implicit last not required for Arg[0]
if it does not take a clip source.

And for case 2
Code:
Filter(Clip, _string) # Explicit Clip as Arg[0]
i.e. "filter_string" is expected to take a clip source.

The implicit last handling can make thing a little tricky e.g
Code:
BlankClip(Height=420)
BlankClip(Height=240).Eval("Subtitle(String(Height()))")
Which evaluates to
Code:
Last=BlankClip(Height=420)
BlankClip(Height=240).Subtitle(String(Height(Last)))
So you end up with a 240 high clip with the number 420 stencilled over it.
IanB is offline   Reply With Quote
Old 27th August 2012, 01:41   #98  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 365
So it's not a bug, but "intended" behavior.

btw, the Eval entry in the wiki could probably use a little more documentation, it basically only says "Eval evaluates a string as if it was part of the script. " and gives a example...
__________________
(i have a tendency to drunk post)
mastrboy is offline   Reply With Quote
Old 7th September 2012, 09:15   #99  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by IanB View Post
The implicit last handling can make thing a little tricky e.g
Code:
BlankClip(Height=420)
BlankClip(Height=240).Eval("Subtitle(String(Height()))")
Which evaluates to
Code:
Last=BlankClip(Height=420)
BlankClip(Height=240).Subtitle(String(Height(Last)))
So you end up with a 240 high clip with the number 420 stencilled over it.
No it doesn't, it produces the error 'Invalid arguments to function "Eval"'.
Just like any other use of the '.' notation, clip.Eval(filter_string) is the same as Eval(clip, filter_string).
This can never be correct since Eval does not have a clip argument.

The original intent can be achieved by writing
Eval("clip."+filter_string)
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 12th April 2015, 14:12   #100  |  Link
kotuwa
Registered User
 
Join Date: May 2012
Posts: 66
multi-lined vs single line with a .

What is the difference between putting two functions in two lines vs in one line with a period/dot (.)
!?


For an example,


crop(0,10,0,-10)
Spline64Resize(1280,720)

vs

crop(0,10,0,-10).Spline64Resize(1280,720)


Performance-wise differences,
And differences in Qulaity and Lossyness...
kotuwa is offline   Reply With Quote
Reply

Tags
avisynth, faq

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 08:57.


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