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 10th December 2014, 00:54   #21  |  Link
jriker1
Registered User
 
Join Date: Dec 2003
Posts: 485
So far heard back from NeatVideo asking if it works fine in VDub so expecting not going to have a resolution there but we shall see as I mentioned that I'd at least like to know what's the impact of this since it is doing it. I guess even though they list the feature in their user manual, doesn't mean it's within their support space.

JR
jriker1 is offline   Reply With Quote
Old 10th December 2014, 01:08   #22  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Sorry for the bother, hope this works OK.

Code:
# MakeMultiPartScripts.avs
#######
PARTS=4             # Edit as appropriate
#######
myName="MakeMultiPartScripts: "
Assert(PARTS>1,RT_String("MakeMultiPartScripts.avs: PARTS MUST be greater than 1 (%d)",PARTS))
IsAvsPlus=(FindStr(VersionString, "AviSynth+")>0 || FindStr(VersionString, " Neo")>0)
HasGScript=RT_FunctionExist("GScript")
Assert(IsAvsPlus || HasGScript,RT_String("%sNeed either GScript or AVS+",myName))
#######
FSEL_TITLE="Select AVS files"
FSEL_DIR="."
FSEL_FILT="AVS files|*.AVS"
FSEL_MULTI=True
FILE_LIST = RT_FSelOpen(title=FSEL_TITLE,dir=FSEL_DIR,filt=FSEL_FILT,multi=FSEL_MULTI)
Assert(!(FILE_LIST.IsInt && FILE_LIST==0),RT_String("%sUser Cancelled in FileSelector - No action taken",myName))
Assert(FILE_LIST.IsString,RT_String("%sRT_FSelOpen Error=%s",myName,String(FILE_LIST)))

SCRIPT_TMPT = """
    PART  = %d
    PARTS = %d
    Import("%s")
    FC = FrameCount
    Start = ((part==0      ) ?   -1 : part     * (FC-1) / PARTS) + 1
    End   = ((part==PARTS-1) ? FC-1 : (part+1) * (FC-1) / PARTS)
    End   = (End == Start)   ?   -1 : End
    Trim(Start,End)
#    Subtitle("Trim("+String(Start)+","+String(End)+")")
    Return Last
"""

GS="""
    NLINES = RT_TxtQueryLines(FILE_LIST)
    for(i=0,NLINES-1) {
        PARTSNAME = RT_TxtGetLine(FILE_LIST,i)
        for(part=0,PARTS-1) {
            PartName = RT_String("%s_PART_%d.avs",PARTSNAME,part+1)
            ScriptInst=RT_String(SCRIPT_TMPT,part,PARTS,PARTSNAME)
            RT_WriteFile(PartName,"%s",ScriptInst)
        }
    }
"""
HasGScript ? GScript(GS) : Eval(GS) # Use GSCript if installed (loaded plugs override builtin)

MessageClip(RT_String("ALL DONE, Processed %d avs files of %d parts each",NLINES,PARTS))
EDIT: Problem was I had missed out the format string "%s" below and it was treating ScriptInst as format string ie '\' interpreted as escape
characters rather than pure data without escapes, so eg '\t' interpreted as TAB.
Code:
RT_WriteFile(PartName,"%s",ScriptInst)    # was equivalent to RT_WriteFile(PartName,ScriptInst)
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 26th April 2019 at 10:29. Reason: Update
StainlessS is offline   Reply With Quote
Old 10th December 2014, 08:00   #23  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
Quote:
Originally Posted by jriker1 View Post
Normally I'd delete the one frame and be done with it, however the fact that the frame count is the same with or without NeatVideo and the first frame is blank is bothering me.
If you want to stick with NeatVideo in Avisynth and find no way to prevent the initial black frame, perhaps you could see whether adding a duplicate of the first frame to the start of each input clip helps. It will presumably turn black, and trimming that off afterwards should leave you with the original starting frame and original frame count (assuming everything that's been said about NeatVideo not changing the frame count being correct).
fvisagie is offline   Reply With Quote
Old 10th December 2014, 20:35   #24  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Arh good, a bit of common sense, sounds good to me
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 11th December 2014, 05:06   #25  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,695
Nice workaround, fvisagie.
johnmeyer is offline   Reply With Quote
Old 11th December 2014, 17:43   #26  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
@jriker1

I thought I had a problem (bug) with RT_FSelOpen due to the previous MakeMultiPartScript.avs but turns out not a bug.
I was using Media Player Classic - Home Cinema to open, and if I clicked Cancel then it would immediately bring up another File Selector.
Thought was bug in RT_FSelOpen but seems that MPC-HC will immediately retry because of Assert() alert (due to user Cancel) without any
frames being delivered from script. Does not happen with other players and seems that MPC-HC is just trying to be helpful in re-starting what
it thinks is glitch in the system. Anyway, just pointing it out if you use MPC-HC (just updated to latest stable and still does it), but does not
happen in other players that I've tried.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 12th December 2014 at 09:09.
StainlessS is offline   Reply With Quote
Old 18th December 2014, 22:29   #27  |  Link
jriker1
Registered User
 
Join Date: Dec 2003
Posts: 485
Quote:
Originally Posted by fvisagie View Post
If you want to stick with NeatVideo in Avisynth and find no way to prevent the initial black frame, perhaps you could see whether adding a duplicate of the first frame to the start of each input clip helps. It will presumably turn black, and trimming that off afterwards should leave you with the original starting frame and original frame count (assuming everything that's been said about NeatVideo not changing the frame count being correct).
Thanks fvisagie. Agree it's a good workaround. Been talking with Vlad about this at neatvideo but he keeps waiting for someone (presuming on the AVISynth side), to get back to him. Not sure I'll ever get an understanding of the cause. How would that work? Something like this?

Code:
AVISource("Video.avi")
clipOne = Trim(0, 1)
clipTwo = Trim(0, 0)
AlignedSplice(clipOne, clipTwo)

OR

AVISource("Video.avi")
edited_video = Trim(0,1) ++ Trim(0,0)
Right now I have been adding in NeatVideo straight thru Virtualdub. Which brings up a question. NeatVideo in AVISynth, can fast recompress. With NeatVideo loaded as a plugin in Virtualdub, have to select full processing mode. Do we think one way is faster than another?

Thanks.


JR

Last edited by jriker1; 18th December 2014 at 22:44.
jriker1 is offline   Reply With Quote
Old 18th December 2014, 22:55   #28  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Trim(0,1) would trim two frames, frame 0 and frame 1.
To trim only a single frame use Trim(0,-1), the -1 means 1 frame, starting at frame 0. Trim(0,0) would not work (for 1 frame) as it means
from frame 0 to end of clip.

What you want is something like this
Code:
AVISource("Video.avi")
Trim(0,-1) ++ last
or better
Code:
AVISource("Video.avi")
Trim(0,-1) ++ Trim(0,0)  # here trim(0,0) ensures that the Last clip has audio trimmed exactly to each end,
                         # padding with silence if necessary.
EDIT: ++ same as AlignedSplice.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 18th December 2014 at 23:37.
StainlessS is offline   Reply With Quote
Old 18th December 2014, 23:07   #29  |  Link
jriker1
Registered User
 
Join Date: Dec 2003
Posts: 485
Got it thanks.

Is it documented somewhere how the negative logic works on Trim? I've seen references to Trim(0,-10000). What is that compared to Trim(0,10000)

JR
jriker1 is offline   Reply With Quote
Old 18th December 2014, 23:20   #30  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Trim(0,10000) # trim frames 0 to frame 10,000 # 10,001 frames, 0 and 10,000 inclusive
Trim(0,-10000) # trim frames 0 to frame 9,999 # ie 10,000 frames

http://avisynth.nl/index.php/Trim

EDIT: Avisynth does come with Docs, but perhaps more convenient as a CHM (compressed html help file).
See MediaFire in sig below this post, in DATA directory for the Avisynth Docs as CHM file together with
the developer SDK docs. Can eg copy into Avisynth folder, and create a shortcut to it in your Program
shortcuts directory. On XP, right click START button, Select "Explore All Users", navigate to Programs/Avisynth/
or wherever on your system and create a short cut and point it at the chm file. Right Click Properties and give it a Hot-Key
combination, I use CTRL-ALT-H. Quite convenient especially if on a laptop. Is also searchable.
EDIT: There are two versions, with SDK docs for v2.6 and without for v2.58. The v2.6 one is better choice even for v2.58.
EDIT: Hot-Key may not work until reboot.

EDIT: And here the thread: http://forum.doom9.org/showthread.ph...light=chm+file
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 18th December 2014 at 23:43.
StainlessS is offline   Reply With Quote
Old 19th December 2014, 09:42   #31  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
Quote:
Originally Posted by jriker1 View Post
NeatVideo in AVISynth, can fast recompress. With NeatVideo loaded as a plugin in Virtualdub, have to select full processing mode. Do we think one way is faster than another?
If you're using the Virtualdub definition of fast recompress, that is something that cannot be done with Avisynth involved. Fast recompress refers to direct decompressor-compressor linking. It transports video in actual compressed format such as H.264, HuffYUV, Lagarith etc., and excludes raw video (processed by Windows colourspace 'codecs' such as Intel Indeo or Helix). Avisynth always fully decodes video to raw format, which in concept is similar to VirtualDub's full processing mode.

Most people report that a given plugin executes slower in Avisynth than in VirtualDub, presumably due to the interface translation needed in Avisynth.

In theory, therefore, the equivalent process may very well be slower in Avisynth than in VirtualDub. However, you can choose to ignore all this and see for yourself .
fvisagie is offline   Reply With Quote
Old 19th December 2014, 14:14   #32  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
JR, if you have to convert to RGB, then would be better to do RGB particular processing together to avoid degradation with each accompanying
colorspace change. It probably does not matter much if colorspace change from RGB to YUV is done in Avisynth (with Fast Recompress to VD)
or Vdub compression, so long as both done without additional colorspace changes.

fvisagie, I think you misinterpret what JR was meaning.
EDIT: And what you described was actually Direct Stream Copy not Fast Re-compress which enters into negotiation with codec
to decide upon which colorspace conversions if any, are necessary. So eg YUV to HuffYUV YUY2 mode can skip conversion to RGB
and additional conversion to YUY2.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 19th December 2014 at 16:12.
StainlessS is offline   Reply With Quote
Old 19th December 2014, 19:16   #33  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
Quote:
Originally Posted by StainlessS View Post
EDIT: And what you described was actually Direct Stream Copy not Fast Re-compress which enters into negotiation with codec
to decide upon which colorspace conversions if any, are necessary. So eg YUV to HuffYUV YUY2 mode can skip conversion to RGB
and additional conversion to YUY2.
Correct, my description applies to Direct stream copy, apologies.

However, as I see it the problem statement remains, due to the fact that NeatVideo - being a VirtualDub plugin - would still require conversion to RGB32 (unless input already happens to be in RGB32). In other words, NeatVideo's processing would likely necessitate a colourspace conversion, which even when done in Avisynth effectively translates to VirtualDub's Full processing mode.
fvisagie is offline   Reply With Quote
Old 19th December 2014, 22:21   #34  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Yes, absolutely. Jr though does some kind of analogue rgb processing, I was just saying that it might best be done together if possible.
(EDIT: I still dont know what Neat Video actually does, but does not really matter).

No apologies for anything are warranted, we all make mistakes and hope that you don't mind too much if they may be pointed out.
I would expect no less from from you if situation was reversed.

Have a nice one and try not to get stuck in all of that snow that you probably have in SA.
(EDIT: OK, maybe not so much snow usually, but by god what monster hail stones you can have)
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 19th December 2014 at 22:39.
StainlessS is offline   Reply With Quote
Old 20th December 2014, 09:08   #35  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
Quote:
Originally Posted by StainlessS View Post
try not to get stuck in all of that snow that you probably have in SA.
(EDIT: OK, maybe not so much snow usually
Was just wondering whatever could have given you that idea. Any snow at this time of year must have been carefully imported at great personal risk.
fvisagie is offline   Reply With Quote
Old 20th December 2014, 09:43   #36  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
OK, I perhaps should have added a Smiley.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 20th December 2014, 10:01   #37  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
My smiley was also implied, hope you spotted it.
fvisagie is offline   Reply With Quote
Reply

Tags
avisynth, neatvideo

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:18.


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