home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.95k stars 31.01k forks source link

Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input #72301

Open gamer06 opened 2 years ago

gamer06 commented 2 years ago

The problem

Hello everybody,

I've had this error for some time, but with the last updates it got worse... I have a D-Link DCS-8200LH camera and I access it through the App for android and I can also use vlc "rtsp://user:pwd@IP:PORT/play2.sdp "

image

image

What makes this error appear? Or how can I solve?

Thank you very much

What version of Home Assistant Core has the issue?

Core 2022.5.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Core

Integration causing the issue

Stream

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

#default_config:
config:
hassio:
ffmpeg:
stream:
  ll_hls: true
  part_duration: 0.75
  segment_duration: 6

Anything in the logs that might be useful for us?

No response

Additional information

Home Assistant Core 2022.5.5 Home Assistant Supervisor 2022.05.2

probot-home-assistant[bot] commented 2 years ago

stream documentation stream source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @hunterjm, @uvjustin, @allenporter, mind taking a look at this issue as it has been labeled with an integration (stream) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

uvjustin commented 2 years ago

This is most likely an issue with your camera and/or networking setup and not with HA. Unfortunately your camera is WiFi and from D-Link doesn't seem to have very good RTSP support in firmware, and these points further corroborate that hypothesis. This similar issue https://github.com/home-assistant/core/issues/67386 was traced back to problems with camera transport, but this might be different from your issue as those users seem to not have had the cameras working at all when getting this error, while you may or may not have things working. (It's unclear from your issue whether you've previously had it working or not: you have not listed a prior working version which would lead me to assume it never worked, but then you've indicated that it's a problem that got worse which means it may have worked previously.) You can try adjusting RTSP protocols to see if that helps the issue. Otherwise, try opening your camera stream with ffplay to see if the same issue manifests itself.

KitHubek commented 2 years ago

the same error here:

Logger: homeassistant.components.stream.stream.camera.peephole_high
Source: components/stream/__init__.py:416
Integration: Stream (documentation, issues)
First occurred: 10:32:54 (8 occurrences)
Last logged: 10:37:35

Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsps://IPADDR:PORT/streamaddr

Iam testing Tuya peephole cam Stream via Tuya app working ok, via HA working fine. I see that problem is with date/time. I cant set via HA correct time. This button not working. Set correct data/time working only via tuya app.

Adnotacja 2022-08-10 104411

codyc1515 commented 1 year ago

Similarly facing the same issue with a TP-Link C200 camera intermittently.

Logger: homeassistant.components.stream.stream.camera.dining_room_camera_mainstream
Source: components/stream/__init__.py:434 
Integration: Stream (documentation, issues) 
First occurred: 9:47:53 PM (6 occurrences) 
Last logged: 9:50:49 PM

Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsp://****:****@192.168.XXX.XXX:554/stream1
rtyk commented 1 year ago

Same issue with all cameras hosted through frigate (Wyze (rtsp), Amcrest, Foscam)

Logger: homeassistant.components.stream.stream.camera.driveway Source: components/stream/init.py:434 Integration: Stream (documentation, issues) First occurred: 9:53:21 AM (1 occurrences) Last logged: 9:53:21 AM Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) http://x.x.x.x:5000

ecodina commented 1 year ago

I've a similar issue. I must say, the same camera used to work last year when configuration was done through the YAML. Once I migrated to configuring through the UI I have never been able to see it again. The log shows the same error as above.

I use Home Assistant Container, using the docker-compose file in your documentation. Here comes the strange part: I have accessed the running container and I can actually see the camera!

Inside the container

  1. Take a "screenshot":
hass:/config# ffmpeg -y -i rtsp://****:****@X.X.X.X:554/onvif1 -vframes 1 do.jpg
ffmpeg version 5.1.3 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12.2.1 (Alpine 12.2.1_git20220924-r4) 20220924
  configuration: --prefix=/usr --enable-avfilter --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libpulse --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-libdav1d --enable-lto --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --enable-librist --enable-libsrt --enable-libssh --enable-libvidstab --disable-stripping --disable-static --disable-librtmp --disable-lzma --enable-libaom --enable-libopus --enable-libsoxr --enable-libwebp --enable-vaapi --enable-vdpau --enable-vulkan --enable-libdrm --enable-libzmq --optflags=-O2 --disable-debug
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Input #0, rtsp, from 'rtsp://****:****@X.X.X.X:554/onvif1':
  Metadata:
    title           : H.264 Video, RtspServer_0.0.0.2
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 1920x1080, 15 tbr, 90k tbn
  Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
Output #0, image2, to 'do.jpg':
  Metadata:
    title           : H.264 Video, RtspServer_0.0.0.2
    encoder         : Lavf59.27.100
  Stream #0:0: Video: mjpeg, yuvj420p(pc, bt709, progressive), 1920x1080, q=2-31, 200 kb/s, 15 fps, 15 tbn
    Metadata:
      encoder         : Lavc59.37.100 mjpeg
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
[image2 @ 0x7fa0e546b0] The specified filename 'do.jpg' does not contain an image sequence pattern or a pattern is invalid.
[image2 @ 0x7fa0e546b0] Use a pattern such as %03d for an image sequence or use the -update option (with -frames:v 1 if needed) to write a single image.
frame=    1 fps=0.0 q=7.6 Lsize=N/A time=00:00:00.06 bitrate=N/A speed=0.235x
video:78kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

do.jpg actually contains the image.

  1. Start streaming:
hass:/config# ffplay rtsp://****:****@X.X.X.X:554/onvif1 -loglevel verbose
ffplay version 5.1.3 Copyright (c) 2003-2022 the FFmpeg developers
  built with gcc 12.2.1 (Alpine 12.2.1_git20220924-r4) 20220924
  configuration: --prefix=/usr --enable-avfilter --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libpulse --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-libdav1d --enable-lto --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --enable-librist --enable-libsrt --enable-libssh --enable-libvidstab --disable-stripping --disable-static --disable-librtmp --disable-lzma --enable-libaom --enable-libopus --enable-libsoxr --enable-libwebp --enable-vaapi --enable-vdpau --enable-vulkan --enable-libdrm --enable-libzmq --optflags=-O2 --disable-debug
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
Failed to initialize a hardware accelerated renderer: Couldn't find matching render driver
Initialized software renderer.
[tcp @ 0x7fb051eb30] Starting connection attempt to X.X.X.X port 554
[tcp @ 0x7fb051eb30] Successfully connected to X.X.X.X port 554
[rtsp @ 0x7fae820070] SDP:0 aq=    0KB vq=    0KB sq=    0B f=0/0
v=0
o=- 1421069297525233 1 IN IP4 X.X.X.X
s=H.264 Video, RtspServer_0.0.0.2
t=0 0
a=tool:RtspServer_0.0.0.2
a=type:broadcast
a=control:*
a=range:npt=0-
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:500
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=42001F;sprop-parameter-sets=Z0IAH5WoFAFuQA==,aM48gA==
a=control:track1
m=audio 0 RTP/AVP 8
a=control:track2
a=rtpmap:8 PCMA/8000

[rtsp @ 0x7fae820070] setting jitter buffer size to 500  0B f=0/0
[rtsp @ 0x7fae820070] setting jitter buffer size to 500  0B f=0/0
[h264 @ 0x7faf22a860] Reinit context to 1920x1088, pix_fmt: yuvj420p
Input #0, rtsp, from 'rtsp://****:****@X.X.X.X:554/onvif1':
  Metadata:
    title           : H.264 Video, RtspServer_0.0.0.2
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: h264 (High), 1 reference frame, yuvj420p(pc, bt709, progressive, left), 1920x1080 (1920x1088), 15 tbr, 90k tbn
  Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
[ffplay_abuffer @ 0x7fae8e6a10] tb:1/8000 samplefmt:s16 samplerate:8000 chlayout:mono
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5703:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM default
SDL_OpenAudio (1 channels, 8000 Hz): ALSA: Couldn't open audio device: No such file or directory
No more combinations to try, audio open failed
[h264 @ 0x7fae92cbb0] Reinit context to 1920x1088, pix_fmt: yuvj420p
[ffplay_buffer @ 0x7fae8e6b90] w:1920 h:1080 pixfmt:yuvj420p tb:1/90000 fr:15/1 sar:0/1
[auto_scale_0 @ 0x7faf769b30] w:iw h:ih flags:'' interl:0
[ffplay_buffersink @ 0x7faf769a80] auto-inserting filter 'auto_scale_0' between the filter 'ffplay_buffer' and the filter 'ffplay_buffersink'
[swscaler @ 0x7fabe49040] [swscaler @ 0x7fabdb0050] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fabe49040] [swscaler @ 0x7fabdb0050] No accelerated colorspace conversion found from yuv420p to rgba.
[swscaler @ 0x7fabe49040] [swscaler @ 0x7fabd8c060] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fabe49040] [swscaler @ 0x7fabd8c060] No accelerated colorspace conversion found from yuv420p to rgba.
[swscaler @ 0x7fabe49040] [swscaler @ 0x7fabd58030] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fabe49040] [swscaler @ 0x7fabd58030] No accelerated colorspace conversion found from yuv420p to rgba.
[swscaler @ 0x7fabe49040] [swscaler @ 0x7fabd2c020] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fabe49040] [swscaler @ 0x7fabd2c020] No accelerated colorspace conversion found from yuv420p to rgba.
[swscaler @ 0x7fabe49040] [swscaler @ 0x7fabceb010] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fabe49040] [swscaler @ 0x7fabceb010] No accelerated colorspace conversion found from yuv420p to rgba.
[auto_scale_0 @ 0x7faf769b30] w:1920 h:1080 fmt:yuvj420p sar:0/1 -> w:1920 h:1080 fmt:rgb0 sar:0/1 flags:0x0
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabdb0060] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabdb0060] No accelerated colorspace conversion found from yuv420p to rgba.
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabd8c070] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabd8c070] No accelerated colorspace conversion found from yuv420p to rgba.
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabd58040] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabd58040] No accelerated colorspace conversion found from yuv420p to rgba.
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabd2c020] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabd2c020] No accelerated colorspace conversion found from yuv420p to rgba.
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabceb010] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabceb010] No accelerated colorspace conversion found from yuv420p to rgba.
[auto_scale_0 @ 0x7faf769b30] w:1920 h:1080 fmt:yuvj420p sar:0/1 -> w:1920 h:1080 fmt:rgb0 sar:0/1 flags:0x0
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabdb0060] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabdb0060] No accelerated colorspace conversion found from yuv420p to rgba.
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabd8c070] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabd8c070] No accelerated colorspace conversion found from yuv420p to rgba.
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabd58040] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabd58040] No accelerated colorspace conversion found from yuv420p to rgba.
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabd2c020] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabd2c020] No accelerated colorspace conversion found from yuv420p to rgba.
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabceb010] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabceb010] No accelerated colorspace conversion found from yuv420p to rgba.
[auto_scale_0 @ 0x7faf769b30] w:1920 h:1080 fmt:yuvj420p sar:0/1 -> w:1920 h:1080 fmt:rgb0 sar:0/1 flags:0x0
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabdb0060] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabdb0060] No accelerated colorspace conversion found from yuv420p to rgba.
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabd8c070] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabd8c070] No accelerated colorspace conversion found from yuv420p to rgba.
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabd58040] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabd58040] No accelerated colorspace conversion found from yuv420p to rgba.
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabd28030] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabd28030] No accelerated colorspace conversion found from yuv420p to rgba.
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabceb010] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7fabe49050] [swscaler @ 0x7fabceb010] No accelerated colorspace conversion found from yuv420p to rgba.
[auto_scale_0 @ 0x7faf769b30] w:1920 h:1080 fmt:yuvj420p sar:0/1 -> w:1920 h:1080 fmt:rgb0 sar:0/1 flags:0x0
Created 1920x1080 texture with SDL_PIXELFORMAT_BGR888.   0B f=0/0

Since this is inside a container, I have no window to see the camera. However, the log shows "connected". Moreover, if I try the same command from my laptop, it also shows the same deprecation warnings, but a window appears and I can see the camera in real time.

Outside the container, on my laptop

blueal commented 1 year ago

I am also having this issue with Unifi Protect cameras.

Logger: homeassistant.components.stream.stream.camera.server_rack_low
Source: components/stream/__init__.py:434
Integration: Stream (documentation, issues)
First occurred: 7:59:16 PM (2 occurrences)
Last logged: 7:59:16 PM

Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsps://X.X.X.X:7441/X?enableSrtp=
thorrrr commented 1 year ago

Hi after update yesterday my whole cameras are no longer viewable been working for months with no issue Errors for each camera in logs

MY Hik Vision settings have changed for years

image image

gabriel600r commented 1 year ago

Same error on Dahua Imou cameras Error opening stream (INVALIDDATA, Invalid data found when processing input)

ronjtaylor commented 1 year ago

I have 6 HIKVision cameras that have worked for years and all of a sudden, I have the same problem and it seems to be getting worse. Nothing has changed from what I know except HA?

bcutter commented 1 year ago

Once I switched from the custom reolink to the official reolink integration, my camera streams don't show up anymore too with this in HA log:

Logger: homeassistant.components.stream.stream.camera.name_one
Source: components/stream/__init__.py:434
Integration: Stream (documentation, issues)
First occurred: 5. November 2023 um 04:13:52 (405 occurrences)
Last logged: 11:46:04

Error from stream worker: Error opening stream (ERRORTYPE_5, I/O error) rtmp://xxx.xxx.xxx.xxx:1935/bcs/channel0_sub.bcs?channel=0&stream=1&user=****&password=****
Error from stream worker: Error opening stream (EOF, End of file) https://xxx.xxx.xxx.xxx:443/flv?port=1935&app=bcs&stream=channel0_sub.bcs&user=****&password=****
Error from stream worker: Error opening stream (ERRORTYPE_110, Operation timed out) rtmp://xxx.xxx.xxx.xxx:1935/bcs/channel0_sub.bcs?channel=0&stream=1&user=****&password=****

(created https://github.com/home-assistant/core/issues/103495)

hotswapster commented 11 months ago

I have this same issue with a Swann DVR. My cameras were working fine until about September. The stills are updating fine. But the streams are broken.

Camera streams still work from VLC.

Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsp://****:****@cctv.my.domain:554/ch01/0

I get this error for all 5 cameras.

I have tried changing RSTP Transport Protocol but it times out every time. I removed the user:pass from the URL, the the URL timed out and then the errors changed to:

Error from stream worker: Error opening stream (ERRORTYPE_5, I/O error) rtsp://****:****@cctv.my.domain:554/ch01/0
Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsp://****:****@cctv.mt.domain:554/ch01/0
Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsp://****:****@cctv.my.domain:554/ch02/1
SirIcemann commented 10 months ago

I have the similarly errror: it works right after restart but not after a day.

Udklip

and

Logger: pyaarlo Source: custom_components/aarlo/pyaarlo/init.py:724 Integration: Arlo Camera Support (documentation, issues) First occurred: 31. december 2023 kl. 16.37.43 (6 occurrences) Last logged: 13.33.56

error in response={'success': False, 'data': {'error': '2027', 'message': 'The request for recordings is invalid.', 'reason': 'Device[{}] is not allowed for taking snapshot as it requires paid subscription for cloud storage', 'details': 'A5D21572A2A4A'}}

e2m4n commented 10 months ago

This error comes from ffmpeg, not home assistant. In the troubleshooting section of the ffmpeg integration's documentation it says:

First, check that your stream is playable by ffmpeg outside of Home Assistant with (use option -an or -vn to disable video or audio stream):

ffmpeg -i INPUT -an -f null -

Instead run ffmpeg -i INPUT -an -f null -loglevel trace - to get some more detail.

Here's what I get from a previously-working web camera running on an old ipod touch:

Opening an input file: http://10.0.0.206:8081/.
[NULL @ 0x555634915220] Opening 'http://10.0.0.206:8081/' for reading
[http @ 0x5556348db180] Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto,httpproxy,data'
[tcp @ 0x5556348db100] Original list of addresses:
[tcp @ 0x5556348db100] Address 10.0.0.206 port 8081
[tcp @ 0x5556348db100] Interleaved list of addresses:
[tcp @ 0x5556348db100] Address 10.0.0.206 port 8081
[tcp @ 0x5556348db100] Starting connection attempt to 10.0.0.206 port 8081
[tcp @ 0x5556348db100] Successfully connected to 10.0.0.206 port 8081
[http @ 0x5556348db180] request: GET / HTTP/1.1
User-Agent: Lavf/59.27.100
Accept: */*
Range: bytes=0-
Connection: close
Host: 10.0.0.206:8081
Icy-MetaData: 1

[http @ 0x5556348db180] header='HTTP/1.1 200 OK'
[http @ 0x5556348db180] http_code=200
[http @ 0x5556348db180] header='Server: MiniWebCam/1.0 (iOS)'
[http @ 0x5556348db180] header='Pragma: no-cache'
[http @ 0x5556348db180] header='Content-Type: multipart/x-mixed-replace;boundary=WebCamImage'
[http @ 0x5556348db180] header=''
Probing mpjpeg score:0 increased to 75 due to MIME type
[mpjpeg @ 0x555634915220] Format mpjpeg probed with size=2048 and score=75
[AVIOContext @ 0x5556348d2c00] Statistics: 2915 bytes read, 0 seeks
http://10.0.0.206:8081/: Invalid data found when processing input

The stream works in a browser but ffmpeg doesn't like it, even though it's apparently probed its format correctly.

I haven't been able to find a solution yet, but might try downgrading ffmpeg to see if an older version works for me (I reason that because it used to work, some change in a recent version has caused this bug)

e2m4n commented 10 months ago

I have the similarly errror: it works right after restart but not after a day.

Logger: pyaarlo Source: custom_components/aarlo/pyaarlo/init.py:724 Integration: Arlo Camera Support (documentation, issues) First occurred: 31. december 2023 kl. 16.37.43 (6 occurrences) Last logged: 13.33.56

error in response={'success': False, 'data': {'error': '2027', 'message': 'The request for recordings is invalid.', 'reason': 'Device[{}] is not allowed for taking snapshot as it requires paid subscription for cloud storage', 'details': 'A5D21572A2A4A'}}

Your error is not related to this issue.

The error message you pasted clearly states the problem: "Device[{}] is not allowed for taking snapshot as it requires paid subscription for cloud storage"

If you have paid, or don't believe that you have to pay, then check the issues of that project https://github.com/twrecked/hass-aarlo/issues

hotswapster commented 9 months ago

I have this same issue with a Swann DVR. My cameras were working fine until about September. The stills are updating fine. But the streams are broken.

Camera streams still work from VLC.

Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsp://****:****@cctv.my.domain:554/ch01/0

I get this error for all 5 cameras.

I have tried changing RSTP Transport Protocol but it times out every time. I removed the user:pass from the URL, the the URL timed out and then the errors changed to:

Error from stream worker: Error opening stream (ERRORTYPE_5, I/O error) rtsp://****:****@cctv.my.domain:554/ch01/0
Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsp://****:****@cctv.mt.domain:554/ch01/0
Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsp://****:****@cctv.my.domain:554/ch02/1

As @e2m4n suggested, I've followed the ffmpeg troubleshooting by streaming with ffmpeg outside of home assistant. It appeared to work (although there were a couple of errors). Here is the output:

~$ ffmpeg -i rtsp://****:****@cctv.my.domain:554/ch05/0 -an -f null -
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  WARNING: library configuration mismatch
  avcodec     configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libaribb24 --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc --enable-libsmbclient
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
[rtsp @ 0x555af436d7c0] getaddrinfo(cctv.my.domain): Name or service not known
[rtsp @ 0x555af436d7c0] max delay reached. need to consume packet
[rtsp @ 0x555af436d7c0] RTP: missed 262 packets
[h264 @ 0x555af43751c0] error while decoding MB 88 71, bytestream -20
[h264 @ 0x555af43751c0] concealing 8121 DC, 8121 AC, 8121 MV errors in I frame
[rtsp @ 0x555af436d7c0] max delay reached. need to consume packet
[rtsp @ 0x555af436d7c0] RTP: missed 134 packets
[h264 @ 0x555af43751c0] error while decoding MB 24 70, bytestream -5
[h264 @ 0x555af43751c0] concealing 8345 DC, 8345 AC, 8345 MV errors in I frame
Input #0, rtsp, from 'rtsp://****:****@cctv.my.domain:554/ch05/0':
  Duration: N/A, start: 0.647000, bitrate: N/A
  Stream #0:0: Video: h264 (High), yuv420p(progressive), 2560x1944, 20.08 tbr, 90k tbn, 180k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
[h264 @ 0x555af43b13c0] error while decoding MB 88 71, bytestream -20
[h264 @ 0x555af43b13c0] concealing 8121 DC, 8121 AC, 8121 MV errors in I frame
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf58.76.100
  Stream #0:0: Video: wrapped_avframe, yuv420p(progressive), 2560x1944, q=2-31, 200 kb/s, 20.08 fps, 20.08 tbn
    Metadata:
      encoder         : Lavc58.134.100 wrapped_avframe
frame=    1 fps=0.0 q=-0.0 size=N/A time=00:00:00.04 bitrate=N/A speed=0.569x   [h264 @ 0x555af4fad040] error while decoding MB 24 70, bytestream -5
[h264 @ 0x555af4fad040] concealing 8345 DC, 8345 AC, 8345 MV errors in I frame
frame=  210 fps= 12 q=-0.0 Lsize=N/A time=00:00:18.87 bitrate=N/A speed=1.09x    
video:110kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Exiting normally, received signal 2.
:~$ 

These cameras used to work and I never changed the configuration in home assistant, they just stopped streaming one day. The still images will load fine. I can stream using VLC player with no dramas. I'm not real clused up in these areas so hopefully this info can help someone diagnose the problems.

edit1: Copilot says these errors indicate I have network latency issues. edit2: trying the above ffmpeg command mutiple times has resulted in receiving the invalid data found when processing input message from a separate computer. It appears that it is not consistent. edit3: changed ethernet adapters on local PC and no longer get any errors. HASS on Hass OS still doesn't work. edit4: I fixed it, but my fix may not work for others. My HASS was on VLAN 40 and CCTV on VLAN 50. routing was working but it appears the router was dropping packets and ffmpeg didn't like it. I added another adapter on VLAN 50 to my HASS install and i'm not dropping packets anymore. This might be a best practise thing anyway? I don't know.

GertJanArts commented 9 months ago

same problem here, after a screen refresh everything works again (for some time...) image

sanemanmad commented 9 months ago

Same error as well. Using frigate.

Logger: homeassistant.components.stream.stream.camera.camera_2
Source: components/stream/__init__.py:431
Integration: Stream (documentation, issues)
First occurred: February 9, 2024 at 7:01:03 PM (82 occurrences)
Last logged: 4:21:28 AM

Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsp://frigate.xxxxxxxxx.com:8554/camera_2
sanemanmad commented 9 months ago

Same error as well. Using frigate.

Logger: homeassistant.components.stream.stream.camera.camera_2
Source: components/stream/__init__.py:431
Integration: Stream (documentation, issues)
First occurred: February 9, 2024 at 7:01:03 PM (82 occurrences)
Last logged: 4:21:28 AM

Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsp://frigate.xxxxxxxxx.com:8554/camera_2

Doing a little googling this morning and came across this reddit thread which the OP responded their issue was resolved after making an unidentified change using the example linked in one of the replies HERE. In my example, I had one camera configured differently than the others, which were not erroring out.

I do not recall the exact reason for the one-off change although it was due to an issue with an older version of Frigate, which appears to have been resolved in subsequent updates.

The point of all this, is that after updating the one-off settings under gortc streams all is fine.

Old:

go2rtc:
  streams:
    camera_2:
    - rtsp://xxxx:xxxxxx@x.x.x.x:554/Streaming/Channels/101/?transportmode=unicast
    - ffmpeg:camera_2

New:

go2rtc:
  streams:
    camera_2:
    - rtsp://xxxx:xxxxxx@x.x.x.x:554/Streaming/Channels/101
    - ffmpeg:camera_2
olli711 commented 9 months ago

Edit: I installed a backup before the HA update yesterday, no message since then.

Hi, the same problem with me. The camera has been running without problems since the setup two months ago. Since the last HoneAssistant update, I installed yesterday, I have this error message. I use MotionEye, the camera is some no name product

` Logger: homeassistant.components.stream.stream.camera.192_168_178_98 Source: components/stream/init.py:431 Integration: Stream (documentation, issues) First occurred: 09:01:14 (1 occurrences) Last logged: 09:01:14

Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsp://:@192.168.178.98:554/22 `

redstar2k1 commented 9 months ago

Logger: homeassistant.components.stream.stream.camera.dahua_profile001 Source: components/stream/init.py:431 Integration: Stream (documentation, issues) First occurred: 20:25:17 (2 occurrences) Last logged: 20:25:28

Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsp://:@192.168.0.247:554/cam/realmonitor?channel=1&subtype=1&unicast=true&proto=Onvif

Camera DH-SD2A500HB-GN-AW-PV-0400-S2 by Dahua

VLC can play the stream. home-assistant_onvif_2024-02-28T18-30-32.669Z.log

olli711 commented 8 months ago

With me, the mistake is back

Logger: homeassistant.components.stream.stream.camera.192_168_178_98 Source: components/stream/init.py:431 Integration: Stream (documentation, issues) First occurred: 1. März 2024 um 18:33:40 (3 occurrences) Last logged: 08:17:29

Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsp://:@192.168.178.98:554/22 Error from stream worker: Error demuxing stream: [Errno 110] Operation timed out: 'rtsp://xxxxx@192.168.178.98:554/22' Error from stream worker: Error demuxing stream: [Errno 110] Operation timed out: 'rtsp://xxxxxx@192.168.178.98:554/22'; last error log: [NULL] reference count 1 overflow

mircoparonetto commented 7 months ago

I have the same problem, some clue?

oopiicaa commented 7 months ago

This appeared in my logs after updating to 2024.4 Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsps://****:****@aws-tractor2.tuyaeu.com:443/v1/proxy/echo_show/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

This is Tuya Doorbell with camera - camera is only active when somebody rings.

MassiPi commented 7 months ago

eventually this error came out also for my foscam cameras did they touch something in 2024.4?

M3Power95 commented 7 months ago

Same issue for me using Aarlo HACS integration for Arlo Pro 4 cameras. Running Core 2024.4.3 on ProxMox, and after HA restart I have no issues. However after anywhere between 10-48 hours of uptime on HA, I can no longer access any of my 3 Arlo cameras and I get the same INVALIDDATA RTSP error.

bonstio commented 5 months ago

Adding my name too. I had a Ring camera working fine until a recent update. Now I see "Error from stream worker: Error opening stream".

ganjakyp-hub commented 4 months ago

I have the same problem, the camera works through VLС

MassiPi commented 4 months ago

nice to see no developer is interested :) it would be nice to try if the installed version of python AV is able to open the stream or not, anyone knows how to connect to the underlying python env to test some commands?

e2m4n commented 4 months ago

nice to see no developer is interested :) it would be nice to try if the installed version of python AV is able to open the stream or not, anyone knows how to connect to the underlying python env to test some commands?

Have you tried calling ffmpeg directly to as per my post https://github.com/home-assistant/core/issues/72301#issuecomment-1898990750 ?

MassiPi commented 4 months ago

stupid me, i'll try as soon as i get home this evening.. i thought ffmpeg was embedded in pypi AV (stupid me again). Because yesterday i tried just AV on another system and it did not give me errors opening the stream.. thanks!

MassiPi commented 4 months ago

nice to see no developer is interested :) it would be nice to try if the installed version of python AV is able to open the stream or not, anyone knows how to connect to the underlying python env to test some commands?

Have you tried calling ffmpeg directly to as per my post #72301 (comment) ?

Well, at least i'm not seeing "INVALIDDATA" coming from ffmpeg, but i can't understand more :) I'm on: OS Version: Home Assistant OS 12.4 Home Assistant Core: 2024.6.4

This is the output of a valid Foscam RTSP stream:

ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 13.2.1 (Alpine 13.2.1_git20231014) 20231014
  configuration: --prefix=/usr --disable-librtmp --disable-lzma --disable-static --disable-stripping --enable-avfilter --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-libmp3lame --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librist --enable-libsoxr --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-lto=auto --enable-lv2 --enable-openssl --enable-pic --enable-postproc --enable-pthreads --enable-shared --enable-vaapi --enable-vdpau --enable-version3 --enable-vulkan --optflags=-O3 --enable-libjxl --enable-libsvtav1 --enable-libvpl
  libavutil      58. 29.100 / 58. 29.100
  libavcodec     60. 31.102 / 60. 31.102
  libavformat    60. 16.100 / 60. 16.100
  libavdevice    60.  3.100 / 60.  3.100
  libavfilter     9. 12.100 /  9. 12.100
  libswscale      7.  5.100 /  7.  5.100
  libswresample   5.  0.100 /  5.  0.100
  libpostproc    57.  3.100 / 57.  3.100
[h264 @ 0x7efcc2349880] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x7efcc2349880] decode_slice_header error
[h264 @ 0x7efcc2349880] no frame!
[h264 @ 0x7efcc2349880] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x7efcc2349880] decode_slice_header error
[h264 @ 0x7efcc2349880] no frame!
[h264 @ 0x7efcc2349880] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x7efcc2349880] decode_slice_header error
[h264 @ 0x7efcc2349880] no frame!
[h264 @ 0x7efcc2349880] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x7efcc2349880] decode_slice_header error
[h264 @ 0x7efcc2349880] no frame!
[h264 @ 0x7efcc2349880] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x7efcc2349880] decode_slice_header error
[h264 @ 0x7efcc2349880] no frame!
[aist#0:1/pcm_mulaw @ 0x7efcbc8a8980] Guessed Channel Layout: mono
Input #0, rtsp, from 'xxx/videoMain':
  Metadata:
    title           : IP Camera Video
    comment         : videoMain
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: h264 (Constrained Baseline), yuvj420p(pc, progressive), 1920x1080, 25 tbr, 90k tbn
  Stream #0:1: Audio: pcm_mulaw, 8000 Hz, 1 channels, s16, 64 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
Output #0, null, to 'pipe:':
  Metadata:
    title           : IP Camera Video
    comment         : videoMain
    encoder         : Lavf60.16.100
  Stream #0:0: Video: wrapped_avframe, yuvj420p(pc, progressive), 1920x1080, q=2-31, 200 kb/s, 25 fps, 25 tbn
    Metadata:
      encoder         : Lavc60.31.102 wrapped_avframe
[null @ 0x7efcc189f3c0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 7 >= 7
[rtsp @ 0x7efcc2253600] max delay reached. need to consume packetspeed=1.19x
[rtsp @ 0x7efcc2253600] RTP: missed 1 packets
[h264 @ 0x7efcbdd12880] corrupted macroblock 49 65 (total_coeff=-1)eed=1.17x
[h264 @ 0x7efcbdd12880] error while decoding MB 49 65
[h264 @ 0x7efcbdd12880] concealing 360 DC, 360 AC, 360 MV errors in P frame
[vist#0:0/h264 @ 0x7efcbc8a8800] corrupt decoded frame
[null @ 0x7efcc189f3c0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 206 >= 206
[out#0/null @ 0x7efcc1f697c0] video:115kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
frame=  245 fps= 28 q=-0.0 Lsize=N/A time=00:00:09.96 bitrate=N/A speed=1.13x
Exiting normally, received signal 2.

Moreover, if i try to open the stream through Pypi AV (that i assume is the actual way rtsp streams are managed in HA) this is what i get:

non-existing PPS 0 referenced
non-existing PPS 0 referenced
decode_slice_header error
no frame!
e2m4n commented 4 months ago

@MassiPi I'm not an expert, but it looks like FFmpeg is having trouble with your camera's stream: "no frame!" and "corrupt decoded frame".

The error messages you're getting from running FFmpeg manually and from the python av library appear to be the same (just that ffmpeg's is more noisy due to the trace level logging). This isn't surprising because av is a Python binding for FFmpeg.

So that's the root cause of the problem: FFmpeg's unable to read the stream from your camera. I'm not sure how you can fix it.
You could try installing an older version of FFmpeg (I can't remember whether doing that actually fixed the problem I had or whether it just started working again after an update).
You could try updating FFmpeg (I've just seen that there's a new version for the Raspberry Pi I'm running Home Assistant on, I'm updating now and hope it doesn't break anything!).
Or you could try opening a bug on the FFmpeg bug tracker: https://trac.ffmpeg.org/

Sorry I couldn't be of more help. Good luck!

MassiPi commented 4 months ago

it is propably a matter of ffmpeg version, i'll check tonight what is installed in HA and what i have on the other unix machine opening the stream correctly.. the point is that after all those errors ffmpeg OPENS the stream..

natevw commented 4 months ago

I'm getting this same error. I am able to connect to the camera directly but not to Frigate's go2trc restream of it. My camera is at the edge of WiFi range and so it'd be nice to use the go2rtc-proxied stream if possible.

Does this INVALIDDATA error mean that it's not a network thing? I've got ffmpeg -i rtsp://frigate.lan:8554/juxta -an -f null -loglevel verbose - running in a totally different VM just fine, but the network situation for HassOS is a bit different. However I believe I've got things opened up

From the official SSH shell container there is no ffmpeg installed but if I ssh root@homeassistant.lan and then run nc frigate.lan 8554 inside that I am able to have the following exchange with the go2rtc instance at least:

[core-ssh ~]$ nc frigate.lan 8554
OPTIONS rtsp://frigate.lan:8554/juxta RTSP/1.0

RTSP/1.0 200 OK
Public: OPTIONS, SETUP, TEARDOWN, DESCRIBE, PLAY, PAUSE, ANNOUNCE, RECORD

So unless something really subtle is going on w/how I've got the Home Assistant VM and the Frigate container deployed firewalled, it seems I have network connectivity to go2rtc just fine as well.

issue-triage-workflows[bot] commented 1 month ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

ecodina commented 1 month ago

I understand this is an old issue, but it's ongoing. There is something weird going on with cameras. In my case (https://github.com/home-assistant/core/issues/72301#issuecomment-1555922766) I could see the camera through ffmpeg inside the docker container, but HA cannot access it.