Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/-add--feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: "[ADD] Feature request"
about: Suggest an idea for this project
title: "[ADD] "
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/-bug--.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: "[BUG] "
about: Create a report to help us improve
title: "[BUG] "
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment**

**Additional context**
Add any other context about the problem here.
62 changes: 62 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Create and publish Docker image

on:
push:
branches: [ 'bambu' ]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
environment: production
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM python:3.9-slim

WORKDIR /app

# Klonen des neuesten Codes aus dem GitHub Repository
RUN apt-get update \
&& apt-get install -y git libjpeg-dev zlib1g-dev gcc \
&& git clone -b bambu https://github.com/synman/webcamd.git /app \
&& apt-get purge -y --auto-remove git \
&& rm -rf /var/lib/apt/lists/*

# Installieren der benötigten Python-Bibliothek
RUN pip install --upgrade pip
RUN pip install pillow

# Expose the default port for the HTTP server
EXPOSE 8080

# Verwendung eines Inline-Shell-Skripts zur kontrollierten Übergabe von Umgebungsvariablen
CMD exec python webcam.py \
--hostname "${HOSTNAME:-localhost}" \
$( [ -n "${PASSWORD}" ] && echo "--password ${PASSWORD}" ) \
$( [ -n "${WIDTH}" ] && echo "--width ${WIDTH}" ) \
$( [ -n "${HEIGHT}" ] && echo "--height ${HEIGHT}" ) \
$( [ -n "${IPV}" ] && echo "--ipv ${IPV}" ) \
$( [ -n "${V4BINDADDRESS}" ] && echo "--v4bindaddress ${V4BINDADDRESS}" ) \
$( [ -n "${V6BINDADDRESS}" ] && echo "--v6bindaddress ${V6BINDADDRESS}" ) \
$( [ -n "${PORT}" ] && echo "--port ${PORT}" ) \
$( [ -n "${ENCODEWAIT}" ] && echo "--encodewait ${ENCODEWAIT}" ) \
$( [ -n "${STREAMWAIT}" ] && echo "--streamwait ${STREAMWAIT}" ) \
$( [ -n "${ROTATE}" ] && echo "--rotate ${ROTATE}" ) \
$( [ -n "${SHOWFPS}" ] && echo "--showfps" ) \
$( [ -n "${LOGHTTP}" ] && echo "--loghttp" )
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ In addition to Christopher RYU's <software-github@disavowed.jp> baseline additio

Bambu Printer support is based on proof of concept work found in bambulab/BambuStudio#1536 (comment) that were later optimized in [pybambu](https://github.com/greghesp/pybambu).

## Docker installation
1. Clone this repository `git clone -b bambu https://github.com/MrDrache333/webcamd`
2. Change Environment Parameters in `docker-compose.yml`
3. Start up the Container with `docker-compose up -d`


## Dependencies
```
pip install pillow
Expand Down
21 changes: 21 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3.5'

services:
webcam:
build: .
environment:
HOSTNAME: "192.168.178.X"
PASSWORD: "1234567890"
WIDTH: 1920
HEIGHT: 1080
IPV: 4
V4BINDADDRESS: 0.0.0.0
V6BINDADDRESS: "::"
PORT: 8080
ENCODEWAIT: ""
STREAMWAIT: ""
ROTATE: 0
SHOWFPS: "false"
LOGHTTP: "false"
ports:
- "8080:8080"