#2390·moviepy

TypeError in ffmpeg_reader.py: Metadata concatenation fails when field value is a float

Author: melyuxCreated Mar 8, 2025Updated May 23, 2026
Labelsbuglib-FFmpeg

Expected Behavior

MoviePy should correctly parse and concatenate metadata fields from ffmpeg output by converting all values to strings when necessary. Even if a metadata value is numeric, it should be handled gracefully without throwing an error.

Changing this line in ffmpeg_reader.py from this:

python
value = self._current_stream["metadata"][field] + "\n" + value

to this:

python
value = str(self._current_stream["metadata"][field]) + "\n" + value

seems to solve the issue.

Actual Behavior

When parsing metadata from a video file, MoviePy raises a TypeError because it attempts to concatenate a float (e.g., 3.088510 from com.apple.quicktime.location.accuracy.horizontal) with a string. The error message is:

TypeError: unsupported operand type(s) for +: 'float' and 'str'

Steps and code to Reproduce the Problem

  1. Use a video file (for example, a .mov file) that includes metadata fields with numeric values.
  2. Run the following code:
python
from moviepy.editor import VideoFileClip

path = "/path/to/your/video/IMG_2056.mov"
video = VideoFileClip(path)
  1. The script will fail during metadata parsing with the above TypeError.

Used medias

I'd rather not put it here, can send privately

Specifications

  • Python Version: 3.11
  • MoviePy Version: latest master (as of 3/8/25)
  • Platform Name: macOS
  • Platform Version: latest