core: FOSCAM cameras migrated from yaml without error, but fail to display video when clicking the preview
The problem
I have four FOSCAM cameras, (two R2Ms, one C2M and one FI9853EP which is PoE). All four cameras were migrated properly during the first boot of 2021.02.00, and the preview (thumbnails) for all four appear in Lovelace. When clicking on the FI9853EP, the video panel opens and after a few seconds the video is displayed. However, after clicking on one of the thumbnails from the R2Ms or the CM2 to see the actual live stream, the UI changes to show the video, but the actual video does not appear, even after two minutes. Going to the LOG, I can see an error message like the one below for each time I clicked on the R2Ms or CM2 preview: 2021-02-03 20:43:01 ERROR (stream_worker) [libav.tcp] Connection to tcp://192.168.1.10:554?timeout=5000000 failed: Connection refused 2021-02-03 20:43:01 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream rtsp://USER:PASSWORD@IPADDRESS:554/videoMain
No change was done to the cameras, or network. I can connect to the cameras web UI, and their video is working correctly. My expectation is that once the thumbnail is clicked, live video should start in a couple of seconds, especially because these cameras have the “preload” option checked.
Thanks in advance for your help!
What is version of Home Assistant Core has the issue?
2021.02.00
What was the last working version of Home Assistant Core?
2021.01.05
What type of installation are you running?
Home Assistant OS
Integration causing the issue
FOSCAM
Link to integration documentation on our website
https://www.home-assistant.io/integrations/foscam
Example YAML snippet
# - platform: foscam
# name: Family
# ip: 192.168.1.12
# rtsp_port: 88
# username: !secret cameras_username3
# password: !secret cameras_password3
# This YAML is no longer in use, as per the instructions, these lines were commented after migrating to 2021.02.00
Anything in the logs that might be useful for us?
# Put your logs below this line
2021-02-03 20:43:01 ERROR (stream_worker) [libav.tcp] Connection to tcp://192.168.1.10:554?timeout=5000000 failed: Connection refused
2021-02-03 20:43:01 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream rtsp://USER:PASSWORD@192.168.1.10:554/videoMain
After the migration to 2021.02.0, cameras showed their thumbnails properly (image obscured for privacy):

But after I clicked on them to see the actual live video, the error message above appears in the log, and nothing is displayed:

About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 44 (17 by maintainers)
Thanks everyone for checking. I’ve added back the rtsp port selection and the proper import from the old configuration.yaml config as seems I can’t rely on that result…
Once is merged and released you have two options: remove the cameras from the integration panel while keeping them in configuration.yaml so it gets re-imported again with the port or remove the cameras from the integration panel and add them manually through the integration panel.
Also for me it works again, changed my cams meanwhile to ffmpeg, but now all of them back to Foscam integration.Thanks for solving the problem.
I can confirm it works. Great htanks for your prompt action.
Hi @skgsergio, I installed 2021.2.2 a couple of hours ago in my test env, and it seems to be working fine. A BIG thank you for your effort and prompt response!!!
As you can see in previous messages we discovered that some foscam cameras are reporting the RTSP port (which can be different to the web interface port) incorrectly. Since in the last update I simplified the configuration and relied on what the camera was reporting it broke for some users like you.
Also, as you can see some messages above there is a fix in review to be fixed as soon as possible.
Thanks @altersis, but still I don’t like breaking stuff for other people, maybe I should have applied the principle “if aint broken dont touch it” and just migrate it to the new config UI with the RTSP port included…
Anyway I’ll work soon in fixing it.
Well, thanks, didn’t foresee this issue… I’m sorry for the inconvenience I’ll try to have a fix for this ASAP.
I’ve just tried to simplify configuration and trusted what the camera was reporting… 😕