View Single Post
Old 29th May 2014, 16:04   #18  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
This works quite nicely too, attaching the necessary knowledge to the clip's filtergraph.
Code:
function Open(string source, bool "trace") {
    trace = Default(trace, True)
    LWOpen(source)
    trace ? ScriptClip("""source = """" + source + """"
                          Subtitle(source + "\n" + String(current_frame), x=0, y=0, size=24, lsp=1)""", after_frame=true) : NOP()
}

c1 = Open("C:\Users\fvisagie\Videos\Home Videos\Camera Tapes\20140221 Kam'Bati\2014-02-22_11-20-24.mp4")
c2 = Open("C:\Users\fvisagie\Videos\Home Videos\Camera Tapes\20140221 Kam'Bati\2014-02-22_12-09-10.mp4")

c1.Trim(10, 20) ++ c2.Trim(30, 40)
ShowFrameNumber(x=Width()-60, y=20)
Whenever a clip's filtergraph is accessed, its ScriptClipt() code now knows the corresponding source file name and frame number .

For completeness, LWOpen() is
Code:
function LWOpen(string source, int "threads") {
    threads = Default(threads, 0)
    return(AudioDub(LWLibavVideoSource(source, threads=threads), LWLibavAudioSource(source)))
}

Last edited by fvisagie; 29th May 2014 at 17:27.
fvisagie is offline   Reply With Quote