Issues with Yi Cameras with RTSP and Google Home Hub

Greetings all,

I’ve been playing with some Yi Cameras with RTSP ( https://github.com/TheCrypt0/yi-hack-v4 ) and Google Home Hub. I managed to configure the cameras on HA as this:

  - platform: generic
    name: Cast Office
    still_image_url: https://still_image_url/image.jpg
    stream_source: rtsp://IP/ch0_1.h264

I have exposed the camera to Google and it shows up on the Home App. If I use VLC to stream that directly works fine, I have no stutters and no issues at all.
Problem happens when I try to cast to Google Home Hub (and to a chromecast device too), it just plays 2 seconds, buffers for a long time, plays another second and then buffers again. The logs show:

2019-05-03 14:23:03 DEBUG (Thread-6) [pychromecast.socket_client] [Kitchen Display:8009] Received: Message urn:x-cast:com.google.cast.media from d187359f-df15-48d9-ad90-95cf29d7045b to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'BUFFERING', 'currentTime': 2.028936, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF', 'liveSeekableRange': {'start': 2.6667, 'end': 4.6617, 'isMovingWindow': True, 'isLiveDone': False}}], 'requestId': 0}
2019-05-03 14:23:03 DEBUG (Thread-6) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'BUFFERING', 'currentTime': 2.028936, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF', 'liveSeekableRange': {'start': 2.6667, 'end': 4.6617, 'isMovingWindow': True, 'isLiveDone': False}}], 'requestId': 0}
2019-05-03 14:23:05 DEBUG (Thread-6) [pychromecast.socket_client] [Kitchen Display:8009] Received: Message urn:x-cast:com.google.cast.media from d187359f-df15-48d9-ad90-95cf29d7045b to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'PLAYING', 'currentTime': 3.1, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF', 'liveSeekableRange': {'start': 4.2667, 'end': 6.426, 'isMovingWindow': True, 'isLiveDone': False}}], 'requestId': 0}
2019-05-03 14:23:05 DEBUG (Thread-6) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'PLAYING', 'currentTime': 3.1, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF', 'liveSeekableRange': {'start': 4.2667, 'end': 6.426, 'isMovingWindow': True, 'isLiveDone': False}}], 'requestId': 0}
2019-05-03 14:23:07 DEBUG (Thread-6) [pychromecast.socket_client] [Kitchen Display:8009] Received: Message urn:x-cast:com.google.cast.media from d187359f-df15-48d9-ad90-95cf29d7045b to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'BUFFERING', 'currentTime': 4.1, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF', 'liveSeekableRange': {'start': 4.2667, 'end': 6.426, 'isMovingWindow': True, 'isLiveDone': False}}], 'requestId': 0}
2019-05-03 14:23:07 DEBUG (Thread-6) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'BUFFERING', 'currentTime': 4.1, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF', 'liveSeekableRange': {'start': 4.2667, 'end': 6.426, 'isMovingWindow': True, 'isLiveDone': False}}], 'requestId': 0}
2019-05-03 14:23:09 DEBUG (Thread-6) [pychromecast.socket_client] [Kitchen Display:8009] Received: Message urn:x-cast:com.google.cast.media from d187359f-df15-48d9-ad90-95cf29d7045b to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'PLAYING', 'currentTime': 4.785072, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF', 'liveSeekableRange': {'start': 5.9367, 'end': 8.2197, 'isMovingWindow': True, 'isLiveDone': False}}], 'requestId': 0}
2019-05-03 14:23:09 DEBUG (Thread-6) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'PLAYING', 'currentTime': 4.785072, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF', 'liveSeekableRange': {'start': 5.9367, 'end': 8.2197, 'isMovingWindow': True, 'isLiveDone': False}}], 'requestId': 0}
2019-05-03 14:23:11 DEBUG (Thread-6) [pychromecast.socket_client] [Kitchen Display:8009] Received: Message urn:x-cast:com.google.cast.media from d187359f-df15-48d9-ad90-95cf29d7045b to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'BUFFERING', 'currentTime': 6.036289, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF', 'liveSeekableRange': {'start': 7.6617, 'end': 10.0364, 'isMovingWindow': True, 'isLiveDone': False}}], 'requestId': 0}
2019-05-03 14:23:11 DEBUG (Thread-6) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'BUFFERING', 'currentTime': 6.036289, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF', 'liveSeekableRange': {'start': 7.6617, 'end': 10.0364, 'isMovingWindow': True, 'isLiveDone': False}}], 'requestId': 0}
2019-05-03 14:23:14 DEBUG (Thread-6) [pychromecast.socket_client] [Kitchen Display:8009] Received: Message urn:x-cast:com.google.cast.media from d187359f-df15-48d9-ad90-95cf29d7045b to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'PLAYING', 'currentTime': 6.937767, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF', 'liveSeekableRange': {'start': 11.2197, 'end': 13.7214, 'isMovingWindow': True, 'isLiveDone': False}}], 'requestId': 0}
2019-05-03 14:23:14 DEBUG (Thread-6) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'PLAYING', 'currentTime': 6.937767, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF', 'liveSeekableRange': {'start': 11.2197, 'end': 13.7214, 'isMovingWindow': True, 'isLiveDone': False}}], 'requestId': 0}
2019-05-03 14:23:16 DEBUG (Thread-6) [pychromecast.socket_client] [Kitchen Display:8009] Received: Message urn:x-cast:com.google.cast.media from d187359f-df15-48d9-ad90-95cf29d7045b to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'BUFFERING', 'currentTime': 8.15, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF', 'liveSeekableRange': {'start': 13.0364, 'end': 15.5839, 'isMovingWindow': True, 'isLiveDone': False}}], 'requestId': 0}
2019-05-03 14:23:16 DEBUG (Thread-6) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'BUFFERING', 'currentTime': 8.15, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF', 'liveSeekableRange': {'start': 13.0364, 'end': 15.5839, 'isMovingWindow': True, 'isLiveDone': False}}], 'requestId': 0}
2019-05-03 14:23:18 DEBUG (Thread-6) [pychromecast.socket_client] [Kitchen Display:8009] Received: Message urn:x-cast:com.google.cast.media from d187359f-df15-48d9-ad90-95cf29d7045b to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'PLAYING', 'currentTime': 8.65, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF', 'liveSeekableRange': {'start': 14.8714, 'end': 17.457, 'isMovingWindow': True, 'isLiveDone': False}}], 'requestId': 0}
2019-05-03 14:23:18 DEBUG (Thread-6) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'PLAYING', 'currentTime': 8.65, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF', 'liveSeekableRange': {'start': 14.8714, 'end': 17.457, 'isMovingWindow': True, 'isLiveDone': False}}], 'requestId': 0}
2019-05-03 14:23:21 DEBUG (Thread-6) [pychromecast.socket_client] [Kitchen Display:8009] Received: Message urn:x-cast:com.google.cast.media from d187359f-df15-48d9-ad90-95cf29d7045b to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'BUFFERING', 'currentTime': 10.1, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF', 'liveSeekableRange': {'start': 16.721400000000003, 'end': 19.339100000000002, 'isMovingWindow': True, 'isLiveDone': False}}], 'requestId': 0}
2019-05-03 14:23:21 DEBUG (Thread-6) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'BUFFERING', 'currentTime': 10.1, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF', 'liveSeekableRange': {'start': 16.721400000000003, 'end': 19.339100000000002, 'isMovingWindow': True, 'isLiveDone': False}}], 'requestId': 0}

Any ideas on what could be possibly going on?

Thanks!

I have same problem it seems. 720p Yi Camera with custom firmware to enable rtsp. Everything works ok when I use browser to view camera, so I guess problem may be in google home device? Did you manage to make it work better? I tried both generic camera and ffmpeg platform but the result is same, stuttering after 1-2 seconds of playback and buffering.