ManimCommunity / ManimCommunity/manim

InvalidDataError: [Errno 1094995529] Invalid data found when processing input

Open
#4,216 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

## Description of bug / unexpected behavior
When I try to render a clip, the error
```
InvalidDataError: [Errno 1094995529] Invalid data found when processing input:
'/home/username/manim-test/media/videos/main/2160p60/partial_movie_files/DefaultTemplate/partial_movie_file_list.txt'
```
pops up.

## Expected behavior
The video should have been properly rendered.

## How to reproduce the issue

Code for reproducing the problem

```py
from manim import *
class DefaultTemplate(Scene):
def construct(self):
circle = Circle() # create a circle
circle.set_fill(PINK, opacity=0.5) # set color and transparency

square = Square() # create a square
square.flip(RIGHT) # flip horizontally
square.rotate(-3 * TAU / 8) # rotate a certain amount

self.play(Create(square)) # animate the creation of the square
self.play(Transform(square, circle)) # interpolate the square into the circle
self.play(FadeOut(square)) # fade out animation

# This is the code produced by the "manim init project" command. I did not change even a letter.
```

## Additional media files

Images/GIFs

Manim bumps into the error and no media files were produced.

## Logs
Terminal output

```
Manim Community v0.19.0

[04/08/25 05:05:03] DEBUG Hashing ... hashing.py:352
DEBUG Hashing done in 0.002818 s. hashing.py:364
DEBUG Hash generated : 2175060528_3901458704_223132457 hashing.py:367
DEBUG List of the first few animation hashes of the scene: ['2175060528_3901458704_223132457'] cairo_renderer.py:98
[04/08/25 05:05:06] INFO Animation 0 : Partial movie file written in scene_file_writer.py:588
'/home/username/manim-test/media/videos/main/2160p60/partial_movie_files/DefaultTemplate/217506
0528_3901458704_223132457.mp4'
DEBUG Hashing ... hashing.py:352
DEBUG Hashing done in 0.004091 s. hashing.py:364
DEBUG Hash generated : 1958024790_3900508965_557880437 hashing.py:367
DEBUG List of the first few animation hashes of the scene: ['2175060528_3901458704_223132457', cairo_renderer.py:98
'1958024790_3900508965_557880437']
[04/08/25 05:05:09] INFO Animation 1 : Partial movie file written in scene_file_writer.py:588
'/home/username/manim-test/media/videos/main/2160p60/partial_movie_files/DefaultTemplate/195802
4790_3900508965_557880437.mp4'
DEBUG Hashing ... hashing.py:352
DEBUG Hashing done in 0.005420 s. hashing.py:364
DEBUG Hash generated : 1958024790_2956010123_557880437 hashing.py:367
DEBUG List of the first few animation hashes of the scene: ['2175060528_3901458704_223132457', cairo_renderer.py:98
'1958024790_3900508965_557880437', '1958024790_2956010123_557880437']
[04/08/25 05:05:12] INFO Animation 2 : Partial movie file written in scene_file_writer.py:588
'/home/username/manim-test/media/videos/main/2160p60/partial_movie_files/DefaultTemplate/195802
4790_2956010123_557880437.mp4'
INFO Combining to Movie file. scene_file_writer.py:739
DEBUG Partial movie files to combine (3 files): scene_file_writer.py:622
['/home/username/manim-test/media/videos/main/2160p60/partial_movie_files/DefaultTemplate/21750
60528_3901458704_223132457.mp4',
'/home/username/manim-test/media/videos/main/2160p60/partial_movie_files/DefaultTemplate/195802
4790_3900508965_557880437.mp4',
'/home/username/manim-test/media/videos/main/2160p60/partial_movie_files/DefaultTemplate/195802
4790_2956010123_557880437.mp4']
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /usr/lib/python3.13/site-packages/manim/cli/render/commands.py:125 in render │
│ │
│ 122 │ │ │ try: │
│ 123 │ │ │ │ with tempconfig({}): │
│ 124 │ │ │ │ │ scene = SceneClass() │
│ ❱ 125 │ │ │ │ │ scene.render() │
│ 126 │ │ │ except Exception: │
│ 127 │ │ │ │ error_console.print_exception() │
│ 128 │ │ │ │ sys.exit(1) │
│ │
│ /usr/lib/python3.13/site-packages/manim/scene/scene.py:247 in render │
│ │
│ 244 │ │ │ return True │
│ 245 │ │ self.tear_down() │
│ 246 │ │ # We have to reset these settings in case of multiple renders. │
│ ❱ 247 │ │ self.renderer.scene_finished(self) │
│ 248 │ │ │
│ 249 │ │ # Show info only if animations are rendered or to get image │
│ 250 │ │ if ( │
│ │
│ /usr/lib/python3.13/site-packages/manim/renderer/cairo_renderer.py:269 in scene_finished │
│ │
│ 266 │ def scene_finished(self, scene): │
│ 267 │ │ # If no animations in scene, render an image instead │
│ 268 │ │ if self.num_plays: │
│ ❱ 269 │ │ │ self.file_writer.finish() │
│ 270 │ │ elif config.write_to_movie: │
│ 271 │ │ │ config.save_last_frame = True │
│ 272 │ │ │ config.write_to_movie = False │
│ │
│ /usr/lib/python3.13/site-packages/manim/scene/scene_file_writer.py:514 in finish │
│ │
│ 511 │ │ frame in the default image directory. │
│ 512 │ │ """ │
│ 513 │ │ if write_to_movie(): │
│ ❱ 514 │ │ │ self.combine_to_movie() │
│ 515 │ │ │ if config.save_sections: │
│ 516 │ │ │ │ self.combine_to_section_videos() │
│ 517 │ │ │ if config["flush_cache"]: │
│ │
│ /usr/lib/python3.13/site-packages/manim/scene/scene_file_writer.py:740 in combine_to_movie │
│ │
│ 737 │ │ │ return │
│ 738 │ │ │
│ 739 │ │ logger.info("Combining to Movie file.") │
│ ❱ 740 │ │ self.combine_files( │
│ 741 │ │ │ partial_movie_files, │
│ 742 │ │ │ movie_file_path, │
│ 743 │ │ │ is_gif_format(), │
│ │
│ /usr/lib/python3.13/site-packages/manim/scene/scene_file_writer.py:639 in combine_files │
│ │
│ 636 │ │ if not includes_sound: │
│ 637 │ │ │ av_options["an"] = "1" │
│ 638 │ │ │
│ ❱ 639 │ │ partial_movies_input = av.open( │
│ 640 │ │ │ str(file_list), options=av_options, format="concat" │
│ 641 │ │ ) │
│ 642 │ │ partial_movies_stream = partial_movies_input.streams.video[0] │
│ │
│ in av.container.core.open:418 │
│ │
│ in av.container.core.Container.__cinit__:283 │
│ │
│ in av.container.core.Container.err_check:303 │
│ │
│ in av.error.err_check:424 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
InvalidDataError: [Errno 1094995529] Invalid data found when processing input:
'/home/username/manim-test/media/videos/main/2160p60/partial_movie_files/DefaultTemplate/partial_movie_file_list.txt'

```

## System specifications

System Details

- OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)): Manjaro Linux (Kernel: 6.12.20-2-MANJARO)
- RAM: 16GB
- Python version (`python/py/python3 --version`): Python 3.13.2
- Installed modules (provide output from `pip list`):
```
Package Version
----------------------------- -----------
alabaster 1.0.0
application-utility 1.4.0
argcomplete 3.5.3
asttokens 3.0.0
attrs 23.2.1.dev0
audioop-lts 0.2.1
autocommand 2.2.2
av 14.3.0
Babel 2.15.0
backports.cached-property 1.0.2
beautifulsoup4 4.12.3
btrfsutil 6.13
build 1.2.2
cffi 1.17.1
chardet 5.2.0
charset-normalizer 3.4.1
click 8.1.8
cloup 3.0.7
colour 0.1.5
contourpy 1.3.1
coverage 7.6.12
cryptography 44.0.2
cupshelpers 1.0
cycler 0.12.1
Cython 3.0.12
dbus-python 1.4.0
decorator 5.1.1
distlib 0.3.9
distro 1.9.0
dlib 19.24.8
docopt 0.6.2
docutils 0.21.2
executing 2.2.0
face_recognition 1.3.0
face_recognition_models 0.3.0
fastjsonschema 2.21.1
filelock 3.18.0
fonttools 4.56.0
glcontext 3.0.0
gmpy2 2.2.1
gufw 24.4.0
idna 3.10
imagesize 1.4.1
importlib_metadata 7.2.1
iniconfig 2.0.0
installer 0.7.0
ipython 9.0.2
ipython_pygments_lexers 1.1.1
isosurfaces 0.1.2
jaraco.collections 5.1.0
jaraco.context 6.0.1
jaraco.functools 4.1.0
jaraco.text 4.0.0
jedi 0.19.2
Jinja2 3.1.5
keyutils 0.6
kiwisolver 1.4.5
lark 1.2.2
lensfun 0.3.4
manim 0.19.0
manimgl 1.7.1
ManimPango 0.6.0
mapbox_earcut 1.0.3
markdown-it-py 3.0.0
MarkupSafe 2.1.5
matplotlib 3.10.1
matplotlib-inline 0.1.7
mdurl 0.1.2
meson 1.7.0
moderngl 5.12.0
moderngl-window 3.1.1
more-itertools 10.6.0
mpmath 1.3.0
multipledispatch 1.0.0
netsnmp-python 1.0a1
networkx 3.4.2
nftables 0.1
npyscreen 4.10.5
numpy 2.2.4
OpenCC 1.1.8
packaging 24.2
pacman_mirrors 4.27
pandas 2.2.3
parso 0.8.4
pathspec 0.12.1
pexpect 4.9.0
pillow 11.1.0
pip 25.0.1
pipx 1.7.1
platformdirs 4.3.6
pluggy 1.5.0
poetry-core 2.1.1
pooch 1.8.2
prompt_toolkit 3.0.50
psutil 7.0.0
ptyprocess 0.7.0
pure_eval 0.2.3
pybind11 2.13.6
pycairo 1.27.0
pycparser 2.22
pycups 2.0.4
pydub 0.25.1
pyglet 2.1.3
PyGLM 2.7.1
Pygments 2.19.1
PyGObject 3.52.3
PyOpenGL 3.1.7
pyparsing 3.2.1
pyperclip 1.9.0
pyproject_hooks 1.2.0
PyQt5 5.15.11
PyQt5_sip 12.17.0
pyrr 0.10.3
pysmbc 1.0.25.1
pytest 8.3.5
pytest-cov 6.0.0
python-dateutil 2.9.0
pytz 2025.1
PyWavefront 1.3.3
PyYAML 6.0.2
reportlab 4.2.2
requests 2.32.3
rich 13.9.4
roman-numerals-py 3.1.0
scikit_build_core 0.11.1
scipy 1.15.2
screeninfo 0.8.1
setuptools 75.8.0
setuptools-scm 8.2.1
six 1.17.0
skia-pathops 0.8.0.post2
smbus 1.1
snowballstemmer 2.2.0
soupsieve 2.6
Sphinx 8.2.3
sphinxcontrib-applehelp 2.0.0
sphinxcontrib-devhelp 2.0.0
sphinxcontrib-htmlhelp 2.1.0
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 2.0.0
sphinxcontrib-serializinghtml 2.0.0
srt 3.5.3
stack_data 0.6.3
svgelements 1.9.6
sympy 1.13.3
TBB 0.2
tqdm 4.67.1
traitlets 5.14.3
trimesh 4.6.6
typing_extensions 4.12.2
udiskie 2.5.7
ufw 0.36.2
urllib3 2.3.0
userpath 1.9.2
validators 0.20.0
virtualenv 20.28.0
watchdog 6.0.0
wcwidth 0.2.13
wheel 0.45.1
zipp 3.21.0

```

LaTeX details

No LaTeX thing involved.

## Additional comments

It seems to be an issue related to ffmpeg for 1094995529 is one of its error code indicating "Invalid data found when processing input". I tried rto search `manim InvalidDataError: [Errno 1094995529] Invalid data found when processing input: '/home/username/manim-test/media/videos/main/2160p60/partial_movie_files/DefaultTemplate/partial_movie_file_list.txt'` and got [this article](https://www.bytezonex.com/archives/Gh4GDAly.html). In the article there is the code:
```py
import os

def check_files(file_list_path):
"""检查 partial_movie_file_list.txt 中列出的文件是否存在。""" # This sentence means that "Checking if the files listed in "partial_movie_file_list.txt" are available."
with open(file_list_path, 'r') as f:
for line in f:
if line.startswith("file"):
file_path = line.split("'")[1]

# 获取文件绝对路径 This sentence means that "Trying to get the absolute path of the file."
abs_path = os.path.join(os.path.dirname(file_list_path),file_path)
if not os.path.exists(abs_path):
print(f"错误:文件 {abs_path} 不存在!") # This sentence means that "Error: file {abs_path} does not exist!"
return False
print("所有文件检查完毕,均存在。") # This sentence means that "All files are available."
return True

# 假设 partial_movie_file_list.txt 在当前目录下
file_list_path = "media/videos/your_scene_name/1080p60/partial_movie_files/partial_movie_file_list.txt" # 替换为你的实际路径 This sentence means that "Replace with the actual location of your file"
check_files(file_list_path)
```
By running this code I got wrong output `错误:文件 /home/zykerman/manim-test/media/videos/main/2160p60/partial_movie_files/DefaultTemplate/file:/home/zykerman/manim-test/media/videos/main/2160p60/partial_movie_files/DefaultTemplate/2175060528_3901458704_223132457.mp4 不存在!` and by removing all the `file:` in the `partial_movie_file_list.txt`, the output was telling me that all files are available. But it is still wired though...... on my Windows PC everything goes as expected (no error occurred), and that there are also `file:` in the `partial_movie_file_list.txt`.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the default project render from the issue and inspect scene_file_writer.py, especially combine_to_movie(), combine_files(), and the av.open call shown in the traceback. Check the three partial movie files and their list during combination. Done means the provided scene renders successfully into a video without InvalidDataError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.