Update docs and workflow

This commit is contained in:
Fredrik Baberg 2023-03-16 12:25:01 +01:00
parent 89af99ed6c
commit 8cb23d7492
4 changed files with 60 additions and 37 deletions

54
.github/workflows/camera-ustreamer.yml vendored Normal file
View File

@ -0,0 +1,54 @@
name: camera-ustreamer manual build
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
name: Build ${{ matrix.arch }} ${{ matrix.addon }} add-on
strategy:
matrix:
addon: ["camera-ustreamer"]
arch: ["aarch64", "amd64", "armhf", "armv7", "i386"]
steps:
- name: Check out the repository
uses: actions/checkout@v3
- name: Get information
id: info
uses: home-assistant/actions/helpers/info@master
with:
path: "./${{ matrix.addon }}"
- name: Check if add-on should be built
id: check
run: |
if [[ "${{ steps.info.outputs.architectures }}" =~ ${{ matrix.arch }} ]]; then
echo "::set-output name=build_arch::true";
echo "::set-output name=image::$(echo ${{ steps.info.outputs.image }} | cut -d'/' -f3)";
else
echo "${{ matrix.arch }} is not a valid arch for ${{ matrix.addon }}, skipping build";
echo "::set-output name=build_arch::false";
fi
- name: Login to GitHub Container Registry
if: env.BUILD_ARGS != '--test'
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build ${{ matrix.addon }} add-on
if: steps.check.outputs.build_arch == 'true'
uses: home-assistant/builder@2023.03.0
with:
args: |
${{ env.BUILD_ARGS }} \
--${{ matrix.arch }} \
--target /data/${{ matrix.addon }} \
--image "${{ steps.check.outputs.image }}" \
--docker-hub "ghcr.io/${{ github.repository_owner }}" \
--addon \
--docker-hub-check

View File

@ -1,36 +1,3 @@
# Documentation
## Configuration
- `mjpg_input`: Specify input arguments for mjpg_streamer.
## How to use
Set input arguments through `mjpg_input` configuration option, start the add-on.
## Accessing camera from Home Assistant
The camera stream and snapshot can be accessed by e.g. [MJPEG IP Camera](https://www.home-assistant.io/integrations/mjpeg/), with URLs:
* MJPEG URL: `http://<addon-hostname>/?action=stream`
* Still image URL: `http://<addon-hostname>/?action=snapshot`.
Addon hostname can be found under [addon settings](https://my.home-assistant.io/redirect/supervisor_addon/?addon=b7aa59c4_camera-mjpg-streamer&repository_url=https%3A%2F%2Fgithub.com%2Ffredrikbaberg%2Fha-3dprinter-addons).
## Ingress?
Ingress support is included only to verify that the camera can be accessed. Streaming will most likely only work in the "JavaScript" tab.
## Testing
For testing you can set `mjpg_input` to:
> input_file.so -f /www_mjpg -e
This will result in showing a test image.
## Versions
Some notes regarding the software and versions.
Not all software is installed for all images.
- mjpg-streamer
- Compiled from [https://github.com/jacksonliam/mjpg-streamer](https://github.com/jacksonliam/mjpg-streamer).
@TODO

View File

@ -1,5 +1,7 @@
# mjpg-streamer
# ustreamer
Provides camera stream through `mjpg-streamer`, to be used by e.g. OctoPrint addon.
**Work in progress!**
Provides camera stream through `ustreamer`, to be used by e.g. OctoPrint addon.
Instructions are provided in the tab "Docs".

View File

@ -25,4 +25,4 @@ ports_description:
# mjpg_input: "input_uvc.so -n"
# schema:
# mjpg_input: "str"
# image: ghcr.io/fredrikbaberg/ha-addon-camera-ustreamer-{arch}
image: ghcr.io/fredrikbaberg/ha-addon-camera-ustreamer-{arch}