Skip to content

[scene caching] partial movie file not found #472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
behackl opened this issue Sep 23, 2020 · 10 comments · Fixed by #489
Closed

[scene caching] partial movie file not found #472

behackl opened this issue Sep 23, 2020 · 10 comments · Fixed by #489
Labels
pr:bugfix Bug fix for use in PRs solving a specific issue:bug

Comments

@behackl
Copy link
Member

behackl commented Sep 23, 2020

Here is another scene caching error: running the code

from manim import *


class TestZoom1(ZoomedScene):
        CONFIG = {
            "zoomed_camera_frame_starting_position": [0, 0, 0],
            "zoomed_display_corner": [0, 0, 0],
            "zoomed_display_height": config['frame_height'],
            "zoomed_display_width": config['frame_width'],
            "zoom_factor": 0.1,
        }
        def construct(self):
            self.activate_zooming(animate=True)
            d = Dot()
            self.add(d)

(one of our examples from the documentation) twice raises the following error:

[behackl@atreus playground]$ manim test.py TestZoom1 -m
[09/23/20 14:38:04] INFO     Animation 0 : Partial movie file written in {'/home/behackl/Dokumente/git/etc/manim/playground/media/videos/test/720p30/partial_movie_files/TestZoom1/2818502609_1974117047_3316235269.mp4'}                       scene_file_writer.py:463
[09/23/20 14:38:05] INFO     Animation 1 : Partial movie file written in {'/home/behackl/Dokumente/git/etc/manim/playground/media/videos/test/720p30/partial_movie_files/TestZoom1/1160423895_881011468_1267139589.mp4'}                        scene_file_writer.py:463
                    INFO                                                                                                                                                                                                                        scene_file_writer.py:635
                             File ready at /home/behackl/Dokumente/git/etc/manim/playground/media/videos/test/720p30/TestZoom1.mp4                                                                                                                                      
                                                                                                                                                                                                                                                                        
                    INFO     Rendered TestZoom1                                                                                                                                                                                                             scene.py:129
                             Played 2 animations                                                                                                                                                                                                                        
[behackl@atreus playground]$ manim test.py TestZoom1 -m
[09/23/20 14:38:07] INFO     Animation 0 : Using cached data (hash : 2818502609_1974117047_3316235269)                                                                                                                                                      scene.py:823
[09/23/20 14:38:08] INFO     Animation 1 : Partial movie file written in {'/home/behackl/Dokumente/git/etc/manim/playground/media/videos/test/720p30/partial_movie_files/TestZoom1/2818502609_1974117047_3316235269.mp4'}                       scene_file_writer.py:463
[concat @ 0x564241a313c0] Impossible to open 'file:/home/behackl/Dokumente/git/etc/manim/playground/media/videos/test/720p30/partial_movie_files/TestZoom1/2796914319_881011468_1267139589.mp4'
/home/behackl/Dokumente/git/etc/manim/playground/media/videos/test/720p30/partial_movie_files/TestZoom1/partial_movie_file_list.txt: No such file or directory
                    INFO                                                                                                                                                                                                                        scene_file_writer.py:635
                             File ready at /home/behackl/Dokumente/git/etc/manim/playground/media/videos/test/720p30/TestZoom1.mp4                                                                                                                                      
                                                                                                                                                                                                                                                                        



Traceback (most recent call last):
  File "/home/behackl/Dokumente/git/etc/manim/manim/__main__.py", line 170, in main
    scene = SceneClass()
  File "/home/behackl/Dokumente/git/etc/manim/manim/scene/scene.py", line 93, in __init__
    self.file_writer.finish()
  File "/home/behackl/Dokumente/git/etc/manim/manim/scene/scene_file_writer.py", line 387, in finish
    self.combine_movie_files()
  File "/home/behackl/Dokumente/git/etc/manim/manim/scene/scene_file_writer.py", line 592, in combine_movie_files
    modify_atime(file_path)
  File "/home/behackl/Dokumente/git/etc/manim/manim/utils/file_ops.py", line 53, in modify_atime
    os.utime(file_path, times=(time.time(), os.path.getmtime(file_path)))
  File "/usr/lib/python3.8/genericpath.py", line 55, in getmtime
    return os.stat(filename).st_mtime
FileNotFoundError: [Errno 2] No such file or directory: '/home/behackl/Dokumente/git/etc/manim/playground/media/videos/test/720p30/partial_movie_files/TestZoom1/2796914319_881011468_1267139589.mp4'

(I've noticed this from running make html && make clean && make html from docs.)

@behackl behackl added the pr:bugfix Bug fix for use in PRs solving a specific issue:bug label Sep 23, 2020
@behackl
Copy link
Member Author

behackl commented Sep 23, 2020

CC @ManimCommunity/scene-caching

@cobordism
Copy link
Member

I can confirm this bug:
#460 (comment)

@huguesdevimeux
Copy link
Member

@behackl It's not a bug.
Your scene won't generate any video, as there is no scene.play or scene.wait invocation.
If you wonder why does it work sometimes, it's because manim opens a video file named with the name of the file containing the scene, no matter if the scene was supposed to produce something. So, what can happen is that manim takes an old generated video as it didn't get replaced by a new generated one.

Nevertheless, I think it should be change.

@behackl
Copy link
Member Author

behackl commented Sep 23, 2020

Your scene won't generate any video, as there is no scene.play or scene.wait invocation.

@huguesdevimeux self.activate_zooming(animate=True) seems to include a play call somewhere; the video included over at https://manimce.readthedocs.io/en/latest/examples/camera_settings.html is produced.

@huguesdevimeux
Copy link
Member

@behackl You're right. I will investigate.

PS : First time I see the documentation quoted as a reference. Although I didn't contribute to it, I feel very proud :D

@huguesdevimeux huguesdevimeux changed the title hash of partial movie file changes between recompilation [scene caching] partial movie file not found Sep 23, 2020
@huguesdevimeux
Copy link
Member

Just to let you know, I found a potential fix. I will PR a soon as I can :D

@behackl
Copy link
Member Author

behackl commented Sep 23, 2020

PS : First time I see the documentation quoted as a reference. Although I didn't contribute to it, I feel very proud :D

It is pretty cool, I do have to admit. Even though there is still lots of work to do, its fun to see how it slowly becomes more and more useful! :-)

Thanks for investigating, I will certainly have a look at whatever you come up with. 👍

@hugopy
Copy link

hugopy commented Sep 27, 2020

I second this, also having this bug.

@huguesdevimeux
Copy link
Member

This will take longer as I expected.
This issue hides two : One related to how partial movie files are handled when some animations are skipped (in particular, when the first one is skipped), and one more serious that is that the hash produced by the second play call of scene.activate_zooming is non-consistent for some reason.

Sooo, not sure when I will fix this. But if you need to run these kind of stuff, using --disable_caching should work fine.

@huguesdevimeux
Copy link
Member

should be fixed in #489

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:bugfix Bug fix for use in PRs solving a specific issue:bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants