Skip to content

Commit

Permalink
Merge pull request #2311 from asd55667/master
Browse files Browse the repository at this point in the history
chore: skip metadata which not satisfied with "key:value"
  • Loading branch information
OsaAjani authored Jan 10, 2025
2 parents d2d3cc4 + f38749e commit ae03e74
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions moviepy/video/io/ffmpeg_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,8 +778,12 @@ def parse_metadata_field_value(
"""Returns a tuple with a metadata field-value pair given a ffmpeg `-i`
command output line.
"""
raw_field, raw_value = line.split(":", 1)
return (raw_field.strip(" "), raw_value.strip(" "))
info = line.split(":", 1)
if len(info) == 2:
raw_field, raw_value = info
return (raw_field.strip(" "), raw_value.strip(" "))
else:
return ("", "")

def video_metadata_type_casting(self, field, value):
"""Cast needed video metadata fields to other types than the default str."""
Expand Down

0 comments on commit ae03e74

Please sign in to comment.