mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-06 19:42:34 +08:00
Add null check for audio streams
This commit is contained in:
parent
4b37647ce1
commit
37c2a960cb
@ -243,8 +243,8 @@ class VideoFromFile(VideoInput):
|
|||||||
audio = None
|
audio = None
|
||||||
container.seek(start_pts, stream=video_stream)
|
container.seek(start_pts, stream=video_stream)
|
||||||
# Use last stream for consistency
|
# Use last stream for consistency
|
||||||
audio_stream = container.streams.audio[-1]
|
if len(container.streams.audio):
|
||||||
if audio_stream:
|
audio_stream = container.streams.audio[-1]
|
||||||
audio_frames = []
|
audio_frames = []
|
||||||
resample = av.audio.resampler.AudioResampler(format='fltp').resample
|
resample = av.audio.resampler.AudioResampler(format='fltp').resample
|
||||||
frames = itertools.chain.from_iterable(
|
frames = itertools.chain.from_iterable(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user