vpstream 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vpstream-0.1.0/.gitignore +227 -0
- vpstream-0.1.0/CHANGELOG.md +7 -0
- vpstream-0.1.0/LICENSE +21 -0
- vpstream-0.1.0/PKG-INFO +95 -0
- vpstream-0.1.0/README.md +76 -0
- vpstream-0.1.0/pyproject.toml +67 -0
- vpstream-0.1.0/src/vpstream/__init__.py +10 -0
- vpstream-0.1.0/src/vpstream/__main__.py +5 -0
- vpstream-0.1.0/src/vpstream/assets/__init__.py +1 -0
- vpstream-0.1.0/src/vpstream/assets/caps.html +54 -0
- vpstream-0.1.0/src/vpstream/assets/caps.js +559 -0
- vpstream-0.1.0/src/vpstream/assets/hls.js.LICENSE +28 -0
- vpstream-0.1.0/src/vpstream/assets/hls.js.version +1 -0
- vpstream-0.1.0/src/vpstream/assets/hls.min.js +4 -0
- vpstream-0.1.0/src/vpstream/bench.py +382 -0
- vpstream-0.1.0/src/vpstream/caps/__init__.py +1 -0
- vpstream-0.1.0/src/vpstream/caps/clips.py +337 -0
- vpstream-0.1.0/src/vpstream/caps/server.py +367 -0
- vpstream-0.1.0/src/vpstream/cli.py +204 -0
- vpstream-0.1.0/src/vpstream/ffargs.py +252 -0
- vpstream-0.1.0/src/vpstream/probe.py +242 -0
- vpstream-0.1.0/src/vpstream/selftest.py +28 -0
- vpstream-0.1.0/src/vpstream/tests/__init__.py +0 -0
- vpstream-0.1.0/src/vpstream/tests/conftest.py +34 -0
- vpstream-0.1.0/src/vpstream/tests/fakes.py +32 -0
- vpstream-0.1.0/src/vpstream/tests/test_assets.py +17 -0
- vpstream-0.1.0/src/vpstream/tests/test_bench.py +150 -0
- vpstream-0.1.0/src/vpstream/tests/test_caps.py +309 -0
- vpstream-0.1.0/src/vpstream/tests/test_cli.py +78 -0
- vpstream-0.1.0/src/vpstream/tests/test_ffargs.py +103 -0
- vpstream-0.1.0/src/vpstream/tests/test_integration.py +120 -0
- vpstream-0.1.0/src/vpstream/tests/test_probe.py +127 -0
- vpstream-0.1.0/src/vpstream/tools.py +100 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
*.lcov
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
cover/
|
|
54
|
+
|
|
55
|
+
# Translations
|
|
56
|
+
*.mo
|
|
57
|
+
*.pot
|
|
58
|
+
|
|
59
|
+
# Django stuff:
|
|
60
|
+
*.log
|
|
61
|
+
local_settings.py
|
|
62
|
+
db.sqlite3
|
|
63
|
+
db.sqlite3-journal
|
|
64
|
+
|
|
65
|
+
# Flask stuff:
|
|
66
|
+
instance/
|
|
67
|
+
.webassets-cache
|
|
68
|
+
|
|
69
|
+
# Scrapy stuff:
|
|
70
|
+
.scrapy
|
|
71
|
+
|
|
72
|
+
# Sphinx documentation
|
|
73
|
+
docs/_build/
|
|
74
|
+
|
|
75
|
+
# PyBuilder
|
|
76
|
+
.pybuilder/
|
|
77
|
+
target/
|
|
78
|
+
|
|
79
|
+
# Jupyter Notebook
|
|
80
|
+
.ipynb_checkpoints
|
|
81
|
+
|
|
82
|
+
# IPython
|
|
83
|
+
profile_default/
|
|
84
|
+
ipython_config.py
|
|
85
|
+
|
|
86
|
+
# pyenv
|
|
87
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
88
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
89
|
+
# .python-version
|
|
90
|
+
|
|
91
|
+
# pipenv
|
|
92
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
93
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
94
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
95
|
+
# install all needed dependencies.
|
|
96
|
+
# Pipfile.lock
|
|
97
|
+
|
|
98
|
+
# uv
|
|
99
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
100
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
101
|
+
# commonly ignored for libraries.
|
|
102
|
+
# uv.lock
|
|
103
|
+
|
|
104
|
+
# poetry
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
106
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
107
|
+
# commonly ignored for libraries.
|
|
108
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
109
|
+
# poetry.lock
|
|
110
|
+
# poetry.toml
|
|
111
|
+
|
|
112
|
+
# pdm
|
|
113
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
114
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
115
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
116
|
+
# pdm.lock
|
|
117
|
+
# pdm.toml
|
|
118
|
+
.pdm-python
|
|
119
|
+
.pdm-build/
|
|
120
|
+
|
|
121
|
+
# pixi
|
|
122
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
123
|
+
# pixi.lock
|
|
124
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
125
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
126
|
+
.pixi/*
|
|
127
|
+
!.pixi/config.toml
|
|
128
|
+
|
|
129
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
130
|
+
__pypackages__/
|
|
131
|
+
|
|
132
|
+
# Celery stuff
|
|
133
|
+
celerybeat-schedule*
|
|
134
|
+
celerybeat.pid
|
|
135
|
+
|
|
136
|
+
# Redis
|
|
137
|
+
*.rdb
|
|
138
|
+
*.aof
|
|
139
|
+
*.pid
|
|
140
|
+
|
|
141
|
+
# RabbitMQ
|
|
142
|
+
mnesia/
|
|
143
|
+
rabbitmq/
|
|
144
|
+
rabbitmq-data/
|
|
145
|
+
|
|
146
|
+
# ActiveMQ
|
|
147
|
+
activemq-data/
|
|
148
|
+
|
|
149
|
+
# SageMath parsed files
|
|
150
|
+
*.sage.py
|
|
151
|
+
|
|
152
|
+
# Environments
|
|
153
|
+
.env
|
|
154
|
+
.envrc
|
|
155
|
+
.venv
|
|
156
|
+
env/
|
|
157
|
+
venv/
|
|
158
|
+
ENV/
|
|
159
|
+
env.bak/
|
|
160
|
+
venv.bak/
|
|
161
|
+
|
|
162
|
+
# Spyder project settings
|
|
163
|
+
.spyderproject
|
|
164
|
+
.spyproject
|
|
165
|
+
|
|
166
|
+
# Rope project settings
|
|
167
|
+
.ropeproject
|
|
168
|
+
|
|
169
|
+
# mkdocs/Zensical documentation
|
|
170
|
+
/site
|
|
171
|
+
|
|
172
|
+
# mypy
|
|
173
|
+
.mypy_cache/
|
|
174
|
+
.dmypy.json
|
|
175
|
+
dmypy.json
|
|
176
|
+
|
|
177
|
+
# Pyre type checker
|
|
178
|
+
.pyre/
|
|
179
|
+
|
|
180
|
+
# pytype static type analyzer
|
|
181
|
+
.pytype/
|
|
182
|
+
|
|
183
|
+
# Cython debug symbols
|
|
184
|
+
cython_debug/
|
|
185
|
+
|
|
186
|
+
# PyCharm
|
|
187
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
188
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
189
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
190
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
191
|
+
# .idea/
|
|
192
|
+
|
|
193
|
+
# Abstra
|
|
194
|
+
# Abstra is an AI-powered process automation framework.
|
|
195
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
196
|
+
# Learn more at https://abstra.io/docs
|
|
197
|
+
.abstra/
|
|
198
|
+
|
|
199
|
+
# Visual Studio Code
|
|
200
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore that
|
|
201
|
+
# can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
202
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer, you
|
|
203
|
+
# could uncomment the following to ignore the entire vscode folder
|
|
204
|
+
# .vscode/
|
|
205
|
+
# Temporary file for partial code execution
|
|
206
|
+
tempCodeRunnerFile.py
|
|
207
|
+
|
|
208
|
+
# Ruff stuff:
|
|
209
|
+
.ruff_cache/
|
|
210
|
+
|
|
211
|
+
# PyPI configuration file
|
|
212
|
+
.pypirc
|
|
213
|
+
|
|
214
|
+
# Marimo
|
|
215
|
+
marimo/_static/
|
|
216
|
+
marimo/_lsp/
|
|
217
|
+
__marimo__/
|
|
218
|
+
|
|
219
|
+
# Streamlit
|
|
220
|
+
.streamlit/secrets.toml
|
|
221
|
+
|
|
222
|
+
# vpstream: private planning notes, validation logs and the deny list
|
|
223
|
+
notes/
|
|
224
|
+
# Machine-specific instructions
|
|
225
|
+
*.local.md
|
|
226
|
+
# Default results file of `vpstream caps`
|
|
227
|
+
caps-results-*.json
|
vpstream-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sripal K Jain
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
vpstream-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: vpstream
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: On-demand video streaming from a VPS, controlled over SSH or a private dashboard
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
License-File: src/vpstream/assets/hls.js.LICENSE
|
|
8
|
+
Classifier: Environment :: Console
|
|
9
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
14
|
+
Classifier: Topic :: Multimedia :: Video
|
|
15
|
+
Requires-Python: >=3.12
|
|
16
|
+
Provides-Extra: dev
|
|
17
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
# vpstream
|
|
21
|
+
|
|
22
|
+
On-demand video streaming from a VPS. The public port opens only while a stream runs, and
|
|
23
|
+
everything is controlled over SSH or a private dashboard.
|
|
24
|
+
|
|
25
|
+
Status: early development. This release contains only the measuring tools:
|
|
26
|
+
|
|
27
|
+
| Command | What it does |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| `vpstream bench FILE` | Measures how fast this host copies, transcodes and burns in subtitles for a file |
|
|
30
|
+
| `vpstream caps` | Serves a test page that checks what a TV browser can play |
|
|
31
|
+
| `vpstream selftest` | Runs the tests shipped with the package (`--integration` uses the real ffmpeg) |
|
|
32
|
+
|
|
33
|
+
## Requirements
|
|
34
|
+
|
|
35
|
+
- Linux, Python 3.12 or newer
|
|
36
|
+
- ffmpeg and ffprobe on `PATH` (not bundled), with libx264; libx265 and an AV1 encoder
|
|
37
|
+
(libsvtav1 or libaom-av1) for the full `caps` test set
|
|
38
|
+
|
|
39
|
+
## Install
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
pipx install "vpstream[dev]" # the dev extra adds pytest for `vpstream selftest`
|
|
43
|
+
vpstream --version
|
|
44
|
+
vpstream selftest --integration
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## `vpstream bench FILE`
|
|
48
|
+
|
|
49
|
+
Encodes a sample of the file (120 seconds from about 10% in, `--sample` to change) at low CPU
|
|
50
|
+
and I/O priority, and reports the speed of each step as a multiple of real time, with the
|
|
51
|
+
estimated time for the whole file:
|
|
52
|
+
|
|
53
|
+
- **copy:** the video copied into fMP4 HLS, audio converted to AAC
|
|
54
|
+
- **transcode:** H.264 at the source resolution, for each x264 preset in `--presets`
|
|
55
|
+
(default `veryfast,medium`); HDR sources are tone mapped
|
|
56
|
+
- **burn-in:** the first image, ASS or SSA subtitle track (or `--sub N`) drawn into the video;
|
|
57
|
+
for ASS tracks, font substitutions reported by libass are listed
|
|
58
|
+
|
|
59
|
+
`--json PATH` saves the results.
|
|
60
|
+
|
|
61
|
+
## `vpstream caps`
|
|
62
|
+
|
|
63
|
+
Generates short test clips (H.264, HEVC and AV1 in 8 and 10 bit, two audio tracks, WebVTT),
|
|
64
|
+
then serves a page on port 1337 (`--port`) that a TV browser opens at
|
|
65
|
+
`http://<server-ip>:1337/caps`. The page is driven with the arrow keys and OK. It tests MP4 and
|
|
66
|
+
HLS playback (hls.js and native), a subtitle overlay, audio track switching, download speed,
|
|
67
|
+
and records which remote keys reach the page. Results are sent back and saved to
|
|
68
|
+
`caps-results-*.json`. The server stops after 60 minutes (`--ttl`).
|
|
69
|
+
|
|
70
|
+
Clips are cached under `~/.cache/vpstream`. `--clips DIR` must be a new or empty folder, or one
|
|
71
|
+
that `vpstream caps` made before; any other folder is refused, never cleared. `--regen` makes
|
|
72
|
+
the clips again.
|
|
73
|
+
|
|
74
|
+
The port must be reachable: open it in your firewall for the test and close it afterwards.
|
|
75
|
+
|
|
76
|
+
## Development
|
|
77
|
+
|
|
78
|
+
```text
|
|
79
|
+
python -m venv .venv && .venv/bin/pip install -e ".[dev]"
|
|
80
|
+
.venv/bin/pytest # unit tests
|
|
81
|
+
.venv/bin/pytest --integration # also the tests that run ffmpeg
|
|
82
|
+
git config core.hooksPath .githooks
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Pull requests need a Conventional Commit title (`feat: ...`, `fix: ...`). Releases are made
|
|
86
|
+
from `main` by python-semantic-release.
|
|
87
|
+
|
|
88
|
+
hls.js (Apache-2.0) is bundled in `src/vpstream/assets`, with its version in `hls.js.version`.
|
|
89
|
+
`python scripts/update-hlsjs.py` updates it from npm (checked against npm's sha512 integrity;
|
|
90
|
+
`--version X` for a given release, `--check` to only compare). A weekly workflow runs the same
|
|
91
|
+
script and opens a pull request when a new release is out.
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
MIT
|
vpstream-0.1.0/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# vpstream
|
|
2
|
+
|
|
3
|
+
On-demand video streaming from a VPS. The public port opens only while a stream runs, and
|
|
4
|
+
everything is controlled over SSH or a private dashboard.
|
|
5
|
+
|
|
6
|
+
Status: early development. This release contains only the measuring tools:
|
|
7
|
+
|
|
8
|
+
| Command | What it does |
|
|
9
|
+
| --- | --- |
|
|
10
|
+
| `vpstream bench FILE` | Measures how fast this host copies, transcodes and burns in subtitles for a file |
|
|
11
|
+
| `vpstream caps` | Serves a test page that checks what a TV browser can play |
|
|
12
|
+
| `vpstream selftest` | Runs the tests shipped with the package (`--integration` uses the real ffmpeg) |
|
|
13
|
+
|
|
14
|
+
## Requirements
|
|
15
|
+
|
|
16
|
+
- Linux, Python 3.12 or newer
|
|
17
|
+
- ffmpeg and ffprobe on `PATH` (not bundled), with libx264; libx265 and an AV1 encoder
|
|
18
|
+
(libsvtav1 or libaom-av1) for the full `caps` test set
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
pipx install "vpstream[dev]" # the dev extra adds pytest for `vpstream selftest`
|
|
24
|
+
vpstream --version
|
|
25
|
+
vpstream selftest --integration
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## `vpstream bench FILE`
|
|
29
|
+
|
|
30
|
+
Encodes a sample of the file (120 seconds from about 10% in, `--sample` to change) at low CPU
|
|
31
|
+
and I/O priority, and reports the speed of each step as a multiple of real time, with the
|
|
32
|
+
estimated time for the whole file:
|
|
33
|
+
|
|
34
|
+
- **copy:** the video copied into fMP4 HLS, audio converted to AAC
|
|
35
|
+
- **transcode:** H.264 at the source resolution, for each x264 preset in `--presets`
|
|
36
|
+
(default `veryfast,medium`); HDR sources are tone mapped
|
|
37
|
+
- **burn-in:** the first image, ASS or SSA subtitle track (or `--sub N`) drawn into the video;
|
|
38
|
+
for ASS tracks, font substitutions reported by libass are listed
|
|
39
|
+
|
|
40
|
+
`--json PATH` saves the results.
|
|
41
|
+
|
|
42
|
+
## `vpstream caps`
|
|
43
|
+
|
|
44
|
+
Generates short test clips (H.264, HEVC and AV1 in 8 and 10 bit, two audio tracks, WebVTT),
|
|
45
|
+
then serves a page on port 1337 (`--port`) that a TV browser opens at
|
|
46
|
+
`http://<server-ip>:1337/caps`. The page is driven with the arrow keys and OK. It tests MP4 and
|
|
47
|
+
HLS playback (hls.js and native), a subtitle overlay, audio track switching, download speed,
|
|
48
|
+
and records which remote keys reach the page. Results are sent back and saved to
|
|
49
|
+
`caps-results-*.json`. The server stops after 60 minutes (`--ttl`).
|
|
50
|
+
|
|
51
|
+
Clips are cached under `~/.cache/vpstream`. `--clips DIR` must be a new or empty folder, or one
|
|
52
|
+
that `vpstream caps` made before; any other folder is refused, never cleared. `--regen` makes
|
|
53
|
+
the clips again.
|
|
54
|
+
|
|
55
|
+
The port must be reachable: open it in your firewall for the test and close it afterwards.
|
|
56
|
+
|
|
57
|
+
## Development
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
python -m venv .venv && .venv/bin/pip install -e ".[dev]"
|
|
61
|
+
.venv/bin/pytest # unit tests
|
|
62
|
+
.venv/bin/pytest --integration # also the tests that run ffmpeg
|
|
63
|
+
git config core.hooksPath .githooks
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Pull requests need a Conventional Commit title (`feat: ...`, `fix: ...`). Releases are made
|
|
67
|
+
from `main` by python-semantic-release.
|
|
68
|
+
|
|
69
|
+
hls.js (Apache-2.0) is bundled in `src/vpstream/assets`, with its version in `hls.js.version`.
|
|
70
|
+
`python scripts/update-hlsjs.py` updates it from npm (checked against npm's sha512 integrity;
|
|
71
|
+
`--version X` for a given release, `--check` to only compare). A weekly workflow runs the same
|
|
72
|
+
script and opens a pull request when a new release is out.
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
MIT
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.25"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "vpstream"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "On-demand video streaming from a VPS, controlled over SSH or a private dashboard"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE", "src/vpstream/assets/hls.js.LICENSE"]
|
|
12
|
+
requires-python = ">=3.12"
|
|
13
|
+
dependencies = []
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"Programming Language :: Python :: 3.12",
|
|
17
|
+
"Programming Language :: Python :: 3.13",
|
|
18
|
+
"Programming Language :: Python :: 3.14",
|
|
19
|
+
"Operating System :: POSIX :: Linux",
|
|
20
|
+
"Environment :: Console",
|
|
21
|
+
"Topic :: Multimedia :: Video",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[project.optional-dependencies]
|
|
25
|
+
dev = ["pytest>=8"]
|
|
26
|
+
|
|
27
|
+
[project.scripts]
|
|
28
|
+
vpstream = "vpstream.cli:main"
|
|
29
|
+
|
|
30
|
+
[tool.hatch.build.targets.sdist]
|
|
31
|
+
include = ["src/vpstream", "README.md", "LICENSE", "CHANGELOG.md"]
|
|
32
|
+
|
|
33
|
+
[tool.hatch.build.targets.wheel]
|
|
34
|
+
packages = ["src/vpstream"]
|
|
35
|
+
|
|
36
|
+
[tool.pytest.ini_options]
|
|
37
|
+
testpaths = ["src/vpstream/tests"]
|
|
38
|
+
addopts = "-p no:cacheprovider"
|
|
39
|
+
|
|
40
|
+
[tool.ruff]
|
|
41
|
+
target-version = "py312"
|
|
42
|
+
line-length = 100
|
|
43
|
+
src = ["src"]
|
|
44
|
+
|
|
45
|
+
[tool.ruff.lint]
|
|
46
|
+
select = ["E", "F", "W", "I", "UP", "B", "SIM", "RUF"]
|
|
47
|
+
|
|
48
|
+
[tool.mypy]
|
|
49
|
+
python_version = "3.12"
|
|
50
|
+
strict = true
|
|
51
|
+
files = ["src/vpstream"]
|
|
52
|
+
exclude = ["src/vpstream/tests/"]
|
|
53
|
+
|
|
54
|
+
[tool.semantic_release]
|
|
55
|
+
commit_parser = "conventional"
|
|
56
|
+
tag_format = "v{version}"
|
|
57
|
+
version_toml = ["pyproject.toml:project.version"]
|
|
58
|
+
allow_zero_version = true
|
|
59
|
+
major_on_zero = false
|
|
60
|
+
build_command = "python -m pip install build && python -m build"
|
|
61
|
+
|
|
62
|
+
[tool.semantic_release.branches.main]
|
|
63
|
+
match = "main"
|
|
64
|
+
prerelease = false
|
|
65
|
+
|
|
66
|
+
[tool.semantic_release.changelog.default_templates]
|
|
67
|
+
changelog_file = "CHANGELOG.md"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""On-demand video streaming from a VPS."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
6
|
+
|
|
7
|
+
try:
|
|
8
|
+
__version__ = version("vpstream")
|
|
9
|
+
except PackageNotFoundError: # running from a source tree without an install
|
|
10
|
+
__version__ = "0.0.0+unknown"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Files served to browsers: pages, scripts and the bundled hls.js."""
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>vpstream capability test</title>
|
|
7
|
+
<style>
|
|
8
|
+
html, body { margin: 0; background: #111; color: #eee; font: 22px/1.4 sans-serif; }
|
|
9
|
+
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
|
|
10
|
+
h1 { font-size: 30px; margin: 8px 0 4px; }
|
|
11
|
+
p { margin: 6px 0; }
|
|
12
|
+
.muted { color: #aaa; }
|
|
13
|
+
button { font: inherit; font-size: 24px; padding: 14px 26px; margin: 6px 10px 6px 0;
|
|
14
|
+
background: #2a2a2a; color: #fff; border: 3px solid #555; border-radius: 10px; }
|
|
15
|
+
button:focus { outline: none; border-color: #ffd400; background: #3a3a10; }
|
|
16
|
+
button[disabled] { opacity: .4; }
|
|
17
|
+
#stage { font-size: 26px; margin: 12px 0; min-height: 1.4em; }
|
|
18
|
+
#player { position: relative; width: 640px; max-width: 100%; background: #000;
|
|
19
|
+
margin: 10px 0; height: 360px; }
|
|
20
|
+
#player video { width: 100%; height: 100%; display: block; }
|
|
21
|
+
#overlay { position: absolute; left: 0; right: 0; top: 6%; text-align: center;
|
|
22
|
+
pointer-events: none; }
|
|
23
|
+
#overlay span { background: rgba(0,0,0,.75); color: #ffd400; padding: 4px 12px;
|
|
24
|
+
font-size: 26px; border-radius: 6px; }
|
|
25
|
+
#ask { margin: 10px 0; }
|
|
26
|
+
#ask p { font-size: 24px; }
|
|
27
|
+
table { border-collapse: collapse; width: 100%; font-size: 18px; margin: 8px 0 18px; }
|
|
28
|
+
td, th { border-bottom: 1px solid #333; padding: 4px 8px; text-align: left; }
|
|
29
|
+
.pass { color: #6f6; } .fail { color: #f66; } .skip { color: #aaa; }
|
|
30
|
+
#keys { font-family: monospace; font-size: 18px; }
|
|
31
|
+
</style>
|
|
32
|
+
</head>
|
|
33
|
+
<body>
|
|
34
|
+
<main>
|
|
35
|
+
<h1>vpstream capability test</h1>
|
|
36
|
+
<p class="muted">Use the arrow keys to move and OK to press. Results are sent to the server as each part finishes.</p>
|
|
37
|
+
<div>
|
|
38
|
+
<button id="start">Start all tests</button>
|
|
39
|
+
<button id="speedonly">Speed test only</button>
|
|
40
|
+
</div>
|
|
41
|
+
<div id="stage">Loading…</div>
|
|
42
|
+
<div id="player"><div id="overlay"></div></div>
|
|
43
|
+
<div id="ask"></div>
|
|
44
|
+
<div id="controls"></div>
|
|
45
|
+
<p id="keys">Remote keys: press every button on the remote (arrows, OK, Back, Play/Pause, colors). Last key: none</p>
|
|
46
|
+
<h2>Results</h2>
|
|
47
|
+
<table id="results"><thead><tr><th>Test</th><th>Result</th><th>Detail</th></tr></thead><tbody></tbody></table>
|
|
48
|
+
<h2>Browser</h2>
|
|
49
|
+
<table id="env"><tbody></tbody></table>
|
|
50
|
+
</main>
|
|
51
|
+
<script src="/caps/hls.min.js"></script>
|
|
52
|
+
<script src="/caps/caps.js"></script>
|
|
53
|
+
</body>
|
|
54
|
+
</html>
|