hpaolini / tiny-nvr

Docker container to capture IP camera streams
https://hub.docker.com/r/hpaolini/tiny-nvr
52 stars 36 forks source link

How to record discontinuous rtsp stream? #4

Open smshr opened 3 years ago

smshr commented 3 years ago

I am trying to use this docker image with kubernetes. However the pod repeatedly goes into CrashLoopBackOff. I think this is due to the fact that my camera doesn't sends continuous feed (can be configured to, but don't want to). It only sends events video feed through rstp, i.e only when any activity is detected. When there is no activity, there is no feed and the pod errors out after some time leading to restart. The pod however records and saves the file when it is running and if there is any activity at that time.

My assessment may be incorrect. Any clue why the pod keeps restarting continuously. Following is the deployment yaml file.

kind: Deployment
apiVersion: apps/v1
metadata:
  name: rtsp
spec:
  replicas: 1
  selector:
    matchLabels:
      app: rtsp
  template:
    metadata:
      labels:
        app: rtsp
    spec:
      containers:
      - name: rtsp
        image: hpaolini/tiny-nvr
        # command: ["/docker-entrypoint.sh"]
        args: ["rtsp://192.168.1.127:554//live0", "My Room"]
        env:
        - name: PGID
          value: "1000"
        - name: PUID
          value: "1000"
        - name: TZ
          value: "America/New_York"
        - name: DIR_NAME_FORCE
          value: "true"
        - name: HOUSEKEEP_DAYS
          value: "30"
        - name: VIDEO_SEGMENT_TIME
          value: "900"
        - name: VIDEO_FORMAT
          value: mkv
        volumeMounts:
        - name: rtsp-volume
          mountPath: /usr/data/recordings
      volumes:
      - name: rtsp-volume
        hostPath:
          path: /mnt/recordings

Thanks.

Alex2357 commented 1 year ago

@smshr did you figure out how to do this? If yes, please provide some info. Many thanks in advance