@@ -170,8 +170,6 @@ def media_length(self) -> int:
170
170
# If there's no audio, get length in video metadata.
171
171
import av
172
172
173
- av .logging .set_level (av .logging .PANIC )
174
-
175
173
with av .open (f"{ self .src .path } " ) as cn :
176
174
if len (cn .streams .video ) < 1 :
177
175
self .log .error ("Could not get media duration" )
@@ -227,11 +225,7 @@ def cache(self, tag: str, obj: dict[str, Any], arr: np.ndarray) -> np.ndarray:
227
225
except Exception :
228
226
json_object = {}
229
227
230
- entry = {
231
- "type" : str (arr .dtype ),
232
- "arr" : arr .tolist (),
233
- }
234
-
228
+ entry = {"type" : str (arr .dtype ), "arr" : arr .tolist ()}
235
229
src_key = f"{ self .src .path } "
236
230
237
231
if src_key in json_object :
@@ -344,13 +338,10 @@ def cleanhtml(raw_html: str) -> str:
344
338
def motion (self , s : int , blur : int , width : int ) -> NDArray [np .float64 ]:
345
339
import av
346
340
347
- av .logging .set_level (av .logging .PANIC )
348
-
349
- mobj = {"stream" : s , "width" : width , "blur" : blur }
350
-
351
341
if s >= len (self .src .videos ):
352
342
raise LevelError (f"motion: video stream '{ s } ' does not exist." )
353
343
344
+ mobj = {"stream" : s , "width" : width , "blur" : blur }
354
345
if (arr := self .read_cache ("motion" , mobj )) is not None :
355
346
return arr
356
347
0 commit comments