Hi everyone,
I wanted to share a working solution for a common issue with generic Anyka / HiSilicon IP cameras (lightbulb cameras, XM modules, and "N1 protocol" firmware devices).
The Problem:
After a firmware update, ONVIF and standard RTSP ports (554/8899) disappear completely. The camera only serves a proprietary RTSP-over-HTTP stream at:
http://<CAMERA_IP>/livestream/11?action=play&media=video_audio_data
When trying to connect using NVRs (Hikvision, Dahua, Shinobi, Frigate,
Blue Iris, VLC, curl), it fails immediately with 401 Unauthorized.
Root Cause: The camera's embedded Nginx server responds with 401 Unauthorized without sending a WWW-Authenticate challenge header. Standard HTTP clients/NVRs wait for this header to negotiate auth (Basic/Digest) and fail instantly when it's missing.
The Fix:
We need to force a pre-emptive Authorization: Basic header on the initial request. We use go2rtc + a small FFmpeg wrapper script on Linux (Debian LXC, Proxmox, Raspberry Pi, Docker) to convert this HTTP stream into a standard, 24/7 RTSP feed (rtsp:/<SERVER_IP>:8554/garden_camera) with 0% CPU transcoding overhead.
--------------------------------------------------
Step-by-Step Setup Guide (Debian / Linux LXC)
--------------------------------------------------
Step 1: Install Dependencies & go2rtc
Run in your Linux terminal:
apt update && apt install -y ffmpeg curl wget ca-certificates
wget
-O /usr/local/bin/go2rtc
chmod +x /usr/local/bin/go2rtc
Step 2: Create the FFmpeg Wrapper Script
Create /usr/local/bin/stream_camera.sh:
cat << 'EOF' > /usr/local/bin/stream_camera.sh
#!/bin/bash
exec ffmpeg -headers $'Authorization: Basic YWRtaW46\r\n' -i "
" -c:v copy -an -f rtsp "$@"
EOF
chmod +x /usr/local/bin/stream_camera.sh
(Note: Replace 192.168.1.136 with your camera's IP address. YWRtaW46 is Base64 for admin: with no password. If you have a password, convert username

assword to Base64).
Step 3: Configure go2rtc
Create /etc/go2rtc.yaml:
cat << 'EOF' > /etc/go2rtc.yaml
streams:
garden_camera:
- exec:/usr/local/bin/stream_camera.sh {output}
EOF
Step 4: Create Systemd Service (Autostart 24/7)
Create /etc/systemd/system/go2rtc.service:
cat << 'EOF' > /etc/systemd/system/go2rtc.service
[Unit]
Description=go2rtc RTSP Gateway Proxy
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/go2rtc -config /etc/go2rtc.yaml
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now go2rtc
Check status:
systemctl status go2rtc
Step 5: Connect your NVR / Shinobi / Blue Iris / Frigate
1. Web Preview: Open http://<SERVER_IP>:1984 in your browser to view the WebRTC stream live.
2. NVR Stream URL: Add as a standard RTSP camera:
rtsp:/<SERVER_IP>:8554/garden_camera
Hope this helps anyone dealing with these Anyka N1 cameras!