ManimCommunity / manim-voiceover

Manim plugin for all things voiceover
https://voiceover.manim.community/en/stable
MIT License
154 stars 20 forks source link

OpenGL #57

Open analytic-bias opened 1 year ago

analytic-bias commented 1 year ago

Description of bug / unexpected behavior

GTTR example rashes when using OpenGL with GUI.

Expected behavior

Work properly, perhaps at least without sound with GUI.

How to reproduce the issue

Code for reproducing the problem ```py from manim import * from manim_voiceover import VoiceoverScene from manim_voiceover.services.gtts import GTTSService class GTTSExample(VoiceoverScene): def construct(self): self.interactive_embed() self.set_speech_service(GTTSService(lang="en", tld="com")) circle = Circle() square = Square().shift(2 * RIGHT) with self.voiceover(text="This circle is drawn as I speak.") as tracker: self.play(Create(circle), run_time=tracker.duration) with self.voiceover(text="Let's shift it to the left 2 units.") as tracker: self.play(circle.animate.shift(2 * LEFT), run_time=tracker.duration) with self.voiceover(text="Now, let's transform it into a square.") as tracker: self.play(Transform(circle, square), run_time=tracker.duration) with self.voiceover(text="Thank you for watching."): self.play(Uncreate(circle)) self.wait() # Use GTTS with another language: class GTTSExampleVietnamese(VoiceoverScene): def construct(self): self.interactive_embed() # Set the lang argument to another language code. self.set_speech_service(GTTSService(lang="vi")) circle = Circle() square = Square().shift(2 * RIGHT) with self.voiceover(text="Vòng tròn này được vẽ khi tôi nói.") as tracker: self.play(Create(circle), run_time=tracker.duration) with self.voiceover(text="Hãy chuyển nó sang bên trái 2 đơn vị.") as tracker: self.play(circle.animate.shift(2 * LEFT), run_time=tracker.duration) with self.voiceover( text="Bây giờ hãy biến nó thành một hình vuông." ) as tracker: self.play(Transform(circle, square), run_time=tracker.duration) with self.voiceover(text="Cảm ơn vì đã xem."): self.play(Uncreate(circle)) self.wait() ```

Additional media files

Images/GIFs

Logs

Terminal output ```traceback $ manim -pql scene.py GTTSExample --renderer=opengl --enable_gui --disable_caching Manim Community v0.17.3 Python 3.11.2 (main, May 30 2023, 17:45:26) [GCC 12.2.0] Type 'copyright', 'credits' or 'license' for more information IPython 8.0.1 -- An enhanced Interactive Python. Type '?' for help. In [1]: ╭───────────────────── Traceback (most recent call last) ──────────────────────╮ │ /home/hypatia/.local/lib/python3.11/site-packages/manim/cli/render/commands. │ │ py:97 in render │ │ │ │ 94 │ │ │ │ for SceneClass in scene_classes_from_file(file): │ │ 95 │ │ │ │ │ with tempconfig({}): │ │ 96 │ │ │ │ │ │ scene = SceneClass(renderer) │ │ ❱ 97 │ │ │ │ │ │ rerun = scene.render() │ │ 98 │ │ │ │ │ if rerun or config["write_all"]: │ │ 99 │ │ │ │ │ │ renderer.num_plays = 0 │ │ 100 │ │ │ │ │ │ continue │ │ │ │ /home/hypatia/.local/lib/python3.11/site-packages/manim/scene/scene.py:233 │ │ in render │ │ │ │ 230 │ │ │ return True │ │ 231 │ │ self.tear_down() │ │ 232 │ │ # We have to reset these settings in case of multiple renders │ │ ❱ 233 │ │ self.renderer.scene_finished(self) │ │ 234 │ │ │ │ 235 │ │ # Show info only if animations are rendered or to get image │ │ 236 │ │ if ( │ │ │ │ /home/hypatia/.local/lib/python3.11/site-packages/manim/renderer/opengl_rend │ │ erer.py:483 in scene_finished │ │ │ │ 480 │ │ # When num_plays is 0, no images have been output, so output a │ │ 481 │ │ # image in this case │ │ 482 │ │ if self.num_plays > 0: │ │ ❱ 483 │ │ │ self.file_writer.finish() │ │ 484 │ │ elif self.num_plays == 0 and config.write_to_movie: │ │ 485 │ │ │ config.write_to_movie = False │ │ 486 │ │ │ │ /home/hypatia/.local/lib/python3.11/site-packages/manim/scene/scene_file_wri │ │ ter.py:468 in finish │ │ │ │ 465 │ │ │ target_dir = self.image_file_path.parent / self.image_file │ │ 466 │ │ │ logger.info("\n%i images ready at %s\n", self.frame_count, │ │ 467 │ │ if self.subcaptions: │ │ ❱ 468 │ │ │ self.write_subcaption_file() │ │ 469 │ │ │ 470 │ def open_movie_pipe(self, file_path=None): │ │ 471 │ │ """ │ │ │ │ /home/hypatia/.local/lib/python3.11/site-packages/manim/scene/scene_file_wri │ │ ter.py:729 in write_subcaption_file │ │ │ │ 726 │ │ │ 727 │ def write_subcaption_file(self): │ │ 728 │ │ """Writes the subcaption file.""" │ │ ❱ 729 │ │ subcaption_file = Path(config.output_file).with_suffix(".srt") │ │ 730 │ │ subcaption_file.write_text(srt.compose(self.subcaptions), enco │ │ 731 │ │ logger.info(f"Subcaption file has been written as {subcaption_ │ │ 732 │ │ │ │ /usr/lib/python3.11/pathlib.py:872 in __new__ │ │ │ │ 869 │ def __new__(cls, *args, **kwargs): │ │ 870 │ │ if cls is Path: │ │ 871 │ │ │ cls = WindowsPath if os.name == 'nt' else PosixPath │ │ ❱ 872 │ │ self = cls._from_parts(args) │ │ 873 │ │ if not self._flavour.is_supported: │ │ 874 │ │ │ raise NotImplementedError("cannot instantiate %r on your │ │ 875 │ │ │ │ │ │ │ │ │ % (cls.__name__,)) │ │ │ │ /usr/lib/python3.11/pathlib.py:510 in _from_parts │ │ │ │ 507 │ │ # We need to call _parse_args on the instance, so as to get t │ │ 508 │ │ # right flavour. │ │ 509 │ │ self = object.__new__(cls) │ │ ❱ 510 │ │ drv, root, parts = self._parse_args(args) │ │ 511 │ │ self._drv = drv │ │ 512 │ │ self._root = root │ │ 513 │ │ self._parts = parts │ │ │ │ /usr/lib/python3.11/pathlib.py:494 in _parse_args │ │ │ │ 491 │ │ │ if isinstance(a, PurePath): │ │ 492 │ │ │ │ parts += a._parts │ │ 493 │ │ │ else: │ │ ❱ 494 │ │ │ │ a = os.fspath(a) │ │ 495 │ │ │ │ if isinstance(a, str): │ │ 496 │ │ │ │ │ # Force-cast str subclasses to str (issue #21127) │ │ 497 │ │ │ │ │ parts.append(str(a)) │ ╰──────────────────────────────────────────────────────────────────────────────╯ TypeError: expected str, bytes or os.PathLike object, not NoneType ```

System specifications

System Details - OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)): Ubuntu 23 - RAM: 16GB - Python version (`python/py/python3 --version`): Python 3.11.2 - Installed modules (provide output from `pip list`): ``` Package Version ------------------------------ ------------------------- appdirs 1.4.4 arandr 0.1.11 archivebox 0.6.2 argcomplete 2.0.0 asgiref 3.6.0 asttokens 2.2.1 attrs 22.2.0 azure-cognitiveservices-speech 1.29.0 Babel 2.10.3 backcall 0.2.0 bcrypt 3.2.2 beautifulsoup4 4.11.2 beniget 0.4.1 black 23.3.0 blinker 1.5 Brlapi 0.8.4 Brotli 1.0.9 bytecode 0.14.0 cachetools 5.2.0 certifi 2022.9.24 cffi 1.15.1 chardet 5.1.0 charset-normalizer 3.1.0 click 8.1.3 click-default-group 1.2.2 cloud-init 23.1.2 cloup 0.13.1 colorama 0.4.6 coloredlogs 15.0.1 colour 0.1.5 command-not-found 0.3 configobj 5.0.8 coverage 6.5.0 croniter 1.3.14 cryptography 38.0.4 cssselect 1.2.0 cupshelpers 1.0 cycler 0.11.0 dateparser 1.1.8 dbus-python 1.3.2 dearpygui 1.9.1 debugpy 1.6.3+git20221103.a2a3328 decorator 5.1.1 defer 1.0.6 Deprecated 1.2.14 deprecation 2.0.7 distro 1.8.0 distro-info 1.5 Django 3.1.14 django-extensions 3.1.5 dropbox 11.36.0 duplicity 0.8.22 entrypoints 0.4 epc 0.0.5 evdev 1.6.1 executing 1.2.0 exif 1.6.0 fasteners 0.17.3 feedparser 6.0.10 fonttools 4.38.0 fs 2.4.16 future 0.18.2 gast 0.5.2 geographiclib 2.0 geopy 2.3.0 ghp-import 2.1.0 git-remote-dropbox 2.0.0 giturlparse 0.10.0 glcontext 2.3.7 google-api-python-client 1.7.12 google-auth 1.5.1 google-auth-httplib2 0.1.0 greenlet 2.0.1 gTTS 2.3.2 gyp 0.1 html5lib 1.1 httplib2 0.20.4 humanfriendly 10.0 idna 3.3 img2pdf 0.4.4 importlib-metadata 4.12.0 iniconfig 1.1.1 input-remapper 2.0.0 ipykernel 6.17.0 ipython 8.0.1 ipython_genutils 0.2.0 isosurfaces 0.1.0 jaraco.classes 3.2.1 jedi 0.18.2 jeepney 0.8.0 Jinja2 3.1.2 joblib 1.2.0 jsonpatch 1.32 jsonpointer 2.0 jsonschema 4.6.0 jupyter_client 7.4.9 jupyter_core 4.12.0 keyring 23.9.3 kiwisolver 0.0.0 language-selector 0.1 launchpadlib 1.11.0 lazr.restfulclient 0.14.5 lazr.uri 1.0.6 libevdev 0.5 livereload 2.6.3 lockfile 0.12.2 louis 3.24.0 lunr 0.6.2 lxml 4.9.2 lz4 4.0.2+dfsg Mako 1.2.4.dev0 manim 0.17.3 manim-voiceover 0.3.3.post0 ManimPango 0.4.3 mapbox-earcut 1.0.1 Markdown 3.4.3 markdown-it-py 2.1.0 MarkupSafe 2.1.2 matplotlib 3.5.2 matplotlib-inline 0.1.6 mdurl 0.1.2 mergedeep 1.3.4 meson 1.0.1 mkdocs 1.4.2 moderngl 5.8.2 moderngl-window 2.4.4 monotonic 1.6 more-itertools 8.10.0 mpmath 0.0.0 multipledispatch 0.6.0 mutagen 1.46.0 mypy-extensions 1.0.0 nest-asyncio 1.5.4 netifaces 0.11.0 networkx 2.8.8 nltk 3.8 numpy 1.24.2 oauth2client 4.1.3 oauthlib 3.2.2 ocrmypdf 14.0.1+dfsg1 olefile 0.46 packaging 23.1 paramiko 2.12.0 parso 0.8.3 pathspec 0.11.1 pdfminer.six 20221105 pexpect 4.8.0 pickleshare 0.7.5 pikepdf 6.0.0+dfsg Pillow 9.4.0 pip 23.0.1 pipx 1.1.0 platformdirs 3.8.0 playsound 1.3.0 pluggy 1.0.0+repack plum-py 0.8.6 ply 3.11 prompt-toolkit 3.0.38 psutil 5.9.5 ptyprocess 0.7.0 pure-eval 0.2.2 py 1.11.0 pyasn1 0.4.8 pyasn1-modules 0.2.8 pycairo 1.24.0 pycparser 2.21 pycryptodomex 3.11.0 pycups 2.0.1 pydantic 1.10.4 pydbus 0.6.0 pydevd 2.9.5 PyDrive2 0.0.0 pydub 0.25.1 pyenchant 3.2.2 pygit2 1.12.1 pyglet 2.0.8 Pygments 2.15.1 PyGObject 3.44.1 pyinotify 0.9.6 PyJWT 2.6.0 PyMuPDF 1.22.3 PyNaCl 1.5.0 pyOpenSSL 23.0.0 pyparsing 3.0.9 pypinyin 0.49.0 pypng 0.20220715.0 PyQt5 5.15.9 PyQt5-sip 12.11.1 PyQt6 6.5.0 PyQt6-Qt6 6.5.0 PyQt6-sip 13.5.1 PyQt6-WebEngine 6.5.0 PyQt6-WebEngine-Qt6 6.5.0 PyQtWebEngine 5.15.6 pyquery 2.0.0 pyrr 0.10.3 pyrsistent 0.18.1 pyserial 3.5 PySocks 1.7.1 pytaglib 2.0.0 pyte 0.8.1 pytest 7.2.1 python-apt 2.5.3+ubuntu1 python-crontab 2.7.1 python-dateutil 2.8.2 python-debian 0.1.49+ubuntu2 python-dotenv 0.21.1 python-slugify 8.0.1 python-tsp 0.3.1 python-xlib 0.33 pythran 0.11.0 pytz 2022.7.1 pyudev 0.24.0 pyxattr 0.8.0 pyxdg 0.28 PyYAML 6.0 pyyaml_env_tag 0.1 pyzmq 24.0.1 qrcode 7.4.2 qtconsole 5.4.0 QtPy 2.3.0 regex 2022.10.31 reportlab 3.6.12 requests 2.28.1 retrying 1.3.4 rich 13.3.1 rsa 4.8 scipy 1.10.1 screen-resolution-extra 0.0.0 screeninfo 0.8.1 SecretStorage 3.3.3 setuptools 66.1.1 sexpdata 1.0.1 sgmllib3k 1.0.0 simplejson 3.18.3 six 1.16.0 skia-pathops 0.7.4 soupsieve 2.4 sox 1.4.1 SQLAlchemy 1.4.46 sqlparse 0.4.4 srt 3.5.3 stack-data 0.6.2 stone 3.3.1 svgelements 1.9.5 sympy 1.11.1 systemd-python 235 tabulate 0.8.10 text-unidecode 1.3 tld 0.13 tornado 6.2 tqdm 4.64.1 traitlets 5.9.0 tsplib95 0.7.1 typing_extensions 4.4.0 tzlocal 5.0.1 ubuntu-advantage-tools 8001 ubuntu-drivers-common 0.0.0 ufoLib2 0.14.0 ufw 0.36.1 unattended-upgrades 0.1 unidiff 0.7.5 uritemplate 4.1.1 urllib3 1.26.12 usb-creator 0.3.16 userpath 1.8.0 variety 0.8.10 vimura-server 1.3 w3lib 2.1.1 wadllib 1.3.6 watchdog 2.2.1 wcwidth 0.2.6 webencodings 0.5.1 WebOb 1.8.6 websockets 10.4 wheel 0.38.4 wrapt 1.15.0 xdg 5 xkit 0.0.0 youtube-dl 2021.12.17 yt-dlp 2023.3.4 zipp 1.0.0 ```
LaTeX details + LaTeX distribution (e.g. TeX Live 2020): TeX Live 2022 + Installed LaTeX packages: texlive-full
FFMPEG Output of `ffmpeg -version`: ``` ffmpeg version 5.1.2-3ubuntu1 Copyright (c) 2000-2022 the FFmpeg developers built with gcc 12 (Ubuntu 12.2.0-14ubuntu2) configuration: --prefix=/usr --extra-version=3ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared libavutil 57. 28.100 / 57. 28.100 libavcodec 59. 37.100 / 59. 37.100 libavformat 59. 27.100 / 59. 27.100 libavdevice 59. 7.100 / 59. 7.100 libavfilter 8. 44.100 / 8. 44.100 libswscale 6. 7.100 / 6. 7.100 libswresample 4. 7.100 / 4. 7.100 libpostproc 56. 6.100 / 56. 6.100 ```

Additional comments

osolmaz commented 9 months ago

Can you provide more details and/or an MWE? It's hard to tell what you are referring to exactly