MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / count_frames

Function count_frames

examples/WanVSR/infer_flashvsr_tiny_long_video.py:131–142  ·  view source on GitHub ↗
(r)

Source from the content-addressed store, hash-verified

129 fps = int(round(fps_val)) if isinstance(fps_val, (int, float)) else 30
130
131 def count_frames(r):
132 try:
133 nf = meta.get('nframes', None)
134 if isinstance(nf,int) and nf>0: return nf
135 except Exception: pass
136 try: return r.count_frames()
137 except Exception:
138 n=0
139 try:
140 while True: r.get_data(n); n+=1
141 except Exception:
142 return n
143
144 total = count_frames(rdr)
145 if total <= 0:

Callers 1

prepare_input_tensorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected