Skip to content

The MJPEG stream stops until a restart #2292

@almirus

Description

@almirus

When an RTSP error occurs, the service does not restart.


11:33:02,821 | info | go2rtc version=1.9.14 platform=linux/amd64 revision=b5948cf
-- | -- | --
11:33:02,821 | info | config path=/go2rtc.yaml
11:33:02,822 | info | [api] listen addr=:1984
11:33:02,822 | info | [rtsp] listen addr=:8554
11:33:02,822 | info | [webrtc] listen tcp addr=[::]:8555
11:33:02,823 | info | [webrtc] listen udp addr=192.168.0.154:8555
11:33:52,115 | error | undefined error=streams: exec/pipe: EOF[h264 @ 0x570fa39cd880] non-existing PPS 0 referencedLast message repeated 1 times[h264 @ 0x570fa39cd880] decode_slice_header error[h264 @ 0x570fa39cd880] no frame![h264 @ 0x570fa39cd880] non-existing PPS 0 referencedLast message repeated 1 times[h264 @ 0x570fa39cd880] decode_slice_header error[h264 @ 0x570fa39cd880] no frame![h264 @ 0x570fa39cd880] non-existing PPS 0 referencedLast message repeated 1 times[h264 @ 0x570fa39cd880] decode_slice_header error[h264 @ 0x570fa39cd880] no fra... caller=github.com/AlexxIT/go2rtc/internal/streams/streams.go:47
11:34:23,021 | warn | undefined error=EOF url=ffmpeg:rtsp://192.168.0.198:8554/720p#video=mjpeg#hardware#raw=-vf crop=iw-310:ih:155:0 -q:v 4 -r 15 caller=github.com/AlexxIT/go2rtc/internal/streams/producer.go:170

config(version: 1.9.14 / config: /go2rtc.yaml)

api:
  username: "admin"  # default "", Basic auth for WebUI
  password: "admin"   # default "", Basic auth for WebUI
preload:
  door_bell_mjpeg: "video" 
streams:
  door_bell: rtsp://192.168.0.198:8554/720p
  door_bell_mjpeg: 
    - ffmpeg:rtsp://192.168.0.198:8554/720p#video=mjpeg#hardware#raw=-vf crop=iw-310:ih:155:0 -q:v 4 -r 15

An unstable RTSP stream may be the cause.

{
  "producers": [
    {
      "id": 37,
      "format_name": "mjpeg",
      "protocol": "pipe",
      "remote_addr": "192.168.0.198:8554",
      "source": "exec:ffmpeg -hide_banner -v error -allowed_media_types video -fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_flags prefer_tcp -i rtsp://192.168.0.198:8554/720p -vf crop=iw-310:ih:155:0 -q:v 4 -r 15 -c:v mjpeg -an -f mjpeg -",
      "url": "rtsp://192.168.0.198:8554/720p",
      "medias": [
        "video, recvonly, JPEG"
      ],
      "receivers": [
        {
          "id": 38,
          "codec": {
            "codec_name": "mjpeg",
            "codec_type": "video"
          },
          "childs": [
            39
          ]
        }
      ]
    }
  ],
  "consumers": [
    {
      "id": 36,
      "format_name": "probe",
      "protocol": "http",
      "remote_addr": "192.168.0.63:23655",
      "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36",
      "medias": [
        "video, sendonly, ALL",
        "audio, sendonly, ALL",
        "audio, recvonly, ANY"
      ],
      "senders": [
        {
          "id": 39,
          "codec": {
            "codec_name": "mjpeg",
            "codec_type": "video"
          },
          "parent": 38
        }
      ]
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions