Skip to content

About

Turn your Android device into a remote security IP camera

Topics

Resources

Stars

557 stars

Watchers

6 watching

Forks

Latest commit

Β 

History

270 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Android IP Camera

downloads downloads

Turn your Android device into a remote security IP camera

Screenshot

πŸ“² Install

Features

  • 🌎 Built-in server that streams MJPEG and H.264 video to any web browser, video app or NVR, including Frigate, with Home Assistant integration.
  • πŸŽ›οΈ Remote web interface for live view, camera, image, recording and zoom controls.
  • πŸŽ™οΈ Live microphone audio and two-way push-to-talk from the web interface.
  • ☁️ Optional OpenTunnel remote access outside your home network (can be self-hosted).
  • 🀳 Switch between the main and selfie camera.
  • πŸƒ Motion detection with notifications, record on motion, continuous recording and automatic cleanup of old recordings.
  • πŸ’Ύ Start manual recordings and browse, play, download or delete them in the web interface, saved to internal storage or an SD card.
  • πŸ“‘ Optional RTSP stream (H.264 + AAC) with a lighter sub stream for players and NVRs.
  • πŸ›°οΈ Optional ONVIF camera mode for UniFi Protect, Home Assistant and other NVRs.
  • πŸ” Username and password protection with automatic or custom TLS certificates for HTTPS and RTSPS.
  • 🧩 Provides an HTTP control API for automation and integrations.
  • βš™οΈ Configure the streaming, RTSP and ONVIF ports and choose which network interface to listen on.
  • πŸ–ΌοΈ Adjustable image quality and frame rate, plus automatic pause at a configurable battery temperature.
  • πŸŒ™ Night-sight mode that streams long-exposure stills as video.
  • πŸŒ— Automatically switch night mode by GPS twilight, ambient light, schedule or camera auto-exposure, with optional grayscale, torch-on when dark and torch-on-motion.
  • πŸ“ Optional burned-in text overlay for streams and recordings.
  • βœ‚οΈ Controls to crop the live stream and snapshots.
  • πŸ“΄ Turn the display off while streaming.
  • πŸ₯Ύ Optional start on boot.

⚠️ Warning

If you are planning to run this 24/7, please make sure that your phone does not stay at 100% charge. Doing so may damage the battery and cause it to swell up, which could cause it to explode.

Some models include an option to only charge to 80%, make sure this is enabled where possible.

Note: running at a higher image quality may cause some phones to over heat, which can also damage the battery.

Continuous streaming - whether from an always-on camera mode (Camera always on, Motion clips or Continuous recording), a browser or an NVR - can cause some devices to over heat and power off. Use Pause streaming at battery temperature under Stream β†’ Device Safety to protect the device. It is enabled by default at 45 Β°C and can be adjusted or set to 0 to disable it.

πŸ”‹ Background Usage

The app runs as a foreground service with a persistent notification, so it won't be closed while streaming. For reliable 24/7 operation:

  • Unrestricted battery usage: Open Settings > Apps > Android IP Camera > Battery and select Unrestricted (or Don't optimise) so Android doesn't sleep the app.
  • Don't swipe the app away from recent apps - force-stopping it terminates the server.
  • Don't dismiss the persistent notification or the server may get stopped.
  • The display can be safely turned off while streaming.
  • Disable automatic updates: Installing an update stops the app and its background streaming service. App stores and updaters (Google Play, F-Droid, Obtainium, etc.) may install updates in the background, interrupting 24/7 operation. Turn off auto-update for Android IP Camera in the store or updater, and install updates manually when you are able to reopen the app and start streaming again.
  • Enable Start on Boot in the app settings for unattended setups. On Android 14 and newer, Android does not allow the camera/microphone foreground service to start from the background, so the app posts a notification after boot; tap it to open the app and start streaming.

πŸŽ›οΈ Web control panel

Open https://[ip_address]:4444 (or http:// when TLS is disabled) and use the three tabs.

Camera

Choose the lens and adjust the picture, night mode and framing.

  • Quick controls: switch camera, torch, mute audio, push-to-talk, start a recording and take a snapshot.
  • Lens: zoom, focus, exposure and contrast.
  • Night Vision: night-sight stills, night exposure/ISO and grayscale.
  • Automatic night mode: switch night-sight, grayscale and the torch automatically from GPS, ambient light, a schedule or the camera's own exposure.
  • Framing & orientation: rotation, mirror, output scale and crop.
  • Snapshot settings: choose the snapshot resolution and an optional countdown.

Stream

Tune the live video, audio and device safety.

  • Browser Playback: choose H.264 or MJPEG for this browser.
  • Main stream: quality, bandwidth, keyframes and noise reduction.
  • Text overlay: burn time, date, battery, Wi-Fi, temperature and the camera name into the video.
  • RTSP substream: a lighter stream for slow links.
  • Device Safety: pause streaming when the battery gets too hot.

Recordings

Choose when the camera runs and how clips are recorded.

  • On demand, Camera always on, Motion clips or Continuous recording.
  • Motion notifications, sensitivity, stop delay, clip length and automatic cleanup are configured here.

See Web control panel settings for defaults and the full technical behaviour, and Server API Reference for the remote-control API and every parameter.

Web control panel settings reference

Camera tab

  • Night-sight mode replaces live video with night-sight stills. Expect a much lower frame rate and a pause while each photo is captured.
  • Cameras without manual night exposure can produce slow stills without getting brighter; normal video with grayscale may look better.
  • If the still pipeline keeps timing out (some legacy HALs hang on takePicture while preview runs), Night-sight mode stays selected but the stream automatically falls back to normal live video, keeping grayscale and the automatic night decision active.
  • Night exposure and Night ISO set the still shutter time and sensor sensitivity with auto-exposure off. Night exposure defaults to 50% of the camera's usable range. Higher values brighten a dark room; very long exposures blur movement.
  • Grayscale Night Mode removes colour noise from live video and night stills on both MJPEG and H.264. It does not change exposure or ISO.
  • Framing & orientation: rotation, mirror and output scale. Crop is available from a desktop browser; drag a rectangle over the preview to set it.
  • Snapshot settings: choose stream/full-sensor resolution and an optional countdown before the snapshot (0 = instant).

Automatic night mode

Choose Schedule, GPS, LUX, GPS or LUX or Camera AE.

  • GPS follows civil twilight (βˆ’6Β° sun elevation); the offset shifts both transitions later (positive) or earlier (negative).
  • LUX switches night on below the threshold and day at or above it.
  • Schedule uses the phone's local time and may cross midnight.
  • Camera AE uses the camera's ISO/exposure telemetry with a frame-luma fallback. Metering always comes from a day-referenced video/preview/analysis stream; brightened night stills are never used. Lower the threshold to switch earlier (default 90%). Entry needs 15 seconds of continuous darkness; exit normally needs 60 seconds of brightness, or 10 seconds for a nearly pure-white frame. On cameras whose night mode only exists as an OEM extension there is no day-referenced stream while night-sight owns the camera, so the decision latches until that night session ends.
  • Auto Night-sight mode turns the selected trigger into an actual night-sight switch. It is independent of Auto grayscale and the torch: any combination can be selected. The manual Night-sight checkbox stays enabled; toggling it while automation owns the switch creates a temporary override until the next night/day transition.
  • Auto grayscale follows the trigger's dark/light decision independently of Night-sight mode, so grayscale can turn on while the stream stays live video. The manual Grayscale Night Mode checkbox stays enabled; toggling it while Auto grayscale is active creates a temporary override until the next night/day transition. With no trigger selected, the manual setting applies normally.
  • Torch: On motion lights the torch on motion after dark (needs an always-on mode with motion notifications). On while dark keeps the torch lit while the trigger says dark; in On demand it runs only while the camera session is active (viewer, recording, snapshot or preview) and turns off when the camera is released. Camera AE can use it in On demand because the dark decision is latched for that session (LUX is also latched while the torch is on, since its sensor can see the torch); in always-on modes Camera AE cannot be combined with it because the torch would blind the meter. While any torch is lit, Night-sight and grayscale are paused without clearing their selections or temporary overrides, then restored when the torch turns off.

Stream tab

  • Browser Playback: H.264 needs HTTPS/TLS and a browser with WebCodecs; MJPEG works everywhere. The choice is per browser.
  • Target bitrate: Auto scales about 0.2 bits per pixel per frame with resolution and frame rate. A manual value stays fixed and is clamped to what the device encoder supports.
  • Bitrate mode: VBR favours quality; CBR favours steadier bandwidth. CBR falls back to VBR when unsupported. Android 12+ applies a VBR quality floor, so a low target can still produce a higher average bitrate.
  • Keyframe interval: longer intervals reduce average bandwidth for 24/7 recording; new viewers request a keyframe when they connect.
  • Noise reduction applies only to the rear camera's GPU H.264 path; the GPU load scales with the level.
  • Audio gain applies to the camera microphone output, including RTSP audio.
  • Text overlay (OSD): burns time, date, battery, Wi-Fi, temperature and camera name into the video. Leave the camera name blank to use the selected lens.
  • RTSP substream: a smaller stream for slow links. Keep its bitrate around half the viewer's connection speed so dips do not stall it. Changes apply the next time an RTSP viewer connects.
  • Device Safety: pause streaming at a chosen battery temperature. Defaults to 45 Β°C when no value has been set; 0 disables the guard. Streaming resumes after the battery cools by 3 Β°C. Continuous streaming from an always-on mode, browser or NVR can overheat some devices.

Recordings tab

  • On demand starts the camera for a viewer and releases it when the last viewer leaves. The on-phone preview also keeps it running while shown.
  • Camera always on keeps the camera ready for fast connections and continuous Camera AE. Notify on motion adds ONVIF motion events and phone notifications.
  • No automatic recording, Record on motion and Continuous recording choose whether clips are written. Motion clips always enable notifications; continuous recording can run without them.
  • Motion sensitivity, stop delay, continuous clip length and storage cleanup are configured here. Event delivery, clip timing defaults and storage paths are described in Server API Reference.

🌐 Remote access with OpenTunnel

The app can publish its local web server through OpenTunnel as a public HTTPS URL, without opening a port on your router. OpenTunnel is a blind TLS tunnel: the certificate's private key stays on the phone.

  1. Set a Username and Password in the app settings and keep Enable Authentication on. The tunnel refuses to start without both, because its URL is public.
  2. In Settings > Remote Access (OpenTunnel), leave the server at https://opentunnel.xyz or enter a self-hosted OpenTunnel server.
  3. Tap Register. The first run creates the tunnel identity and waits for a certificate; this can take a minute or two. The main screen shows one line of progress while it happens.
  4. Once connected, the main screen shows the public https://… URL. Tap it to open the camera in a browser.

Disconnect & disassociate removes the tunnel from the server and deletes the saved identity, certificates and route config; the URL cannot be recovered afterwards. A registered tunnel reconnects automatically while the app is running. The OpenTunnel client is built into the APK for arm64-v8a and armeabi-v7a.

πŸŽ₯ Frigate config

Using the HTTPS streams

Use the example config below to add your phone's camera to Frigate & update the URLs. The android-cam composite stream additionally wires up two-way talk / push-to-talk from the Frigate live view (it needs a GO2RTC_ALLOW_ARBITRARY_EXEC=true environment variable set).

Settings > Configuration Editor

go2rtc:
  streams:
    android-cam-video:
      # For example: https://test:Testing123@192.168.0.5:4444/video/h264
      # Or use to use a .env file:
      # https://{ANDROID_CAM_USER}:{ANDROID_CAM_PASSWORD}@[ip_address]:4444/video/h264
      - "https://[username]:[password]@[ip_address]:4444/video/h264"
    android-cam-audio:
      - "https://[username]:[password]@[ip_address]:4444/audio"
    android-cam:
      # Video
      - ffmpeg:android-cam-video#video=copy
      # Phone audio
      - ffmpeg:android-cam-audio#audio=copy
      # Push-to-talk (from Frigate, requires GO2RTC_ALLOW_ARBITRARY_EXEC=true)
      - "exec:/usr/lib/ffmpeg/8.0/bin/ffmpeg -hide_banner -v error -f alaw -ar 8000 -ac 1 -i - -ar 44100 -ac 1 -c:a pcm_s16le -f s16le -method POST -tls_verify 0 https://[username]:[password]@[ip_address]:4444/audio/upload#backchannel=1#audio=alaw/8000"

cameras:
  android-cam:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/android-cam # "android-cam-video" can be used if just the video is required
          input_args: preset-rtsp-restream
          roles:
            - detect
            - record
            - audio

  webrtc:
    candidates:
      - 127.0.0.1:8555

Note: if your username or password contains special characters, you'll need to URL encode them via:
python3 -c 'import urllib.parse; print(urllib.parse.quote(input(), safe=""))'

Using the RTSP stream

With the RTSP server enabled in the app settings, use the following config in Frigate:

go2rtc:
  streams:
    android-cam:
      - "rtsps://[username]:[password]@[ip_address]:8554/live"
    android-cam-sub:
      - "rtsps://[username]:[password]@[ip_address]:8554/live/sub"

cameras:
  android-cam:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/android-cam
          input_args: preset-rtsp-restream
          roles:
            - record
            - audio
        # Detect on the lighter sub stream (or drop this input and add `detect` above)
        - path: rtsp://127.0.0.1:8554/android-cam-sub
          input_args: preset-rtsp-restream
          roles:
            - detect

πŸ“‘ RTSP stream

RTSP endpoints, streams and playback

The app can serve the camera over RTSP, the protocol most NVRs, home automation systems and video players expect from an IP camera. It is off by default: enable it in Settings > RTSP / ONVIF > Enable RTSP. The address is then shown on the main screen:

rtsps://[username]:[password]@[ip_address]:8554/live

Note: VLC does not reliably handle self-signed TLS certificates for RTSPS streams. Use mpv or ffplay to play, or use a trusted certificate. Disabling TLS may work with VLC, at the risk of sending your username/password in plaintext.

  • Endpoints: /live is the main H.264 stream and /live/sub is the optional smaller stream (use rtsp:// when TLS is disabled).
  • Video: the same hardware H.264 stream as /video/h264 (resolution, frame rate, target bitrate, bitrate mode, keyframe interval, rotation, mirror and noise reduction follow the web controls; noise reduction only affects the GPU H.264 path). Each client starts at a keyframe.
  • Sub stream: a smaller version of the same picture for slow links such as 4G, watchable alongside the main stream. Choose its size (240p to 720p), frame rate and bitrate (300 to 2000 kbps, 500 by default), and whether to include audio, under Substream on the web interface's Settings tab (shown when RTSP is enabled). Changes apply the next time a viewer connects. The phone encodes it only while someone watches it; where the picture does not go through the GPU path, the sub stream carries the main stream instead.
  • Audio: the microphone as AAC-LC (44.1 kHz mono), honouring the audio_gain control. It can be turned off with Include Audio and is left out when microphone permission is not granted.
  • Transport: RTP over UDP or interleaved in the RTSP TCP connection (-rtsp_transport tcp), whichever the client asks for. Audio and video carry RTCP sender reports so players keep them in sync.
  • Authentication: the same username and password as the web server, using RTSP Digest authentication (Basic is accepted when a client sends it up front).
  • Port: 8554 by default, configurable with RTSP Port (it must differ from the streaming and ONVIF ports).
  • Lifecycle: the camera starts when a client connects and is released when the last one leaves, as with the web streams. /control/stop also disconnects RTSP clients and refuses new ones until /control/start.
  • TLS: when enabled, RTSP is served over TLS (rtsps://) using the same certificate as the web server and ONVIF, so the control connection and credentials are encrypted. With TLS disabled it is plain rtsp://, so only use it on a trusted network (or through a VPN) in that case.

Examples:

  • mpv: mpv "rtsps://[username]:[password]@[ip_address]:8554/live"
  • ffplay: ffplay -rtsp_transport tcp "rtsps://[username]:[password]@[ip_address]:8554/live"
πŸ›°οΈ ONVIF camera

ONVIF lets NVRs and home automation systems discover and control the camera as a standard IP camera. It is enabled by Settings > RTSP / ONVIF > Enable RTSP, or automatically while an always-on camera mode (Camera always on, Motion clips or Continuous recording) is selected.

  • ONVIF: https://[ip_address]:8000/onvif/device_service (Profile S device, media and media2 services, WS-Discovery), or http:// on the same port when TLS is disabled. The port is 8000 by default and configurable with ONVIF Port.
  • Snapshot: https://[ip_address]:8000/onvif/snapshot.jpg (or http:// without TLS)
  • RTSP: rtsps://[username]:[password]@[ip_address]:8554/live, or rtsps:// on the same port when TLS is enabled
  • Motion events: Notify on motion publishes ONVIF motion events through both PullPoint and WS-BaseNotification, so polling clients and hardware NVRs both see motion. It can be enabled with Camera always on or Continuous recording and is always enabled for Motion clips. When it is off, the motion detector does not run. Camera always on without notifications keeps the stream ready for NVRs without motion detection. Recording modes, event delivery and notification details are in Server URL Paths & Remote Control API below.

UniFi Protect

  1. If the phone is on the same network as the console, it shows up under third-party cameras. Otherwise, use UniFi Devices > ? > Try advanced adoption and enter [ip_address]:8000 with the app's username and password.
  2. In the camera's Protect settings, turn off audio recording if audio is disabled in the app.
  3. Protect needs a motion zone for third-party cameras before it creates motion events. If none exists, add a full-frame one through the Protect API (the settings UI doesn't offer zones for third-party cameras).

Home Assistant

Add the phone with the ONVIF integration (host https://[phone-ip], port 8000), or adopt it in UniFi Protect and use the Protect integration. Both expose the camera and a motion binary sensor.

πŸ” HTTPS/TLS certificates

To protect the stream and the password from being sent in plain-text, a certificate can be used to start the web stream over HTTPS.

When TLS is enabled, the same certificate is also used by the RTSP (rtsps://) and ONVIF (https://) endpoints. If the certificate cannot be loaded, those servers refuse to start rather than falling back to plaintext.

The app will automatically generate a self-signed certificate on first launch, but if you have your own domain you can use Let's Encrypt to generate a trusted certificate and skip the self-signed security warning message, by changing the TLS certificate in the settings.

To generate a new self-signed certificate, clear the app settings and restart or clone this repo and run ./scripts/generate-certificate.sh then use the certificate personal_certificate.p12 file it generates.

πŸ”“ Why open source

Other similar IP camera apps exist, but most are closed source. You cannot verify that they keep video on the device, that they never send recordings to someone else, or that security issues get fixed. With this app you can.

This app is open source so you do not have to take its privacy claims on trust. The code that controls the camera, encodes video and handles logins is in this repository. You can read it, build it and compare it with the APK you install.

By default, video stays on your local network. The phone serves the stream and the recordings directly to the clients you point at it. Nothing leaves your network, unless you enable the optional OpenTunnel service. Recordings are written to the phone, not uploaded anywhere.

Logins and streams are protected by username and password authentication across the web, RTSP and ONVIF endpoints. When TLS is enabled, the same certificate encrypts all three. You can check how credentials and certificates are handled in the source instead of trusting a privacy policy.

The F-Droid release is built from this same source, and the reproducible build workflow checks a clean rebuild against it.

πŸ€– AI generated code disclaimer

Some of the code in this repository may be generated with the assistance of AI tools. All changes are reviewed and tested on a real device with a human in the loop before being released.

Server URL Paths & Remote Control API

When the streaming server is running (default port 4444, via https:// or http:// depending on TLS configuration), you can access the following endpoints. The streaming port can be changed under Settings > Startup > Streaming Port, and the interface all servers bind to under Listen Interface.

πŸ“Ί Streams and Interfaces

  • Web Control Panel (/)
    • Usage: Open https://[ip_address]:[port]/ (or http://...) in any web browser.
    • Description: Serves the built-in control panel, which plays the rear or front camera video stream and allows muting/unmuting audio. Remote controls include: camera selection, image rotation, manual video recording, audio/video sync, flashlight toggle, resolution, zoom, exposure, contrast and optional GPU noise reduction.
  • Motion JPEG Video Stream (/video/mjpeg)
    • Usage: Open directly in a web browser or configure in external home automation tools (e.g. Home Assistant MJPEG IP Camera).
    • Format: multipart/x-mixed-replace; boundary=frame
  • Raw H.264 Video Stream (/video/h264)
    • Usage: Play in media players that support raw Annex-B H.264 stream demuxing.
      • mpv: Run mpv "https://[ip_address]:[port]/video/h264"
  • RTSP stream
    • Usage: The RTSP endpoints, sub stream, audio, transport, authentication, lifecycle and TLS are documented in πŸ“‘ RTSP stream above.
  • Live Audio Stream (/audio)
    • Usage: Listen to the live microphone audio.
    • Format: audio/wav chunked transfer-encoding (WAV container, 16-bit PCM mono, 44.1kHz).
      • mpv: Run mpv "https://[ip_address]:[port]/audio"
  • Raw Audio Stream (/audio/raw)
    • Usage: Listen to the raw (unprocessed) microphone source, bypassing any system audio processing (e.g. noise suppression, echo cancellation, AGC). On Android 7.0+ (API 24+) this uses the UNPROCESSED audio source; on older devices it falls back to the standard microphone.
    • Format: audio/wav chunked transfer-encoding (WAV container, 16-bit PCM mono, 44.1kHz).
      • mpv: Run mpv "https://[ip_address]:[port]/audio/raw"
  • Two-Way Audio Upload (/audio/upload, POST)
    • Usage: Send raw audio to the phone, whose speaker plays it live. Used by the built-in web control panel's push-to-talk button and by go2rtc/Frigate two-way talk (see the Frigate config above).
    • Body: Raw 16-bit PCM mono 44.1kHz. Accepts Content-Length, chunked transfer-encoding and Expect: 100-continue.
    • Responses: 200 OK per complete body; 503 Service Unavailable if streaming is disabled.
  • Still Snapshot (/video/snapshot)
    • Usage: Fetch a single high-resolution image.
    • Format: image/jpeg
    • Query Parameter: ?camera=<id|front|back|toggle> to query a specific camera sensor.
      • Example: https://[ip_address]:[port]/video/snapshot?camera=back
  • Device Info and Capabilities JSON (/info.json)
    • Usage: Query available camera sensors, their supported resolutions (for the output path that lens actually uses), device battery percentage, battery temperature in degrees Celsius (temperatureC), Wi-Fi signal strength, individual camera lens settings, the burned-in overlay settings (osd) and the overheat-pause threshold (overheatPauseC), plus the current main-stream encoder settings, including the negotiated effectiveResolution and streamDenoise.
    • Format: application/json
  • Start Recording (/record/start, POST)
    • Usage: Start recording the live camera feed to a local MP4 file. The camera and H.264 encoder are started on demand if not already running. Manual recordings are saved under YYYY/MM/DD/YYYY-MM-DD-HHMMSS-manual.mp4 inside the recordings folder. Recordings started by Motion clips use the same folder layout with a -motion.mp4 suffix, and Continuous recording segments use -continuous.mp4.
    • Responses:
      • 201 Created: Recording started; returns the recording status JSON.
      • 409 Conflict: {"error":"already_recording", ...} - a recording is already in progress.
      • 503 Service Unavailable: {"error":"no_encoder", ...} - failed to initialize the H.264 encoder.
      • 500 Internal Server Error: {"error":"start_failed", ...} - recording failed to start.
  • Stop Recording (/record/stop, POST)
    • Usage: Stop the in-progress local MP4 recording and finalize the file.
    • Responses:
      • 200 OK: Recording stopped; returns the final recording status JSON.
      • 409 Conflict: {"error":"not_recording", ...} - no recording is in progress.
      • 500 Internal Server Error: {"error":"stop_failed", ...} - failed to finalize the recording.
  • Recording Status (/record/status)
    • Usage: Query whether a local MP4 recording is currently active.
    • Format: application/json - {"recording":<bool>, "uri":<string>, "durationMs":<long>, "width":<int>, "height":<int>, "mode":<string>} (or {"recording":false, "mode":<string>} when idle). mode is off, notify, motion or continuous.
  • Recordings Index (/files)
    • Usage: Open https://[ip_address]:[port]/files in a web browser for a folder browser of the recordings stored on the device (Movies/AndroidIPCamera). Folders can be opened from the list or via the breadcrumb.
    • Format: text/html - static page shell that loads the current folder listing from /files.json?dir=<relative path>, renders folders as navigation links, and renders every entry with emoji-only πŸ’Ύ Download and πŸ—‘οΈ Delete buttons (the Delete button asks for confirmation and issues a DELETE /files/<relative path> request). File names open the recording in the browser's video player. Deleting a folder removes the folder and all of its contents.
  • Recordings List JSON (/files.json)
    • Usage: Query a recordings folder listing programmatically or feed custom front-ends. Use ?dir=2026/11/09 to list a subfolder; omit dir for the recordings root.
    • Format: application/json - {"folder":<string>, "path":<string>, "entries":[{"name":<string>, "isDirectory":<bool>, "sizeBytes":<long>, "lastModifiedMs":<long>}, ...]}
  • Play or Download Recording (/files/<relative path>, GET or HEAD)
    • Usage: Open a recorded MP4 in the browser's native video player, which starts streaming immediately and keeps working while the file is being read (MP4s are served as video/mp4 with Content-Disposition: inline). Other files download as before. Use the πŸ’Ύ Download button in the recordings list to save a copy; the player's own save/download control also works. Path segments include recording folders, e.g. /files/2026/11/09/2026-11-09-093000-manual.mp4. Supports a single Range: bytes=... request (including open-ended and suffix forms) so browsers can seek and stream progressively; the response advertises Accept-Ranges: bytes.
    • Responses: 200 OK with the file bytes (or headers only for HEAD), 206 Partial Content with Content-Range for a range request, 416 Range Not Satisfiable for a range outside the file, 404 Not Found if the file does not exist, 400 Bad Request for invalid paths.
  • Delete Recording (/files/<relative path>, DELETE)
    • Usage: Permanently delete a recorded MP4, or delete a folder and everything below it. The recordings root itself cannot be deleted.
    • Responses:
      • 200 OK: {"deleted":true} - file or folder deleted.
      • 404 Not Found: {"error":"not_found"} - no such file or folder in the recordings folder.
      • 500 Internal Server Error: {"error":"delete_failed"} - the entry exists but could not be deleted.
  • Enable Streaming (/control/start)
    • Usage: Re-enable streaming of the media routes after it has been disabled (e.g. by a home-automation system).
    • Format: application/json - {"streaming":true}
  • Disable Streaming (/control/stop)
    • Usage: Stop serving the media routes (/video/*, /audio*, and the RTSP stream when enabled) without closing the listening port, and disconnect any viewers that are currently connected. The /control/* endpoints remain reachable so streaming can be turned back on remotely. When disabled, media routes return 503 Service Unavailable with a hint to POST /control/start.
    • Format: application/json - {"streaming":false}
  • Streaming Status (/control/status)
    • Usage: Query whether streaming is currently enabled.
    • Format: application/json - {"streaming":<bool>}

πŸŽ›οΈ Remote Control Commands

Settings can be changed dynamically by passing query parameters in HTTP GET requests (e.g., to the root path / or any control endpoint).

  • Parameters:
    • camera=<id|front|back|toggle>: Switches the active camera sensor (supports logical:physical ids).
    • resolution=<low|medium|high|auto|max|WxH>: Change capture/stream resolution. Use low|medium|high for presets; auto/max or explicit WxH may be used to control the negotiated stream size.
    • fps=<1..60>: Main stream frame rate.
    • stream_bitrate=<auto|500..8000>: Main stream target bitrate in kbps. auto scales ~0.2 bits per pixel per frame with resolution and frame rate.
    • stream_bitrate_mode=<vbr|cbr>: Main stream rate control mode (falls back to VBR when unsupported). Android 12+ enforces a minimum quality floor in VBR, so a low stream_bitrate can still produce a higher average bitrate; CBR bypasses that floor and stays closer to the target.
    • stream_keyframe_interval=<1..120>: Seconds between main stream keyframes.
    • stream_denoise=<0..100>: Noise Reduction slider. Spatial noise reduction runs on the phone's GPU before H.264 encoding; 0 disables it and the GPU load scales with the slider: levels 1–25 sample a 5-tap cross, 26–50 a full 3Γ—3, 51–75 add one wider ring, and 76–100 add the second ring. It applies live only to the back camera's GPU H.264 path, so MJPEG, front-camera and software YUV streams are not filtered. When the web panel's preview is MJPEG, switch to H.264 to see the effect live; RTSP and recordings still use it. The current value is reported as streamDenoise in /info.json.
    • zoom=<value>: Adjusts digital zoom (e.g., 1.0, 2.5).
    • scale=<value>: Adjusts preview stream scale (per-camera; e.g., 0.5, 1.0).
    • exposure=<value>: Adjusts exposure value (per-camera).
    • contrast=<value>: Adjusts contrast (software; per-camera, integer).
    • torch=<on|off|toggle>: Controls the flashlight.
    • audio_gain=<value>: Changes microphone gain multiplier (e.g., 1.0, 2.0).
    • focus_distance=<0..1|-1>: Set manual focus distance (0..1). Use -1 to restore autofocus.
    • snapshot_res=<max|stream>: Choose snapshot resolution for the selected camera (max for full sensor, stream to match current stream resolution).
    • recording_mode=<off|always_on|motion|continuous>: Camera/recording behaviour with no viewer connected: on demand (off), camera always on (always_on: keeps the stream ready for NVRs and samples Camera AE continuously, with optional notifications and recording), motion clips (motion: always enables notifications and records a clip on motion), or continuous segmented recording (continuous: notifications are optional). The legacy notify value is still accepted as always_on with notify_on_motion=true.
    • notify_on_motion=<true|false>: Enable motion detection, ONVIF motion events and phone motion notifications. It is forced on for motion, forced off for off, and otherwise independent of the recording mode. When off for always_on or continuous, the detector does not run and no motion events are sent; continuous recording still records.
    • recording_segment_minutes=<1..120>: Length of each continuous-recording clip (default 5).
    • recording_storage_limit_percent=<50..99>: Delete the oldest recordings once the drive reaches this usage (default 90).
    • motion_sensitivity=<1..10>: Motion detector sensitivity.
    • motion_record_stop_delay=<0..300>: Seconds to keep a motion clip after motion clears.
    • rotate=<degrees>: Rotate video stream/snapshot (persisted per-camera).
    • mirror=<true|false>: Mirror the video.
    • crop=<left,top,right,bottom|reset>: Crop the stream and snapshots to a normalised rectangle (0..1) of the rotated frame, persisted per-camera. reset removes the crop and restores the full frame. Changes restart the camera so the H.264 encoder follows the crop's aspect ratio. In the web control panel, open Settings β†’ Crop and drag a rectangle over the video preview; cropping is applied on the phone and can only be changed from a desktop browser.
    • api=<auto|camerax|camera1>: Prefer capture API implementation. In auto, a CameraX start whose H.264 GL surface never produces a frame falls back to Camera1; an explicit camerax choice stays on CameraX and switches H.264 to the software YUV path instead. A Camera1 HAL eviction (Camera error 2) also restarts the camera automatically.
    • night_mode=<on|off>: Replace live video with night-mode still photos on cameras that support it. The camera takes one night-sight / night-scene / low-light still at a time and feeds it into the current MJPEG or H.264 stream, so the frame rate drops to match the exposure time. If two consecutive stills time out, the selection stays on but the stream falls back to normal live video (with grayscale still following the night decision) so a legacy HAL cannot leave the camera on a frozen frame. When Auto Night-sight mode owns the switch, the web UI sends night_mode_override instead so a manual toggle becomes a temporary override. /info.json reports settings.nightMode.available for the selected camera and cameras[].nightMode.available for each lens; settings.nightMode.enabled is the stored selection, while nightSightDesired, nightSightOverride and active describe the current automatic/override state.
    • night_exposure=<ms>: Night-mode shutter time in milliseconds, applied with auto-exposure off. Only available when settings.nightMode.manual is true. The usable range is reported as settings.nightMode.exposureMinMs/exposureMaxMs (also per lens under cameras[].nightMode), and the current value is settings.nightMode.exposureMs. The default is 50% of the usable range.
    • night_iso=<value>: Night-mode sensor sensitivity (ISO), applied with auto-exposure off. The usable range is reported as settings.nightMode.isoMin/isoMax (also per lens under cameras[].nightMode), and the current value is settings.nightMode.iso. Longer exposure and higher ISO brighten dark scenes; very long exposures blur movement.
    • night_grayscale=<on|off>: Grayscale Night Mode (default off). Removes chrominance from the live GL video pipeline and the night still loop while preserving luminance, contrast and detail, which hides coloured low-light sensor noise. It applies to both MJPEG and H.264 without restarting the stream, and never changes camera exposure or ISO. The current value is reported as settings.nightMode.grayscale in /info.json.
    • night_grayscale_follow=<true|false>: Auto grayscale (default false). When an automatic night-mode trigger is selected, the effective grayscale state follows that trigger's dark/light decision, independently of whether Night-sight mode is on. A dark trigger enables grayscale even with night_mode off; a light trigger disables it even if the manual checkbox is on. The manual Grayscale Night Mode checkbox remains enabled; toggling it while Auto grayscale owns the state creates a temporary override that expires on the next night/day transition. With no trigger selected (or no usable sensor/location decision yet), the manual night_grayscale setting applies. While a torch is lit, night-sight and grayscale are paused without clearing either selection, then restored when the torch turns off. /info.json reports settings.nightMode.grayscaleFollow, grayscaleOverride, grayscaleDesired and grayscaleEffective.
    • night_grayscale_override=<on|off|clear>: Temporary grayscale choice while Auto grayscale is active and the trigger has a night/day decision. It overrides the automatic state until the next trigger transition, then automation resumes. clear returns to the automatic state immediately. When Auto grayscale or the trigger is off, on/off update the manual night_grayscale setting instead.
    • auto_night_mode=<off|gps|lux|gps_lux|schedule|camera_ae>: Automatic night mode trigger. It is off until a trigger is explicitly selected. gps follows civil twilight (βˆ’6Β° sun elevation) from the phone's location; lux follows the phone's ambient light sensor; gps_lux uses either; schedule uses fixed local times; camera_ae uses the camera's ISO/exposure telemetry with frame-luma fallback from a day-referenced video/preview/analysis stream; processed night stills are never used for the decision. camera_ae works in every recording mode: in On demand it samples only while a viewer, recording, snapshot or the on-phone preview runs the camera and never keeps the camera open, and each new camera session starts in day video so it re-detects; with Camera always on it samples continuously. On cameras whose night mode is only an OEM CameraX extension there is no day-referenced stream while night-sight runs, so the decision latches until the night session ends. Selecting off stops the schedule and disables the switching, grayscale-follow and torch controls. The GPS position is requested once and cached for 48 hours. Requires location permission for GPS modes. /info.json reports the state as settings.nightMode.autoMode (and the legacy auto boolean), autoSwitching, autoOffsetMinutes, autoLocationGranted, autoLocationAcquiring, autoLuxThreshold, autoLuxAvailable, the live ambient-light reading autoLux (null unless a LUX trigger is selected), autoScheduleStart, autoScheduleEnd, autoCameraAeThreshold, autoCameraAeSource, autoCameraAeLatched, the live autoCameraAe* telemetry fields, and the phone-local autoStart/autoEnd times for the current or upcoming period.
    • auto_night_switching=<true|false>: Auto Night-sight mode (default false). When true, the selected trigger is allowed to switch night-sight stills itself. This is independent of Auto grayscale and the torch profile: any combination of the three can be selected. When false, the trigger still drives Auto grayscale and the torch profile, but night-sight is not toggled automatically. The manual Night-sight checkbox remains enabled; toggling it while Auto Night-sight owns the state creates a temporary override until the next night/day transition. /info.json reports the shared decision as settings.nightMode.autoDark, the stored selection as enabled, and the effective/override state as nightSightDesired, nightSightOverride and active.
    • night_mode_override=<on|off|clear>: Temporary Night-sight choice while Auto Night-sight mode is active and the trigger has a night/day decision. It overrides the automatic state until the next trigger transition, then automation resumes. clear returns to the automatic state immediately. When Auto Night-sight mode or the trigger is off, on/off update the regular night_mode selection instead.
    • auto_night_offset=<minutes>: Shift both GPS night-mode transitions by this many minutes (βˆ’999 to 999). Positive values make both switches happen later; negative values make them earlier.
    • auto_night_lux=<lux>: LUX threshold for lux and gps_lux modes (default 5). Night mode turns on below the value and off at or above it.
    • auto_night_schedule_start=<HH:mm> / auto_night_schedule_end=<HH:mm>: Local-time window for the schedule trigger (default 21:00–06:00). The window may cross midnight.
    • auto_night_camera_ae_threshold=<50..100>: ISO percentage used to enter night in camera_ae mode (default 90). Entry also requires exposure at least 90% of the frame duration, or a clearly dark frame luma from the day-referenced stream, plus 15 seconds of continuous darkness. Exit normally takes 60 seconds of brightness; a nearly pure-white day-referenced frame (luma β‰₯ 240) forces a day switch after 10 seconds. Processed night stills are never used for metering. On demand meters only while the camera is running; Camera always on meters continuously.
    • night_torch_mode=<off|motion|always>: Torch profile while the automatic trigger says it is dark. It is independent of Auto Night-sight mode and Auto grayscale; all three can be selected together. motion turns the torch on for motion and restores night-sight/grayscale after the timer; it requires an always-on camera mode with motion notifications enabled (Motion clips, or Camera always on/Continuous recording with Notify on motion). always keeps the torch on while the trigger says dark: in On demand it runs only while the camera session is active (viewer, recording, snapshot or preview) and turns off when the camera is released, while always-on modes keep it on for the whole dark period. While any torch (manual, motion or always) is lit, night-sight and grayscale are paused without clearing their selections, and return when the torch turns off. Camera AE can be combined with always in On demand because the dark decision is latched for that streaming session (LUX is also latched while the torch is on); it cannot be combined with always in always-on modes because the torch would blind the meter. /info.json reports settings.nightMode.torchMode (legacy autoFlash remains true only for motion) and flashPaused while the suppression is active.
    • night_auto_flash=<true|false>: Legacy alias for night_torch_mode=motion|off.
    • night_auto_flash_seconds=<1..99>: Seconds to keep the torch on after motion clears (default 10). Additional motion during this wait restarts the timer.
    • osd_enabled=<true|false>: Burn the text overlay into the video itself (H.264 and MJPEG, including RTSP and recordings). /info.json reports the per-element choices under settings.osd.
    • osd_time=<true|false>, osd_date=<true|false>, osd_battery=<true|false>, osd_wifi=<true|false>, osd_temperature=<true|false>, osd_camera_name_enabled=<true|false>: Choose which overlay elements are shown. All elements are enabled by default when the overlay is switched on.
    • osd_camera_name=<text>: Camera-name line in the overlay. Leave empty to use the selected lens (for example Back 0). Maximum 40 characters.
    • overheat_pause_c=<0..100>: Pause streaming when the battery reaches this temperature in Β°C. Defaults to 45 when never set; 0 disables the guard. Streaming uses the same gate as /control/stop and resumes after the battery cools by 3Β°C.
  • Example command: https://[ip_address]:[port]/?torch=on&zoom=2.0

🎬 Motion events and recording

Choose a camera and automatic-recording mode under Recordings above. This section covers motion-event delivery and where clips are stored.

When Notify on motion is enabled (or Motion clips is selected), the app compares luma frames in the background. Sensitivity (1 = least sensitive, 10 = most sensitive, default 5) controls how much the frame must change; lighting changes such as a TV cutting between scenes are ignored. Motion is published as tns1:RuleEngine/CellMotionDetector/Motion and tns1:VideoSource/MotionAlarm over both PullPoint (CreatePullPointSubscription + PullMessages) and WS-BaseNotification (wsnt:Subscribe, Renew, Unsubscribe). Home Assistant, ONVIF Device Manager and UniFi Protect poll via PullPoint; hardware NVRs (for example Xiongmai/VMS) subscribe and receive wsnt:Notify HTTP POSTs at their consumer address whenever motion starts or stops. With Notify on motion off, the ONVIF service stays available but no motion events are published.

Notifications to an NVR contain event metadata only (topic and motion state, no video) and are posted to the consumer URL the authenticated NVR supplies, which is normally plain HTTP on the local network.

  • Stop Recording After Motion (under Sensitivity, default 10 seconds): how long a motion recording keeps running after motion clears; 0 stops immediately.
  • Continuous Clip Length (default 5 minutes): how often continuous recording closes the current file. Delete Oldest Clips at (default 90%) removes the oldest recordings once that drive usage is reached.

Recordings are saved to Movies/AndroidIPCamera by default. Choose another folder, such as one on an SD card, under Settings > Recording > Recording Storage Location.

ONVIF and RTSP use the username and password from the Authentication settings. ONVIF discovery uses UDP multicast, so the phone and the client must be on the same network (or reachable through a VPN that forwards multicast).

Permissions

The app uses the following permissions to function:

  • Camera (android.permission.CAMERA): Required to capture and stream the video feed.
  • Microphone (android.permission.RECORD_AUDIO): Required to record and stream audio. (Requested optionally at runtime; streaming works without audio if denied).
  • Notifications (android.permission.POST_NOTIFICATIONS): Required on Android 13+ to post a persistent foreground service notification, keeping the background streaming server running reliably, and to send motion alerts while the camera is always on.
  • Network (android.permission.INTERNET, android.permission.ACCESS_NETWORK_STATE): Required to host the server and stream data to your browser/connected clients.
  • Storage (android.permission.READ_EXTERNAL_STORAGE, android.permission.WRITE_EXTERNAL_STORAGE): Required on older Android versions to load custom TLS/HTTPS certificates from file storage and to save locally recorded MP4 files (WRITE_EXTERNAL_STORAGE only applies to Android 9 / API 28 and below; on newer versions recordings are saved to app-specific storage without extra permissions).
  • Wi-Fi & Location (android.permission.ACCESS_WIFI_STATE, android.permission.ACCESS_FINE_LOCATION, android.permission.ACCESS_COARSE_LOCATION, android.permission.NEARBY_WIFI_DEVICES): Used optionally to read the current Wi-Fi network's connection signal strength so it can be displayed in the web control panel overlay, and to follow sunrise/sunset for automatic night mode. If location is not granted, the Wi-Fi icon is hidden and automatic night mode stays off; manual night mode still works.
  • Start on boot (android.permission.RECEIVE_BOOT_COMPLETED): Allows the app to optionally offer to start streaming after the device boots. This feature is off by default and must be enabled in the app settings. On Android 14 and newer the app posts a notification after boot and streaming starts when it is tapped, because Android only allows the camera/microphone foreground service to start while the app is in the foreground.
Reproducible builds

Build releases in the container. Native macOS and Windows builds are not byte-for-byte identical to Linux builds - the Rust compiler, Android NDK and JDK each ship separate host toolchains - so they do not match the F-Droid APK. Build the release APK in the provided Docker builder or on a Linux CI runner, not with Android Studio's native toolchain.

The builder image is pinned to linux/amd64 because the Android NDK only ships x86_64 Linux host tools. On Apple Silicon, ARM Windows and ARM Linux hosts Docker runs it through x86_64 emulation: Docker Desktop does this automatically (Rosetta on Apple Silicon), while ARM Linux needs qemu-user-static/binfmt support for x86_64 containers. Docker prints a platform-mismatch warning on ARM hosts; it is expected and the build still runs.

Run the commands below from the repository root, so the mounted /workspace contains gradlew and rust-toolchain.toml.

This project uses reproducible builds. Release APKs should be built from a clean tree at the tagged commit in the container:

docker build -t android-ip-camera:builder .
docker run --rm \
  -v "$PWD":/workspace \
  -v "$HOME/.cache":/cache \
  android-ip-camera:builder release #-PenableAbiSplits=false

The container keeps the Android SDK, NDK, Gradle caches and Rust toolchain in $HOME/.cache (android-sdk/, gradle/, cargo/ and rustup/) and installs them on the first run, so later builds start quickly. Delete those directories to force a clean reinstall. Gradle's daemon is disabled in the container because it cannot survive the end of a docker run.

Signed app bundle build (verified afterwards like the APK release):

docker run --rm \
  -v "$PWD":/workspace \
  -v "$HOME/.cache":/cache \
  android-ip-camera:builder releaseBundle

Debug build:

docker run --rm \
  -v "$PWD":/workspace \
  -v "$HOME/.cache":/cache \
  android-ip-camera:builder debug

Clean the Gradle build outputs, or wipe the cached toolchains to force a fresh install:

docker run --rm \
  -v "$PWD":/workspace \
  -v "$HOME/.cache":/cache \
  android-ip-camera:builder clean

docker run --rm \
  -v "$HOME/.cache":/cache \
  android-ip-camera:builder clean-cache

Signing: copy signing.properties.default to signing.properties, set storeFile to your keystore (for example app/signing-key.jks) and fill in the passwords. Without signing.properties, add -PskipSigning to the release or releaseBundle command to produce an unsigned APK or bundle.

The release variant will automatically sign the APK and app bundle builds. Build-tools 35+ is known to produce signatures that fail reproducibility verification.

The OpenTunnel client is compiled from opentunnel-native by the Gradle build, so a local build also needs the Android NDK 27.2.12479018 and a Rust toolchain with the aarch64-linux-android and armv7-linux-androideabi targets. The Docker builder installs both.

Build Variants

By default, release builds generate architecture-specific APK splits for arm64-v8a and armeabi-v7a (the Rust OpenTunnel client is built for both) in addition to a universal APK. For F-Droid and other scenarios where a single universal APK is preferred, you can disable ABI splits:

F-Droid builds (single universal APK):

./gradlew clean assembleRelease -PenableAbiSplits=false

Release builds with architecture-specific APKs (default):

./gradlew clean assembleRelease

Release build as an app bundle:

./gradlew clean bundleRelease

The Docker builder wraps this as apic-build releaseBundle, which also verifies the bundle's signature and certificate after the build.

The enableAbiSplits property defaults to true. Set it to false to generate only the universal APK, which is the recommended approach for F-Droid to avoid unnecessary complexity in the build pipeline.

Every APK only packages the arm64-v8a and armeabi-v7a ABIs (ndk.abiFilters in app/build.gradle). CameraX ships an x86/x86_64 build of libimage_processing_util_jni.so, but the OpenTunnel client is only built for ARM. Packaging the CameraX x86 libraries would advertise x86 support (for example in the F-Droid listing) even though remote access would not work there.

To verify that two unsigned builds from the same source are identical:

mkdir -p build/unsigned
./gradlew clean assembleRelease -PskipSigning --no-daemon --max-workers=1 -Dorg.gradle.parallel=false
cp app/build/outputs/apk/release/*universal-release.apk build/unsigned/build1.apk
./gradlew clean assembleRelease -PskipSigning --no-daemon --max-workers=1 -Dorg.gradle.parallel=false
cp app/build/outputs/apk/release/*universal-release.apk build/unsigned/build2.apk
cmp -s build/unsigned/build1.apk build/unsigned/build2.apk && echo OK
# or: shasum -a 256 build/unsigned/build1.apk build/unsigned/build2.apk

If they differ, inspect with diffoscope build/unsigned/build1.apk build/unsigned/build2.apk.

To verify your signed release APK matches an unsigned rebuild use apksigcopier - the first APK must be signed:

./gradlew clean assembleRelease
apksigcopier compare app/build/outputs/apk/release/*universal-release.apk --unsigned build/unsigned/build1.apk && echo OK

CI runs this check automatically via the Reproducible Build workflow.

Builds downloaded from the official repository should match the following signing certificate:

apksigner verify --print-certs app/build/outputs/apk/release/*universal-release.apk
Signer #1 certificate DN: CN=DigitallyRefined
Signer #1 certificate SHA-256 digest: 1111be81c861e199c6485d367c37680c4b778fba301980d2f0f9a2800f77f70a
Signer #1 certificate SHA-1 digest: 1560ceccdd719b2b97d431ad9a4c877abf5c2f32
Signer #1 certificate MD5 digest: 5fdf04f5b6bab9fdacbe28aa6dc85abb

Regenerate store assets

The stylised store screenshots and feature graphic are rendered from the raw captures in fastlane/metadata/android/en-US/images/phoneScreenshots/ with Pillow in Docker:

docker run --rm -v "$(pwd):/work" -w /work python:3.12-slim bash -c \
  "apt-get update -qq && apt-get install -y -qq fonts-noto-core fonts-dejavu-core > /dev/null 2>&1 && \
   pip install -q pillow && \
   python fastlane/scripts/store_assets.py"

Outputs are written to fastlane/metadata/android/en-US/images/phoneScreenshots/stylised/.

About

Turn your Android device into a remote security IP camera

Topics

Resources

Stars

557 stars

Watchers

6 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages