Update README.md

This commit is contained in:
Mehmet Mert Yildiran 2018-11-01 11:45:22 +03:00
parent a229bdc9c9
commit 815b3103c4
3 changed files with 17 additions and 3 deletions

View file

@ -69,3 +69,18 @@ a Dockerfile provided.
On a Windows system, make sure to replace `$PWD` with an absolute path to manim.
Note that the shipped Docker image contains the bare requirements to run manim. To transform the Docker container into a fully-functioning development environment, you will have to edit your personal Dockerfile a bit. For a guide to create your own personal Docker image, consult [this guide to Dockerfiles](https://www.howtoforge.com/tutorial/how-to-create-docker-images-with-dockerfile/).
## Live Streaming
To live stream your animations, simply assign `IS_LIVE_STREAMING = True` in `constants.py` file and from your Python Interactive Shell (`python3`) import the stream starter with `from stream_starter import *` while under the project directory. This will provide a clean interactive shell to enter your commands. `manim` object is a `Manim()` instance so as soon as you play an animation with `manim.play()` your stream will start. A video player will pop-up and you can broadcast that video using [OBS Studio](https://obsproject.com/) which is the most practical way of streaming with this math animation library. An example:
```
>>> from stream_starter import *
YOUR STREAM IS READY!
>>> circle = Circle()
>>> manim.play(ShowCreation(circle))
Animation 0: ShowCreationCircle: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 60/60 [00:01<00:00, 37.30it/s]
<scene.scene.Scene object at 0x7f0756d5a8d0>
```
It is also possible to stream directly to Twitch. To do that simply assign `IS_STREAMING_TO_TWITCH = True` in `constants.py` file and put your Twitch Stream Key to `TWITCH_STREAM_KEY = "YOUR_STREAM_KEY"` and when you follow the above example the stream will directly start on your Twitch channel(with no audio support).

View file

@ -20,7 +20,7 @@ elif os.path.exists("media_dir.txt"):
else:
MEDIA_DIR = os.path.join(
os.path.expanduser('~'),
"Videos/"
"Dropbox (3Blue1Brown)/3Blue1Brown Team Folder"
)
if not os.path.exists(MEDIA_DIR):
@ -213,7 +213,7 @@ for name in [s for s in list(COLOR_MAP.keys()) if s.endswith("_C")]:
locals()[name.replace("_C", "")] = locals()[name]
# Streaming related configurations
IS_LIVE_STREAMING = True
IS_LIVE_STREAMING = False
LIVE_STREAM_NAME = "LiveStream"
IS_STREAMING_TO_TWITCH = False
TWITCH_STREAM_KEY = "YOUR_STREAM_KEY"

View file

@ -654,7 +654,6 @@ class Scene(Container):
command += [STREAMING_PROTOCOL + '://' + STREAMING_IP + ':' + STREAMING_PORT]
else:
command += [temp_file_path]
print(' '.join(command))
# self.writing_process = sp.Popen(command, stdin=sp.PIPE, shell=True)
self.writing_process = sp.Popen(command, stdin=sp.PIPE)