3b1b / manim

Animation engine for explanatory math videos
MIT License
67.99k stars 6.07k forks source link

Running manim via Docker can't find output directory #159

Closed zimmermant closed 5 years ago

zimmermant commented 6 years ago

I've successfully installed docker to run manim but I get the following error message.

$docker run --rm -v "$PWD/files":/app/files manim example_scenes.py WarpSquare
Traceback (most recent call last):
  File "extract_scene.py", line 14, in <module>
    from helpers import *
  File "/app/helpers.py", line 13, in <module>
    from constants import *
  File "/app/constants.py", line 91, in <module>
    """)
Exception:
        Redefine MEDIA_DIR in constants.py to point to
        a valid directory where movies and images will
        be written

I did change the MEDIA_DIR directory in constants.py to a folder that exists and I've even run os.path.exists(MEDIA_DIR) in separate Python file and it does return True.

Uplink03 commented 6 years ago

I've worked around this issue like below because I couldn't be brought to changing one line of code and waiting for another image build:

mkdir out
docker run --rm -v `pwd`/files:/app/files -v `pwd`/out:"/root/Dropbox (3Blue1Brown)/3Blue1Brown Team Folder" manim example_scenes.py WarpSquare

Now it has this to say:

Writing to /root/Dropbox (3Blue1Brown)/3Blue1Brown Team Folder/animations/example_scenes/1080p60/WarpSquareTemp.mp4
Animation 0: ApplyPointwiseFunctionSquareToSquare: 100%|████████████████████████████████████████████████████████████████████| 180/180 [00:04<00:00, 39.91it/s]
Played a total of 1 animations
sh: 1: play: not found

and the video is a 4 second long black screen. You'll find it in ./out/animations/example_scenes/1080p60/WarpSquareTemp.mp4

fusir commented 6 years ago

The black screen problem when running with docker seems to be common. It looks like the PNGs don't get generated correctly. I've tested the ffmpeg with a video transcode and it works. I've also manually built the docker image with a debian base and the issue persists.

See https://github.com/3b1b/manim/issues/170 https://github.com/3b1b/manim/issues/119

Edit: nvm, the pngs are outputting. I based that on what someone else was saying. The ffmpeg in docker must not like being streamed pngs.

ishandutta2007 commented 6 years ago

It still says Writing to /app/example_scenes/1440p60/WarpSquareTemp.mp4

ishandutta2007@MacBook-Pro:~/Documents/Projects/manim$ mkdir out

mkdir: out: File exists

ishandutta2007@MacBook-Pro:~/Documents/Projects/manim$ docker run --rm -v `pwd`/files:/app/files -v `pwd`/out:"/root/Dropbox (3Blue1Brown)/3Blue1Brown Team Folder" manim example_scenes.py WarpSquare

Animation 0: ApplyPointwiseFunctionSquareToSquare: 100%|##########| 180/180 [00:16<00:00, 10.77it/s] sh: 1: play: not found Writing to /app/example_scenes/1440p60/WarpSquareTemp.mp4 Played a total of 1 animations

ishandutta2007@MacBook-Pro:~/Documents/Projects/manim$ ls out
ishandutta2007@MacBook-Pro:~/Documents/Projects/manim$ 
eulertour commented 5 years ago

Closing, as this issue is addressed in #296.