Skip to main content

Package that implements livestreaming configurations for Manim.

Project description

Manim Livestream

This plugin is designed to enable livestreaming support for Manim.

Installation

Works like other packages, so pip will do fine

pip install manim-livestream

Usage

  • Run the following command:
python -m manim_livestream

This loads a python shell along with the usage information:

Manim is now running in streaming mode. Stream animations by passing
them to self.play(), e.g.

>>> c = Circle()
>>> self.play(ShowCreation(c))

The current streaming class under the name `manim` inherits from the
original Scene class. To create a streaming class which inherits from
another scene class, e.g. MovingCameraScene, create it with the syntax:

>>> self2 = get_streamer(MovingCameraScene)

To view an image of the current state of the scene or mobject, use:

>>> self.show_frame()        # view image of current scene
>>> c = Circle()
>>> c.show()                 # view image of Mobject

>>> 
  • Config parameters in the command line carry over to manim's internal framework. For example:
python -m manim_livestream -v WARNING

...INFO...

>>> config.verbosity
'WARNING'
>>>
  • IPython is an option:
python -m manim_livestream --use-ipython

...INFO...

Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.23.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]:
  • Simple ways exist for simpler actions:
Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

>>> from manim_livestream import stream
>>> from manim import Circle, ShowCreation
>>> self = stream()
>>> circ = Circle()
>>> self.play(ShowCreation(circ))
  • You want scenes present in files? Here you go:
python -m manim_livestream example_scenes/basic.py
Manim Community v0.6.0

1: OpeningManim
2: SquareToCircle
3: UpdatersExample
4: WarpSquare
5: WriteStuff

Choose number corresponding to desired scene/arguments.
(Use comma separated list for multiple entries)
Choice(s): 2

This particular one will render the scene and send the frames to the streaming protocol.

Potential problems

  • Last 2 or 3 frames don't get sent? Close the window and restart it with open_client()
  • The entire thing freezes? Close the window and restart it with open_client()
  • Using any other streaming protocol? As of yet, not a great plan. From experimentation rtp seems the most stable. However the streaming port shouldn't be too hard to modify.

License and contribution

The code is released as Free Software under the GNU/GPLv3 license. Copying, adapting and republishing it is not only consent but also encouraged, particularly surrounding the subject of tests for the framework.

Addendum

As long as the way Manim interprets scene compilation remains static, this library can easily be used with any manim>=0.6.0(as far as I know).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

manim-livestream-0.0.3.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

manim_livestream-0.0.3-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file manim-livestream-0.0.3.tar.gz.

File metadata

  • Download URL: manim-livestream-0.0.3.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.9.6 Windows/10

File hashes

Hashes for manim-livestream-0.0.3.tar.gz
Algorithm Hash digest
SHA256 b34c89a7fd50647b8fd5ef87cf15b936dc1c3be361b19eeba1cd9fd60f13137f
MD5 702b5dacdf09b884b8ab6b8e63dbcbf5
BLAKE2b-256 1f5aad611c8208a9e06488890df29be12d7dcc8d9a45252f1e5bb7f37e57156f

See more details on using hashes here.

File details

Details for the file manim_livestream-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: manim_livestream-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.9.6 Windows/10

File hashes

Hashes for manim_livestream-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f12284996c5f3447290c1b826b3efe049926b8f925ca506284fb5e8490483fa8
MD5 0eeef7510a3842675fc88f301a57e7a4
BLAKE2b-256 7a0cce5363f2682722cad83da66c9fc88679314f2b2c2b444828ab34313a5f30

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page