core: Ffmpeg streams do not show up in frontend

Home Assistant release with the issue:

0.81.2

Last working Home Assistant release (if known): Not known

Operating environment (Hass.io/Docker/Windows/etc.):

hassbian

Component/platform:

https://www.home-assistant.io/components/camera.ffmpeg/

Description of problem: Streams don’t show up on the frontend when using ffmpeg. The actual preview picture does work: image And if i use the stream inside a VLC player it also works just fine.

As you can see in developer tools the stream in question is actually running and increasing (120mb big on the picture) but only showing the small “X Voorkant” picture. image

I also ran the ffmpeg command on the commandline and saved it to a mjpeg file and opened it up, also works fine.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

input: -rtsp_transport tcp -i rtsp://<user>:<pass>@192.168.1.50:554/cam/realmonitor?channel=1&subtype=0

Traceback (if applicable):


Additional information: When i click on the picture to get the stream i does show in “ps -ef” that it is running:

homeass+ 30860 30267 55 15:43 ?        00:03:29 /usr/bin/ffmpeg -rtsp_transport tcp -i rtsp://<user>:<pass>@192.168.1.50:554/cam/realmonitor?channel=1&subtype=0 -an -c:v mjpeg -f mpjpeg -

Thought about quotes, but the preview picture works and the stream data gets to the frontend too.

And here comes the weirdest part, but might help in debuging. If i keep that enlarged screen open which shows nothing and then stop home assistant it suddenly appears. Ofcourse it stops streaming instantly since i was stopping home assistant. See picture: image

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 20 (3 by maintainers)

Most upvoted comments

I have opened a pull request #20314 to resolve the issue. Please help me to test it.

Actually, I have now got it working. There are a number of other places ffserver is also referenced. Updating ffmpeg.py makes it work. I imagine updating all other camera types will also will make them work too.

  • camera/ffmpeg.py
  • camera/amcrest.py
  • camera/arlo.py
  • camera/canary.py
  • camera/ring.py
  • camera/xiaomi.py
  • camera/yi.py

Hope that helps.

Good job @AriZuu and @Veda82

I think the issue was introduced by https://github.com/FFmpeg/FFmpeg/commit/7c6125cbcc6e805711feff9cbf35329adcb6e313

@pvizeli can we add version check in ha-ffmpeg lib therefore we may be able to provide in different boundary string in home-assistant

I got similar problems after upgrading ffmpeg from 3.4 to 4.0/4.1. Reverting to old ffmpeg fixed the problem.