Streaming webm
transcoder plus previews, metadata, and jpg
thumbnails in a convenient micro-service.
Running:
docker run --rm -it -p 8000:8000 ubergarm/pythumbio
Testing:
# apt-get install -y httpie || brew install httpie
http -v http://localhost:8000/meta?url=http://myvideo.com/name.mp4
Development:
docker run --rm -it -v `pwd`:/app --workdir=/app -p 8000:8000 --entrypoint=/bin/sh ubergarm/pythumbio
python3 server.py
Building:
docker build -t ubergarm/pythumbio .
Environment Variable | Description | Default |
---|---|---|
PYTHUMBIO_PORT |
TCP/IP port number on which to listen | 8000 |
PYTHUMBIO_WORKERS |
How many sanic worker threads |
2 |
PYTHUMBIO_CONCURRENCY_PER_WORKER |
How many concurrent requests handled per sanic worker threads |
4 |
PYTHUMBIO_CHUNKSIZE |
Streaming HTTP Chunked Transfer Encoding size in bytes | 32 KiB |
Returns application/json
output from ffmpeg -version
Argument | Description | Default |
---|---|---|
- |
n/a | n/a |
Returns image/jpeg
thumbnail from a beginning of video
Argument | Description | Default |
---|---|---|
url |
source video url | n/a |
Returns video/webm
stream
Argument | Description | Default |
---|---|---|
url |
source video url | n/a |
Returns video/webm
stream animated gif style preview
Argument | Description | Default |
---|---|---|
url |
source video url | n/a |
Returns application/json
stream of ffprobe
metadata
Argument | Description | Default |
---|---|---|
url |
source video url | n/a |
Run
flake8 --max-line-length=120 server.py
- Proper error handling
- Parameterize endpoints
- Watermark thumbnails
- Proper logger
- Authorization
- DRY Refactor
ffmpeg
transcoding can continue despite losing client connection