add check for the format arg type in VideoFromComponents.save_to function (#11046)

* add check for the format var type in VideoFromComponents.save_to function

* convert "format" to VideoContainer enum
This commit is contained in:
Alexander Piskun
2025-12-02 21:50:13 +02:00
committed by GitHub
parent 44baa0b7f3
commit 33d6aec3b7
2 changed files with 3 additions and 3 deletions

View File

@@ -337,7 +337,7 @@ class VideoFromComponents(VideoInput):
if codec != VideoCodec.AUTO and codec != VideoCodec.H264:
raise ValueError("Only H264 codec is supported for now")
extra_kwargs = {}
if format != VideoContainer.AUTO:
if isinstance(format, VideoContainer) and format != VideoContainer.AUTO:
extra_kwargs["format"] = format.value
with av.open(path, mode='w', options={'movflags': 'use_metadata_tags'}, **extra_kwargs) as output:
# Add metadata before writing any streams