manim-slides icon indicating copy to clipboard operation
manim-slides copied to clipboard

[BUG] PowerPoint: Cannot Play Media

Open jeertmans opened this issue 1 year ago • 7 comments

TLDR: checkout https://github.com/jeertmans/manim-slides/issues/392#issuecomment-2368198106 for a potential fix.


Description

After playing a few slides correctly, it looks like some media starts to bug / glitch / or just do not play.

One example is my EuCAP 2024 slides. Here, it starts to glitch on slide 30 (see screenshot below).

If you hide the slides before slide 30, or just start presenting on slide 30, the next slides display correctly. The bug does not seem to be caused by the use of PyAV or notes (relevant changes from since year), but rather because it seems to load all slides into memory, and it somehow takes too much space (?) at some point.

Slides with issue: https://github.com/jeertmans/jeertmans.github.io/blob/677c519d1867fa87720eee25821692465a3ba47c/assets/slides/2024-03-18-eucap-presentation.pptx

Lowered quality from full HD to HD, and this seems to have fixed the slides: https://github.com/jeertmans/jeertmans.github.io/blob/3fe208cbed7a44974a077423931cc37948f9fbe6/assets/slides/2024-03-18-eucap-presentation.pptx

This fix is not very nice because:

  1. I don't know if it works every time (e.g., on very large presentations I might need to lower the quality even more);
  2. Lowering the quality is not super nice.

Version

v5.1.3

Platform

Windows

Screenshots

image

Additional information

No response

jeertmans avatar Mar 17 '24 22:03 jeertmans

I have reported this issue to Microsoft: https://answers.microsoft.com/en-us/msoffice/forum/all/powerpoint-too-many-media-cause-a-cannot-play/36a06d53-c564-4735-902f-53d333d7f73f.

jeertmans avatar Mar 17 '24 22:03 jeertmans

I encountered a similar issue when changing the device from having 16 GB of RAM to 8 GB. It didn't freeze but skips some animations and refuses to show others.

rwydaegh avatar Jun 24 '24 16:06 rwydaegh

Hi, I had the issue on several computer and disabling Power Point Hardware/GPU accelaration in presentation mode (as advised here ) did solve the issue.

Also, I never had the issue on my personal laptop but it does not have a GPU.

Azercoco avatar Sep 23 '24 13:09 Azercoco

This also fixes the issue for me, thanks. This fix could be mentioned in the Readme file, but it certainly not ideal because when the presenters delivers the presentation on a different laptop (e.g. at a conference as I had), he/she should be remember to turn this setting on before the presentation and off afterwards.

rwydaegh avatar Sep 23 '24 15:09 rwydaegh

Hi, I had the issue on several computer and disabling Power Point Hardware/GPU accelaration in presentation mode (as advised here ) did solve the issue.

Also, I never had the issue on my personal laptop but it does not have a GPU.

Good to know, thanks @Azercoco! Is it a real fix, or does it just postpone the issue to even larger presentations, as we usually have more standard RAM available than on GPUs? Also, when I did my tests, it appeared it was my usual RAM that was getting filled, not the one from my GPU.

The best would be to test your suggested fix on a very large number of media, and see if it still holds.

Anyway, I think it is worth being documented somewhere in Manim Slides’ docs!

jeertmans avatar Sep 23 '24 15:09 jeertmans

Good to know, thanks @Azercoco! Is it a real fix, or does it just postpone the issue to even larger presentations, as we usually have more standard RAM available than on GPUs?

I don't really know. My presentation worked fine for a total of 4 min of animation in full HD on 16GB of RAM.

Azercoco avatar Sep 23 '24 20:09 Azercoco

So I have tested locally, with the below script, and while it seems that PowerPoint keeps using more and more RAM, at least it does not break when it reaches the limit of available RAM, and still manages to play the animations correctly. I could both play all slides in HD and 4K on my computer. The 4K presentation eats all my RAM, but still plays fine.

#475 added some notes about this in the FAQ.

import random

from manim import *

from manim_slides import Slide


class Test(Slide):
    def construct(self):
        circle = Dot(radius=1, color=BLUE)
        slide_number = Integer(0, mob_class=Text).to_corner(DL)
        self.add(circle)
        self.add(slide_number)

        random.seed(1234)

        for i in range(100):
            self.next_slide()
            radius = random.random() + 0.5
            scale = radius / circle.radius
            color = ManimColor.from_rgb(
                (random.random(), random.random(), random.random())
            )
            slide_number.set_value(i + 1)
            self.play(circle.animate.scale(scale).set_color(color))

jeertmans avatar Sep 25 '24 08:09 jeertmans