View Single Post
Old 27th July 2016, 12:58   #7  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
One idea is to either sense (don't know how to do this) or at least mark the start of each GOP
Perhaps of use
Code:
Loadplugin("ffms2.dll")
Import("ffms2.avsi")

SSS="""
    Global Glb_FrameType = FFPICT_TYPE                              # Maybe you want it somewhere else
    RT_DBaseSet(DB,current_frame,Glb_FrameType)
    RT_Subtitle("%d] %c",current_frame,Glb_FrameType)
    return last
"""

FN="big_buck_bunny_720p_h264.mov"
FFmpegSource2(FN)

DB = "Meyer.DB"
RT_DbaseAlloc(DB,Framecount,"i")      # FrameCount Records, Single field of type int, CAPS character code ie 'I'=73, 'P'=80, 'B'=66.

ScriptClip(SSS,after_frame=true)
EDIT: You can remove the DBase stuff if all you want is the Global, but using DB allows presetting of all DBase fields,
and then real run with access to current GOP start, previous and next GOP (via backward/forward scan of DB).

EDIT: By using another global and 2 additional int fields, could track previous I frame, and set 2nd field (field 1) to eg previous I frame,
and then set previous I frame's (field 2) next I frame to current frame (if that makes sense), in real run, allow access to prev and next I frame
numbers without scan backwards/forwards.
__________________
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; 27th July 2016 at 13:10.
StainlessS is offline   Reply With Quote