Using RTSP from Xiaomi camera with MiHome cloud working. Testing needed

I made a tool to enable the Xiaomi Camera Gateway to work with RTSP without flashing a alternate firmware and therefore keeping MiHome cloud functionality working. Using the camera with Home Assistant is then fairly simple.

Seems to work fine with the camera I have (lumi.camera.aq1) but have not tested it on other xiaomi cameras.

Is there anyone here that owns a different Xiaomi P2P camera willing to test and report?

2 Likes

how the same things can be done in Android OS? i mean forwarding video from xiaomi camera to RTSP by android.

I have 6 new cameras still in the box, will give it a try next week and update

Failed during build:
Running aclocal …
Running autoheader…
Running automake --foreign …
Running autoconf …
Running ./configure …
checking build system type… x86_64-pc-linux-gnu
checking host system type… x86_64-pc-linux-gnu
checking target system type… x86_64-pc-linux-gnu
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for a thread-safe mkdir -p… /bin/mkdir -p
checking for gawk… gawk
checking whether make sets $(MAKE)… yes
checking whether make supports nested variables… yes
checking whether make supports nested variables… (cached) yes
checking for gcc… gcc
checking whether the C compiler works… yes
checking for C compiler default output file name… a.out
checking for suffix of executables…
checking whether we are cross compiling… no
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ISO C89… none needed
checking whether gcc understands -c and -o together… yes
checking for style of include used by make… GNU
checking dependency style of gcc… gcc3
checking how to run the C preprocessor… gcc -E
checking for g++… g++
checking whether we are using the GNU C++ compiler… yes
checking whether g++ accepts -g… yes
checking dependency style of g++… gcc3
./configure: line 4242: syntax error near unexpected token JSON_C,json-c' ./configure: line 4242: PKG_CHECK_MODULES(JSON_C,json-c)’

hi
found that this solution worked for me (vm with ubuntu)

indicate that the macro PKG_CHECK_MODULES might be missing on your system.
This macro is part of pkg-config which you can install via apt-get install pkg-config .

1 Like

Anyone using this with lumi.camera.aq1 I have integrated it but rtsp stream is very laggy and mainly only shows stills?

I use it on the Ubuntu host system and it is very smooth. Before that I tried it from docker container but it was terrible.

Thanks Ill give that a shot I was running it on a dedicated Pi 3 but should just move it over to my ubuntu server

Hi Miguel,

I know its an old topic but I just found it looking for some way to expose video stream from my Xiaomi cameras to the HA.

I did try your tool with 2 cameras:

  • Yi Ant
  • chuangmi camera ipc016

Both are visible and works fine in Xiaomi app and both doesn’t like to work with your tool or Miio component with the following type error:
$ ./videop2proxy --ip 192.168.x.x --token 320b1362c430939608481627xxxxxxxx --rtsp 8554
Starting proxy…
Starting RTSP server on “rtsp://192.168.2.8:8554/”
(RTSP-over-HTTP tunneling is not available.)

Traceback (most recent call last):
File “”, line 1, in
File “/home/snakesms/.local/lib/python3.6/site-packages/miio/device.py”, line 147, in send
command, parameters, retry_count, extra_parameters=extra_parameters
File “/home/snakesms/.local/lib/python3.6/site-packages/miio/miioprotocol.py”, line 236, in send
extra_parameters=extra_parameters,
File “/home/snakesms/.local/lib/python3.6/site-packages/miio/miioprotocol.py”, line 236, in send
extra_parameters=extra_parameters,
File “/home/snakesms/.local/lib/python3.6/site-packages/miio/miioprotocol.py”, line 236, in send
extra_parameters=extra_parameters,
File “/home/snakesms/.local/lib/python3.6/site-packages/miio/miioprotocol.py”, line 240, in send
raise DeviceException(“No response from the device”) from ex
miio.exceptions.DeviceException: No response from the device
Can’t read output line 1 from command: python3 -c “import miio;result = miio.device.Device(‘192.168.x.x’, ‘320b1362c430939608481627xxxxxxxx’).send(‘get_ipcprop’, [‘all’]);print(result[‘p2p_id’]);print(result[‘avID’]);print(result[‘avPass’]);”
Error connecting to camera, make sure ip and token are correct.

Topic been obtained in 2 different ways and looks the same so I’m quite confident its correct

Any ideas what else I can try to do to let it work?
Thanks in advance

Just open camera in app and it will continue to work

Doesn’t make any difference if app is open or not (in my case)

Why do you abandoned your tool? :sleepy: :smiling_face_with_three_hearts: :smiling_face_with_three_hearts: :smiling_face_with_three_hearts:

It was an amazing option to these limited Xiaomi Cameras…