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 15th August 2009, 18:16   #201  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by fvisagie View Post
After a while there's a long list of Trims and I can no longer remember exactly which Trim in the return statement returns which footage.

What is the quickest way of sampling in random order the contents of individual Trims/clips? E.g. sample clip3's contents, sample the contents of clip1, sample the contents of clip2 and now you have a good idea of that part of the timeline?
You could set a bookmark at each splice point on the timeline and cycle through them with F2. (I think using the Trim editor sets them automatically.)

Regarding your audio issue, I take it the main problem is you want to cut based on the audio content and it's tedious finding the exact frame that corresponds to your desired cut point.
Here's a cheap and dirty solution that might at least help: add this to the end of your script (where it can easily be commented in and out):
ShowFrameNumber()
AssumeFPS(framerate/4, true)
Then when you play in an external player it will play at 1/4 speed, showing the frame numbers as it goes, which may make it easier to find the frame you want. (I said it was cheap and dirty. )
Gavino is offline   Reply With Quote
Old 17th August 2009, 08:57   #202  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
Quote:
Originally Posted by AlanHK View Post
I might suggest VirtualDubMod, which incorporates a simple AVS editor (one of the mods to the straight VirtualDub). This can insert Trims in the AVS for selected ranges.

Or set VirtualDubMod to be AvsP's "external player" and use both.
Using both proves to be cumbersome, even including displaying frame numbers (as Gavino also suggested, thanks).

Another complication is that the source is DV AVI containing DATECODEs that need to be preserved. Of course with any project where AVS does the final rendering this won't happen automatically. Extracting DATECODEs with DVInfo is presenting its own niggles - output isn't fully suppressed when DATECODEs are absent, and of course the issue for a newbie like me of getting it all programmed to work correctly in a complex editing project.

The simplest solution for now turned out to be straight VirtualDub - it provides synchronised real-time video + audio playback, all cutting can be done in a single interface, and it supports direct copy of unmodified frames, preserving their DATECODEs.

Thanks to all for your contributions and suggestions, I sincerely appreciate it.
fvisagie is offline   Reply With Quote
Old 17th August 2009, 09:15   #203  |  Link
maxhondur
Registered User
 
Join Date: Jul 2004
Posts: 12
Well, it seems like you're all set to go, but just for posterity's sake (and the fact that I love avsp), nine lines of text, ie the below AVSP macro

################
import time
trimmed = avsp.GetSelectionList()
originaltext = avsp.GetText()


avsp.SetText(originaltext+"\ntrim"+str(trimmed[0]), index=None)
avsp.SaveScript()
avsp.RunExternalPlayer(executable = 'C:\\some\\where\\mplayerc.exe' )


time.sleep(1)

avsp.SetText(originaltext, index=None)
avsp.SaveScript()
#################


should get you what you want, roughly? if you're in trim editing mode, and have two select points, call on the macro to play media player classic, and it'll play back the trimmed file. You can then adjust the trim points frame by frame as necessary, call the macro again, etc.

Two notes - I'm not a good coder, hence the code is pretty sloppy, but at the same time, it took about 3 minutes to write this up

Last edited by maxhondur; 17th August 2009 at 09:18.
maxhondur is offline   Reply With Quote
Old 17th August 2009, 10:45   #204  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by maxhondur View Post
if you're in trim editing mode, and have two select points, call on the macro to play media player classic, and it'll play back the trimmed file.
Cool.
How would I change this to play back from the current frame position (outside of the trim editor)?
Gavino is offline   Reply With Quote
Old 17th August 2009, 11:00   #205  |  Link
maxhondur
Registered User
 
Join Date: Jul 2004
Posts: 12
Probably just replace trim command to 'getframenumber'

######
import time
trimmed = avsp.GetFrameNumber()

originaltext = avsp.GetText()


avsp.SetText(originaltext+"\ntrim("+str(trimmed)+',0)', index=None)
avsp.SaveScript()
avsp.RunExternalPlayer(executable = 'C:\\some\\where\\mplayerc.exe')


time.sleep(1)

avsp.SetText(originaltext, index=None)
avsp.SaveScript()
#####

should work, worked on my machine

It got even more sloppy because I just cut and pasted stuff from my previous post
maxhondur is offline   Reply With Quote
Old 19th August 2009, 00:31   #206  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Thanks for that, maxhondur - a very useful addition, especially when you add a keyboard shortcut.

For my use, I removed the two avsp.SaveScript() calls since I prefer not to overwrite the original file with temporary changes I may have made. (The player will then be invoked on temporary file preview2.avs)
Gavino is offline   Reply With Quote
Old 21st September 2009, 07:57   #207  |  Link
PsiRadish
God of Biscuits/Dance
 
PsiRadish's Avatar
 
Join Date: Sep 2009
Location: From yonder star in search of churros.
Posts: 1
Request: Upload the source for the v2.0.2 bugfixes. I'm having very poor luck finding a functional Python (2.5) decompiler
PsiRadish is offline   Reply With Quote
Old 24th September 2009, 00:26   #208  |  Link
canuckerfan
Registered User
 
Join Date: Jul 2005
Posts: 317
Just wondering if anyone else is having issues with AvsP when using conditionfilter+conditionalreader? Whenever I exit after using these scripts AvsP never fully closes and reaches 50% cpu. It's not that big of a deal since I just end-task it but wondering if anyone else gets this too?
canuckerfan is offline   Reply With Quote
Old 24th September 2009, 10:54   #209  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Does this happen every time you use ConditionalReader/ConditionalFilter or does it depend on some additional factors such as for example
- length of input clip?
- size of file read by ConditionalReader?
- other filters used in script?
- number of tabs open in AvsP?

If you can reproduce the problem with a simple script and ConditionalReader input file, post it here.
Gavino is offline   Reply With Quote
Old 24th September 2009, 11:07   #210  |  Link
canuckerfan
Registered User
 
Join Date: Jul 2005
Posts: 317
Quote:
Originally Posted by Gavino View Post
Does this happen every time you use ConditionalReader/ConditionalFilter or does it depend on some additional factors such as for example
- length of input clip?
- size of file read by ConditionalReader?
- other filters used in script?
- number of tabs open in AvsP?

If you can reproduce the problem with a simple script and ConditionalReader input file, post it here.
Okay. I finally got the chance to test this and it has occured.

-clip length = 266124 frames (a little over 3 hours)
-size of file read was 52 bytes (it had to process only 2 frames)
-no other filters used (except crop): actually, here's the entire script:
Quote:
SetMemoryMax(768)

avisource("G:\Hindi Movies\Temp\DCH_ELITE\step26b.avi")

AddBorders(0,2,0,2)
Filtered = RemoveNoiseMC(rdlimit=41,rgrain=1,denoise=0,sharp=true)
ConditionalFilter(Filtered, last, "ABC1")
ConditionalReader("failed3-rd41.txt","ABC1",false)
Crop(0,2,0,-2)## 2 frames processed in this pass
-only 1 tab open (the one encoded)

Last edited by canuckerfan; 15th October 2009 at 08:21.
canuckerfan is offline   Reply With Quote
Old 26th September 2009, 11:35   #211  |  Link
espy2
Registered User
 
Join Date: Sep 2007
Posts: 8
AvsP Tools>Encode gives H264 options error

AvsP's "Tools > Encode the video" runs H264.exe but I get the error message "unrecognised option: --progress".

Versions:
AvsP: 2.02
H264.exe: (reported by --version)
x264 0.76.1271M 496d79d
built by techouse on Sep 25 2009, gcc: 4.4.1 (x86.core2.Komisar)
Downloaded from http://x264.tk

Tried H264.exe on Pass-1 from commandline. When I removed "--progress" option it complained of "--no-psnr" option, then when that removed, the "--no-ssim" option.

Should I use some other version or variant of H264.exe? Or does AvsP need updating to reflect new version of H264?
espy2 is offline   Reply With Quote
Old 26th September 2009, 19:31   #212  |  Link
Zarxrax
Registered User
 
Join Date: Dec 2001
Posts: 1,219
AvsP's support for x264 is outdated.
Zarxrax is offline   Reply With Quote
Old 15th October 2009, 08:22   #213  |  Link
canuckerfan
Registered User
 
Join Date: Jul 2005
Posts: 317
Quote:
Originally Posted by Gavino View Post
Does this happen every time you use ConditionalReader/ConditionalFilter or does it depend on some additional factors such as for example
- length of input clip?
- size of file read by ConditionalReader?
- other filters used in script?
- number of tabs open in AvsP?

If you can reproduce the problem with a simple script and ConditionalReader input file, post it here.
Okay. I finally got the chance to test this and it has occured.

-clip length = 266124 frames (a little over 3 hours)
-size of file read was 52 bytes (it had to process only 2 frames)
-no other filters used (except crop): actually, here's the entire script:
Quote:
SetMemoryMax(768)

avisource("G:\Hindi Movies\Temp\DCH_ELITE\step26b.avi")

AddBorders(0,2,0,2)
Filtered = RemoveNoiseMC(rdlimit=41,rgrain=1,denoise=0,sharp=true)
ConditionalFilter(Filtered, last, "ABC1")
ConditionalReader("failed3-rd41.txt","ABC1",false)
Crop(0,2,0,-2)## 2 frames processed in this pass
-only 1 tab open (the one encoded)
canuckerfan is offline   Reply With Quote
Old 25th January 2010, 01:21   #214  |  Link
blazerqb11
Registered User
 
Join Date: Jul 2008
Posts: 64
I hope this is the right place to make a suggestion for the program. I was just dealing with a situation where I had to change a lot of file paths in avs scripts, and it made me wish AvsP had an option to replace a string in all open tabs instead of just the current tab. Any chance that could be implemented?
blazerqb11 is offline   Reply With Quote
Old 25th January 2010, 03:11   #215  |  Link
AlanHK
Registered User
 
Join Date: May 2006
Posts: 237
Quote:
Originally Posted by blazerqb11 View Post
Any chance that could be implemented?
See the changelog at http://avisynth.org/qwerpoi/index.html
qwerpoi hasn't posted here or issued any updates for over 2 years, so it seems the project is dormant.

Last edited by AlanHK; 25th January 2010 at 03:15.
AlanHK is offline   Reply With Quote
Old 31st January 2010, 18:56   #216  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 407
Version 2.0.2.1 for Windows 7

Since AvsP V2.0.2 would not run on my system with Windows 7, I recompiled it with Python 2.5.4 etc.

I called this build V2.0.2.1. It has no functional enhancements, it just works under (my) Windows 7.

Suggestions where this release can be published are welcome!

Sorry - I have no clue about Python or the functionality of AvsP. So please don't bother to ask me for enhancements.

It is not too complicated to get it running however. Just follow qwerpoi's doc: install Python (v2.5!), wxPython, Py2Exe and upx - that's all.
martin53 is offline   Reply With Quote
Old 1st February 2010, 14:38   #217  |  Link
Floatingshed
Registered User
 
Join Date: Nov 2008
Posts: 324
I wonder if someone could tell me how to customise AvsP to select a source filter determined by the file extension.
e.g. I would like to open an ac3 file with nicac3source but AvsP always defaults to opening ac3 with directshowsource.
Thanks.
Floatingshed is offline   Reply With Quote
Old 1st February 2010, 21:05   #218  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 407
My standard .AVS file looks like this:
Code:
function GetScriptBasename() {
    Try { assert(false) }
    Catch(err_msg) {
        err_msg = MidStr(err_msg, FindStr(err_msg, "(") + 1)
        filename = LeftStr(err_msg, StrLen(err_msg) - FindStr(RevStr(err_msg), ",") - 4)
        return filename
    }
}
ProcessTemplate1(GetScriptBasename()+"")
This automatically determins the base name of the script. You guess right: the script base name is identical to the media file name that I want to open.
In the plugin directory, there is a file _myFunctions.avsi, containing the function ProcessTemplate1() besides other functions.

My ProcessTemplate1() itself is quite long. This is a stripped down essence:
Code:
function ProcessTemplate1(string name) {
    function GetClip(string name) {
        … …
        Exist (name+".avi") ? AVISource(name+".avi") : last
        Exist (name) ? DirectShowSource(name) : last
    }
    GetClip(name)
    … …
}
You see that GetClip() tries to append various extensions to the base name of the script to find the file. As the last try, it just takes the base name itself. Remember that you can call the script myMovie.wmv.avs, so it would just open myMovie.wmv with DirectShowSource(). However, myMovie.avs would open myMovie.avi with AviSource()...

Last edited by martin53; 2nd February 2010 at 15:28.
martin53 is offline   Reply With Quote
Old 6th February 2010, 17:39   #219  |  Link
ANGEL_SU
Registered User
 
Join Date: May 2007
Posts: 109
Quote:
Originally Posted by Floatingshed View Post
I wonder if someone could tell me how to customise AvsP to select a source filter determined by the file extension.
e.g. I would like to open an ac3 file with nicac3source but AvsP always defaults to opening ac3 with directshowsource.
Thanks.
click Options->Extensin templates...
ANGEL_SU is offline   Reply With Quote
Old 12th February 2010, 18:39   #220  |  Link
Zarxrax
Registered User
 
Join Date: Dec 2001
Posts: 1,219
Quote:
Originally Posted by martin53 View Post
Since AvsP V2.0.2 would not run on my system with Windows 7, I recompiled it with Python 2.5.4 etc.

I called this build V2.0.2.1. It has no functional enhancements, it just works under (my) Windows 7.

Suggestions where this release can be published are welcome!
There are a number of free file sharing sites you could upload it to. Megaupload, rapidshare, easyshare, zshare...
Zarxrax is offline   Reply With Quote
Reply

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 21:43.


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