Skip to main content

Server API Reference

When the streaming server is running (default port 4444, via https:// or http:// depending on TLS configuration), you can access the following endpoints:

📺 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 section, image rotation, flash light toggle, resolution, zoom, exposure and contrast.
  • 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"
  • 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, Wi-Fi signal strength, individual camera lens settings and 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>}

📡 RTSP stream​

The RTSP endpoints are rtsps://[username]:[password]@[ip_address]:8554/live and .../live/sub (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: /live/sub is a smaller version of the same picture for slow links such as 4G, and can be watched 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 in addition to the main stream only while someone watches it. Where the picture does not go through the GPU path (front camera, devices whose camera is not FULL level), the sub stream carries the main stream instead.
  • Audio: the microphone as AAC-LC (44.1 kHz mono), honouring the audio_gain control. Can be turned off with Include Audio, and is left out when the 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.

🎛️ 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 each step widens the filter, starting from a dense 3×3 bilateral pass and adding two wider sampling rings as the slider rises to 100. 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|notify|motion|continuous>: Camera/recording behaviour with no viewer connected: on demand (off), notify only (always on, no recording), motion clips, or continuous segmented recording.
    • 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.
    • 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. /info.json reports settings.nightMode.available for the selected camera and cameras[].nightMode.available for each lens; settings.nightMode.enabled is the current value.
    • 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.
    • 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.
  • Example command: https://[ip_address]:[port]/?torch=on&zoom=2.0

🎬 Motion events and recording​

Choose a recording mode in the web interface or with recording_mode:

  • On demand (off): the camera opens when a viewer connects (HTTP/RTSP) and is released when the last one leaves.
  • Notify only (notify): the camera stays on, detects motion and publishes ONVIF events, but writes no local MP4 files.
  • Motion clips (motion): like Notify only, and also records a -motion.mp4 clip while motion is present.
  • Continuous recording (continuous): records every moment into -continuous.mp4 segments, with the camera always on.

Except in On demand, 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.

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.

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).