Skip to content

Instantly share code, notes, and snippets.

@unbelauscht
Last active June 19, 2024 19:52
Show Gist options
  • Save unbelauscht/c53ea22c150ac8f4825ee52eb894f3cd to your computer and use it in GitHub Desktop.
Save unbelauscht/c53ea22c150ac8f4825ee52eb894f3cd to your computer and use it in GitHub Desktop.
Streaming a webcam to Owncast using ffmpeg & k3s
apiVersion: apps/v1
kind: Deployment
metadata:
name: weedcam-live-ffmpeg
namespace: default
spec:
strategy:
type: Recreate
template:
metadata:
namespace: default
spec:
containers:
- args:
- '-f'
- lavfi
- '-i'
- anullsrc
- '-f'
- mjpeg
- '-re'
- '-r'
- '5'
- '-i'
- http://{{webcamip}}:{{webcamport}}
- '-c:v'
- h264
- '-preset'
- fast
- '-b:v'
- 800k
- '-c:a'
- aac
- '-f'
- flv
- rtmp://{{yourowncastinstance}}:1935/live/{{streamkey}}
image: linuxserver/ffmpeg
imagePullPolicy: IfNotPresent
name: ffmpeg
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
- command:
- sleep
- '604800'
image: curlimages/curl
name: healthcheck
readinessProbe:
exec:
command:
- sh
- '-c'
- >-
apk -U add jq; curl -Ssq
https://{yourowncastinstance}}/api/status | jq --exit-status
.online
failureThreshold: 5
initialDelaySeconds: 20
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 5
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: false
runAsNonRoot: false
runAsUser: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment