『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 5608|回复: 1

[技术探讨] 树莓派HA接入萤石C6H的问题求助

[复制链接]

1

主题

14

帖子

103

积分

注册会员

Rank: 2

积分
103
金钱
89
HASS币
0
发表于 2018-10-29 18:31:03 | 显示全部楼层 |阅读模式
本帖最后由 flyinsea 于 2018-10-29 18:31 编辑

先按照这个帖子 树莓派编译安装FFmpeg(添加H.264硬件编解码器支持) 安装ffmpeg ,安装的3.3.4版本,最新的4.0版本编译反而有问题,而且不支持ffserver了,所以用了3.0的最新版本3.3.4.

按照这位大大的帖子 [进阶教程] homebridge homeassistant 配置萤石C6H摄像头

接入萤石C6H。

配置参数如下
camera:
  - platform: ffmpeg
    input: -rtsp_transport tcp -i rtsp://admin:[email protected]:554/h264/ch1/main/av_stream
    name: ezviz
    extra_arguments: -pred 1 -q:v 2 -s 1280x720

ffmpeg:
    ffmpeg_bin: /usr/local/bin/ffmpeg


一开始按照上面帖子里编译参数,安装ffmpeg后发现没有enable image2和image2pipe导致出不来图像
后来加上 --enable-muxer=image2pipe 重新编译安装后,图像能出来了。但是还有个问题
预览图能出来,链接 url为 http://192.168.xxx.xxx:8123/api/ ... 37aa6fd4aabfab9e31c
大概是10s左右更新一次画面
点击该预览图进入实时画面,对应图片显示不出来,url链接 为 http://192.168.xxx.xxx:8123/api/ ... 37aa6fd4aabfab9e31c

就是说camera_proxy_stream 无法显示,camera_proxy 正常处理。如附图所示

log里也看不出什么来,摘取部分log如下,请问这个该从哪方面去解决?

2018-10-29 17:38:24 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 1558682928: Received {'entity_id': 'camera.ezviz', 'id': 343, 'type': 'camera_thumbnail'}
2018-10-29 17:38:24 DEBUG (MainThread) [haffmpeg.core] Start FFmpeg with ['/usr/local/bin/ffmpeg', '-rtsp_transport', 'tcp', '-i', 'rtsp://admin:[email protected]:554/h264/ch1/main/av_stream', '-an', '-frames:v', '1', '-c:v', 'mjpeg', '-pred', '1', '-q:v', '2', '-s', '1280x720', '-f', 'image2pipe', '-']
2018-10-29 17:38:27 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 1558682928: Sending {'result': {'content_type': 'image/jpeg', 'content': '....(这里是图像数据base64值)'}, 'success': True, 'id': 343, 'type': 'result'}
2018-10-29 17:38:30 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state sun.sun=below_horizon; azimuth=256.26, next_dawn=2018-10-29T22:12:41+00:00, next_midnight=2018-10-29T15:58:06+00:00, next_dusk=2018-10-29T09:44:42+00:00, next_noon=2018-10-30T03:58:05+00:00, next_rising=2018-10-29T22:40:36+00:00, friendly_name=Sun, next_setting=2018-10-30T09:15:36+00:00, elevation=-4.76 @ 2018-10-29T17:16:52.019921+08:00>, new_state=<state sun.sun=below_horizon; azimuth=256.42, next_dawn=2018-10-29T22:12:41+00:00, next_midnight=2018-10-29T15:58:06+00:00, next_dusk=2018-10-29T09:44:42+00:00, next_noon=2018-10-30T03:58:05+00:00, next_rising=2018-10-29T22:40:36+00:00, friendly_name=Sun, next_setting=2018-10-30T09:15:36+00:00, elevation=-4.95 @ 2018-10-29T17:16:52.019921+08:00>, entity_id=sun.sun>
2018-10-29 17:38:32 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 1558682928: Received {'entity_id': 'camera.ezviz', 'id': 344, 'type': 'camera_thumbnail'}
2018-10-29 17:38:32 DEBUG (MainThread) [haffmpeg.core] Start FFmpeg with ['/usr/local/bin/ffmpeg', '-rtsp_transport', 'tcp', '-i', 'rtsp://admin:[email protected]:554/h264/ch1/main/av_stream', '-an', '-frames:v', '1', '-c:v', 'mjpeg', '-pred', '1', '-q:v', '2', '-s', '1280x720', '-f', 'image2pipe', '-']
2018-10-29 17:38:35 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 1558682928: Sending {'result': {'content_type': 'image/jpeg', 'content': '....(这里是图像数据base64值)'}, 'success': True, 'id': 344, 'type': 'result'}
2018-10-29 17:38:42 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 1558682928: Received {'entity_id': 'camera.ezviz', 'id': 345, 'type': 'camera_thumbnail'}
2018-10-29 17:38:42 DEBUG (MainThread) [haffmpeg.core] Start FFmpeg with ['/usr/local/bin/ffmpeg', '-rtsp_transport', 'tcp', '-i', 'rtsp://admin:[email protected]:554/h264/ch1/main/av_stream', '-an', '-frames:v', '1', '-c:v', 'mjpeg', '-pred', '1', '-q:v', '2', '-s', '1280x720', '-f', 'image2pipe', '-']
2018-10-29 17:38:45 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 1558682928: Sending {'result': {'content_type': 'image/jpeg', 'content': '....(这里是图像数据base64值)'}, 'success': True, 'id': 345, 'type': 'result'}
2018-10-29 17:38:52 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 1558682928: Received {'entity_id': 'camera.ezviz', 'id': 346, 'type': 'camera_thumbnail'}
2018-10-29 17:38:52 DEBUG (MainThread) [haffmpeg.core] Start FFmpeg with ['/usr/local/bin/ffmpeg', '-rtsp_transport', 'tcp', '-i', 'rtsp://admin:[email protected]:554/h264/ch1/main/av_stream', '-an', '-frames:v', '1', '-c:v', 'mjpeg', '-pred', '1', '-q:v', '2', '-s', '1280x720', '-f', 'image2pipe', '-']
2018-10-29 17:38:55 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 1558682928: Sending {'result': {'content_type': 'image/jpeg', 'content': '....(这里是图像数据base64值)'}, 'success': True, 'id': 346, 'type': 'result'}
2018-10-29 17:39:02 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 1558682928: Received {'entity_id': 'camera.ezviz', 'id': 347, 'type': 'camera_thumbnail'}
2018-10-29 17:39:02 DEBUG (MainThread) [haffmpeg.core] Start FFmpeg with ['/usr/local/bin/ffmpeg', '-rtsp_transport', 'tcp', '-i', 'rtsp://admin:[email protected]:554/h264/ch1/main/av_stream', '-an', '-frames:v', '1', '-c:v', 'mjpeg', '-pred', '1', '-q:v', '2', '-s', '1280x720', '-f', 'image2pipe', '-']
2018-10-29 17:39:05 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 1558682928: Sending {'result': {'content_type': 'image/jpeg', 'content': '....(这里是图像数据base64值)'}, 'success': True, 'id': 347, 'type': 'result'}
2018-10-29 17:39:12 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 1558682928: Received {'entity_id': 'camera.ezviz', 'id': 348, 'type': 'camera_thumbnail'}
2018-10-29 17:39:12 DEBUG (MainThread) [haffmpeg.core] Start FFmpeg with ['/usr/local/bin/ffmpeg', '-rtsp_transport', 'tcp', '-i', 'rtsp://admin:[email protected]:554/h264/ch1/main/av_stream', '-an', '-frames:v', '1', '-c:v', 'mjpeg', '-pred', '1', '-q:v', '2', '-s', '1280x720', '-f', 'image2pipe', '-']
2018-10-29 17:39:15 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 1558682928: Sending {'result': {'content_type': 'image/jpeg', 'content': '....(这里是图像数据base64值)'}, 'success': True, 'id': 348, 'type': 'result'}

2018-10-29 17:39:18 INFO (MainThread) [homeassistant.components.http.view] Serving /api/camera_proxy_stream/camera.ezviz to 192.168.xxx.xxx (auth: True)
2018-10-29 17:39:18 DEBUG (MainThread) [haffmpeg.core] Start FFmpeg with ['/usr/local/bin/ffmpeg', '-rtsp_transport', 'tcp', '-i', 'rtsp://admin:[email protected]:554/h264/ch1/main/av_stream', '-an', '-c:v', 'mjpeg', '-pred', '1', '-q:v', '2', '-s', '1280x720', '-f', 'mpjpeg', '-']
2018-10-29 17:39:20 DEBUG (MainThread) [haffmpeg.core] Close FFmpeg process
2018-10-29 17:39:22 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 1558682928: Received {'entity_id': 'camera.ezviz', 'id': 349, 'type': 'camera_thumbnail'}
2018-10-29 17:39:22 DEBUG (MainThread) [haffmpeg.core] Start FFmpeg with ['/usr/local/bin/ffmpeg', '-rtsp_transport', 'tcp', '-i', 'rtsp://admin:[email protected]:554/h264/ch1/main/av_stream', '-an', '-frames:v', '1', '-c:v', 'mjpeg', '-pred', '1', '-q:v', '2', '-s', '1280x720', '-f', 'image2pipe', '-']
2018-10-29 17:39:25 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 1558682928: Sending {'result': {'content_type': 'image/jpeg', 'content': '....(这里是图像数据base64值)'}, 'success': True, 'id': 349, 'type': 'result'}
2018-10-29 17:39:25 INFO (MainThread) [homeassistant.components.http.view] Serving /api/camera_proxy_stream/camera.ezviz to 192.168.xxx.xxx (auth: True)
2018-10-29 17:39:25 DEBUG (MainThread) [haffmpeg.core] Start FFmpeg with ['/usr/local/bin/ffmpeg', '-rtsp_transport', 'tcp', '-i', 'rtsp://admin:[email protected]:554/h264/ch1/main/av_stream', '-an', '-c:v', 'mjpeg', '-pred', '1', '-q:v', '2', '-s', '1280x720', '-f', 'mpjpeg', '-']
2018-10-29 17:39:28 DEBUG (MainThread) [haffmpeg.core] Close FFmpeg process


回复

使用道具 举报

8

主题

2073

帖子

6057

积分

论坛元老

流水无味

Rank: 8Rank: 8

积分
6057
金钱
3984
HASS币
145

灌水之王

发表于 2018-10-30 12:44:47 | 显示全部楼层
本帖最后由 xieahui 于 2018-10-30 12:49 编辑

我用的这个一切正常
海康的室内半球
     - platform: ffmpeg
       name: camera1
       input: -rtsp_transport tcp -i rtsp://admin:[email protected]/Streaming/Channels/1
       ffmpeg_bin: /usr/bin/avconv
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-12-23 08:45 , Processed in 1.171213 second(s), 24 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表