mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-10 21:42:37 +08:00
removed additional code in video_types
This commit is contained in:
parent
42a265cddf
commit
ab01aceaa2
@ -107,8 +107,7 @@ class VideoFromFile(VideoInput):
|
||||
(s for s in container.streams if s.type == "video"), None
|
||||
)
|
||||
if video_stream and video_stream.frames and video_stream.average_rate:
|
||||
length = float(video_stream.frames / video_stream.average_rate)
|
||||
return length
|
||||
return float(video_stream.frames / video_stream.average_rate)
|
||||
|
||||
# Last resort: decode frames to count them
|
||||
if video_stream and video_stream.average_rate:
|
||||
@ -118,8 +117,7 @@ class VideoFromFile(VideoInput):
|
||||
for _ in packet.decode():
|
||||
frame_count += 1
|
||||
if frame_count > 0:
|
||||
length = float(frame_count / video_stream.average_rate)
|
||||
return length
|
||||
return float(frame_count / video_stream.average_rate)
|
||||
|
||||
raise ValueError(f"Could not determine duration for file '{self.__file}'")
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user