Python module to, stream videos via authenticated sessions using FastAPI
Project description
Deployments
Video Streaming
Python module to, stream videos via authenticated sessions using FastAPI
Install
python -m pip install stream-localhost
Usage
import asyncio
import os
import pystream
if __name__ == '__main__':
kwargs = dict(
username="foo",
password="bar",
video_source=os.path.join(os.path.expanduser('~'), 'Downloads'),
)
# Add the following to host on local IP address, skip for localhost (127.0.0.1)
# kwargs["video_host"] = pystream.utils.get_local_ip()
asyncio.run(pystream.start(**kwargs))
Env Variables
:bulb: Environment variables can be loaded from any file. Defaults to
.env
(set the env varenv_file
to the filename)
Mandatory
- USERNAME: Any username of choice.
- PASSWORD: Any password of choice.
- VIDEO_SOURCE: Source path for
.mp4
files.
Optional
- VIDEO_HOST: IP address to host the video. Defaults to
127.0.0.1
- VIDEO_PORT: Port number to host the application. Defaults to
8000
- WORKERS: Number of workers to spin up the
uvicorn
server. Defaults to1
- WEBSITE: Website to add to CORS configuration. Required only if tunneled via CDN
- AUTO_THUMBNAIL: Boolean flag to auto generate thumbnail images for preview. Defaults to
True
- SCAN_INTERVAL: Interval in seconds to scan
VIDEO_SOURCE
for.mp4
files. Defaults to30s
, set to0
to skip
Coding Standards
Docstring format: Google
Styling conventions: PEP 8
and isort
Release Notes
Requirement
python -m pip install gitverse
Usage
gitverse-release reverse -f release_notes.rst -t 'Release Notes'
Linting
pre-commit
will ensure linting, run pytest, generate runbook & release notes, and validate hyperlinks in ALL
markdown files (including Wiki pages)
Requirement
pip install sphinx==5.1.1 pre-commit recommonmark
Usage
pre-commit run --all-files
Pypi Package
https://pypi.org/project/stream-localhost/
Runbook
https://thevickypedia.github.io/pystream/
License & copyright
© Vignesh Rao
Licensed under the MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for stream_localhost-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aba8313854d39e89d1e0f530ed18860b083b6cd69eb091c23d5c4a6113284f20 |
|
MD5 | c15d72215560e1b8e4229c515220b4bf |
|
BLAKE2b-256 | 28f7c050b01cef4ab2697e84965a8a88db0bb6a84e6ff72c5f1b9519a40c8d8a |