Motion-Project / motion

Motion, a software motion detector. Home page: https://motion-project.github.io/
GNU General Public License v2.0
3.67k stars 549 forks source link

Is it possible to install the Motion on a Xiaomi camera? #1193

Closed mikeconley12 closed 4 years ago

mikeconley12 commented 4 years ago

I have the Mi Home Security Camera 360 1080P (MJSXJ05CM). And I want to modify the firmware of this camera. I am going to do the following steps:

  1. Dump the current firmware from the camera using this method: https://github.com/telmomarques/xiaomi-360-1080p-hacks/issues/18#issuecomment-570833174
  2. Compile the Motion using static compiling (static compiling includes all of the libraries into the executable itself)
  3. Add the compiled Motion to the firmware dump
  4. Flash the modified firmware dump to the camera

So, are these steps possible?

tosiara commented 4 years ago

Depends what OS is inside and what toolchain/libraries are available for that platform. If it is OpenWRT based - yes, possible

mikeconley12 commented 4 years ago

Thank you for the answer! I have one more question. How do I compile the Motion using static compiling? I guess I can use env variables to configure compilation:

export CFLAGS="<args-here>"
autoreconf -fiv
./configure
make

Am I right?

gusarg81 commented 4 years ago

@mikeconley12 but that hack does support RTSP, so you can setup Motion elsewhere and configure the cam RTSP there.

I don't think that compile motion statically and put it in the Xiaomi camera is the right move, since also has a very limited hardware.

NOTE: I also have the 720P model of your cam. I could never make RTSP work with its hack (https://github.com/ghoost82/mijia-720p-hack)

mikeconley12 commented 4 years ago

@mikeconley12 but that hack does support RTSP, so you can setup Motion elsewhere and configure the cam RTSP there.

I don't think that compile motion statically and put it in the Xiaomi camera is the right move, since also has a very limited hardware.

NOTE: I also have the 720P model of your cam. I could never make RTSP work with its hack (https://github.com/ghoost82/mijia-720p-hack)

Yes, but that hack does not support my camera version :) My camera version is MJSXJ05CM, but the supported version is MJSXJ02CM.

And the RTSP server is still in alpha stage. Also, I don't have a very good first impression about this RTSP server. See for example a commit from this RTSP server: https://github.com/telmomarques/x360h1080p-rtsp-server/commit/be61777fb54be416240e6d2098e84f1edae895e8 . On the other hand, the Motion is a good and stable software and I've used it before.

About the limited hardware. Yeah, it could be a problem. I think I can do some benchmarks.