Skip to content
This repository was archived by the owner on Mar 6, 2025. It is now read-only.

Commit 3f8ffe5

Browse files
committed
doc
1 parent 27594d5 commit 3f8ffe5

File tree

1 file changed

+24
-41
lines changed

1 file changed

+24
-41
lines changed

README.md

+24-41
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ Python >= 3.9 is recommended for full capabilities.
1212
`visual_tests.py` is a quick check of several command line scripting scenarios on your laptop.
1313
FFmpeg is used from Python `subprocess` to stream to sites including:
1414

15-
* [Facebook Live](#facebook-live) (requires FFmpeg >= 4.2 due to mandatory RTMPS)
16-
* [YouTube Live](#youtube-live)
17-
* [Twitter Live](#twitter)
18-
* [Twitch](#twitch)
15+
* Facebook Live (requires FFmpeg >= 4.2 due to mandatory RTMPS)
16+
* YouTube Live
17+
* Twitch
1918
* also Ustream, Vimeo, Restream.io and more for streaming broadcasts.
2019

2120
![PyLivestream diagram showing screen capture or camera simultaneously livestreaming to multiple services.](./doc/logo.png)
@@ -74,28 +73,24 @@ python3 -m pip install -e .
7473
You can skip past this section to "stream start" if it's confusing.
7574
The defaults might work to get you started.
7675

77-
The pylivestream.json file has parameters relevant to the live stream.
78-
This file is copied into your `sys.prefix`/share/pylivestream directory upon `pip install pylivestream`.
79-
80-
We suggest copying this file to another location on your hard drive and editing, then specifying it for your streams.
81-
82-
The `[DEFAULT]` section has parameters that can be overridden for each site, if desired.
76+
The pylivestream.json file you create has parameters relevant to the live stream.
77+
We suggest copying the example
78+
[pylivestream.json](./src/pylivestream/data/pylivestream.json)
79+
and editing, then specify it for your streams.
8380

8481
* `screencap_origin`: origin (upper left corner) of screen capture region in pixels.
8582
* `screencap_size`: resolution of screen capture (area to capture, starting from origin)
8683
* `screencap_fps`: frames/sec of screen capture
8784
* `video_kbps`: override automatic video bitrate in kbps
88-
8985
* `audio_rate`: audio sampling frequency. Typically 44100 Hz (CD quality).
9086
* `audio_bps`: audio data rate--**leave blank if you want no audio** (usually used for "file", to make an animated GIF in post-processing)
9187
* `preset`: `veryfast` or `ultrafast` if CPU not able to keep up.
88+
* `exe`: override path to desired FFmpeg executable. In case you have multiple FFmpeg versions installed (say, from Anaconda Python).
9289

9390
Next are `sys.platform` specific parameters.
9491

9592
Seek help in FFmpeg documentation, try capturing to a file first and then update ~/pylivestream.json for `sys.platform`.
9693

97-
* exe: override path to desired FFmpeg executable. In case you have multiple FFmpeg versions installed (say, from Anaconda Python).
98-
9994
### Deduce inputs
10095

10196
Each computer will need distinct pylivestream.json device input parameters:
@@ -150,25 +145,23 @@ The user must specify this JSON file location.
150145
### YouTube Live
151146

152147
1. [configure](https://www.youtube.com/live_dashboard) YouTube Live.
153-
2. Edit file `youtube.json` to have the YouTube hexadecimal stream key
148+
2. Edit "pylivestream.json" to have the YouTube streamid
154149
3. Run Python script and chosen input will stream on YouTube Live.
155150

156151
```sh
157-
python -m pylivestream.screen youtube
152+
python -m pylivestream.screen youtube ./pylivestream.json
158153
```
159154

160155
### Facebook Live
161156

162157
Facebook Live requires FFmpeg >= 4.2 due to mandatory RTMPS
163158

164159
1. configure your Facebook Live stream
165-
2. Put stream ID from
166-
[<https://www.facebook.com/live/create>](https://www.facebook.com/live/create)
167-
into the file `~/facebook.json`
160+
2. Put [stream ID](https://www.facebook.com/live/create) into the JSON file
168161
3. Run Python script for Facebook with chosen input
169162

170163
```sh
171-
python -m pylivestream.screen facebook
164+
python -m pylivestream.screen facebook ./pylivestream.json
172165
```
173166

174167
### Twitter
@@ -177,8 +170,9 @@ TODO
177170

178171
### Twitch
179172

180-
Create stream from [Twitch Dashboard](https://dashboard.twitch.tv/settings/channel#stream-preferences).
181-
Create pylivestream.json file with "url" and "streamid" for Twitch.
173+
Create stream from
174+
[Twitch Dashboard](https://dashboard.twitch.tv/settings/channel#stream-preferences).
175+
Edit pylivestream.json file with "url" and "streamid" for Twitch.
182176
Run Python script for Twitch with chosen input:
183177

184178
```sh
@@ -189,21 +183,10 @@ python -m pylivestream.screen twitch ./pylivestream.json
189183

190184
Due to the complexity of streaming and the non-specific error codes FFmpeg emits, the default behavior is that if FFmpeg detects one stream has failed, ALL streams will stop streaming and the program ends.
191185

192-
Setup ~/pylivestream.json for computer and desired parameters.
193-
Setup a JSON file "pylivestream.json" with values you determine, not these dummy values:
194-
195-
```json
196-
{
197-
"facebook": {
198-
"url": "rtmps://live-api-s.facebook.com:443/rtmp",
199-
"streamid": "your-stream-id",
200-
},
201-
"youtube": {
202-
"url": "rtmp://a.rtmp.youtube.com/live2",
203-
"streamid": "your-stream-id"
204-
}
205-
}
206-
```
186+
Setup a pylivestream.json for computer and desired parameters.
187+
Copy the provided
188+
[pylivestream.json](./src/pylivestream/data/pylivestream.json)
189+
and edit with values you determine.
207190

208191
[File-Streaming](./File-Streaming.md)
209192

@@ -219,23 +202,23 @@ JSON:
219202
Stream to multiple sites, in this example Facebook Live and YouTube Live simultaneously:
220203

221204
```sh
222-
python -m pylivestream.camera youtube facebook
205+
python -m pylivestream.camera youtube facebook ./pylivestream.json
223206
```
224207

225208
### Screen Share Livestream
226209

227210
Stream to multiple sites, in this example Facebook Live and YouTube Live simultaneously:
228211

229212
```sh
230-
python -m pylivestream.screen youtube facebook
213+
python -m pylivestream.screen youtube facebook ./pylivestream.json
231214
```
232215

233216
### Image + Audio Livestream
234217

235218
Microphone audio + static image is accomplished by
236219

237220
```sh
238-
python -m pylivestream.microphone youtube facebook -image doc/logo.jpg
221+
python -m pylivestream.microphone youtube facebook ./pylivestream.json -image doc/logo.jpg
239222
```
240223

241224
or wherever your image file is.
@@ -248,15 +231,15 @@ That's not something we can fix within the scope of this project.
248231
You can test it to your own computer by:
249232

250233
```sh
251-
python -m pylivestream.microphone localhost
234+
python -m pylivestream.microphone localhost ./pylivestream.json
252235
```
253236

254237
### Screen capture to disk
255238

256239
This script saves your screen capture to a file on your disk:
257240

258241
```sh
259-
python -m pylivestream.screen2disk myvid.avi
242+
python -m pylivestream.screen2disk myvid.avi ./pylivestream.json
260243
```
261244

262245
## Utilities

0 commit comments

Comments
 (0)