# IP camera Techage TA-XM-608GP-AI-30 (3MP)

### Specifications
- **Full AliExpress name:** *Techage H.265 3MP Two Way Audio POE IP Camera IP66 Waterproof Outdoor Video CCTV Security Surveillance Camera for POE NVR System*
- Bought on **[AliExpress](https://s.click.aliexpress.com/e/_ApHUVD), at the time for $35** (shipped from EU warehouse)
- **Model:** `Techage TA-XM-608GP-AI-30`
- **Lens:** `3.6 mm`
- **Power:** either 12 V DC, or 48V PoE
- **Default login:** `admin`/`null`
- **Administration:** requires Internet Explorer + ActiveX plugin
- **Resolution:** on the sticker 3MP, but within the settings the highest resolution is actually **4MP** at `2560x1440` (so something like 3.6 megapixels, also called 1440p or QHD)
- **Framerate:** 1-25 fps (can be adjusted)

### Worth mentioning
- This camera can do both H264 and H265 (HEVC) stream. When the codec is set to H.265X, the stream is actually x264 (and H265 is actual x265).
- The stream carries wrong aspect ratio metadata (should be 16:9, but it's actually 64:27). See `ffprobe` output bellow. Can be fixed without re-encoding, but it's annoying.
- There is some (2-way) speaker that was always buzzing. I cut it off. NOTE: Other Techage camera was the same way, but only when powered on by 12 V. When powered over ethernet (POE) it was quited. So POE is preffered way of powering.
- Default IP is `192.168.1.10` with DHCP disabled.

### RTSP stream URL for ZoneMinder or VLC:
```bash
rtsp://192.168.1.150:554/user=admin_password=tlJwpbo6_channel=1_stream=0&protocol=unicast.sdp?real_stream
```

### Random settings:
```bash
# In-camera setting: "H.265X" + "4MP"
Video: h264 (High), yuvj420p(pc, progressive), 2560x1440 [SAR 4:3 DAR 64:27], 25 fps, 10 tbr, 90k tbn

# In-camera setting:"H.265" + "4MP"
Video: hevc (Main), yuvj420p(pc), 2560x1440 [SAR 4:3 DAR 64:27], 25 fps, 10 tbr, 90k tbn

# In-camera setting: "H.265X" + "3MP"
Video: h264 (High), yuvj420p(pc, progressive), 2304x1296 [SAR 4:3 DAR 64:27], 25 fps, 10 tbr, 90k tbn
```

### Fixing the wrong aspect ratio without re-encoding
With ZoneMinder's pass-through recording, for some reason my camera's raw footage is saved with a 64:27 aspect ratio. This means that it is a bit more noodly than it should be. This is fairly easy to fix with ffmpeg:

```bash
ffmpeg -i in.mp4 -aspect 16:9 -c copy out.mp4
```

Since I couldn't get ZoneMinder to force this parameter (`-aspect 16:9`) directly this as it saves the stream, I use this quick and dirty solution that runs via crontab every hour or so and fixes the recordings for me:

```bash
#!/bin/bash

# FIND ALL MP4 in /CCTV/1 OLDER THAN 60 MIN BUT YOUNGER THAN 4 HOURS (ASSUMING SCRIPT WILL RUN EVERY UNDE 4 HRS)
# CHECK WITH FFPROBE WHETHER THE FILE HAS BEEN FIXED YET
# IF NOT, FFMPEG WITH proper AR

CCTVDIR=/cctv/1

while IFS= read -r input; do
	ffprobe "$input" &>/tmp/ffprobe-techage.txt
	filecheck=$(cat /tmp/ffprobe-techage.txt | grep Stream | grep 16:9)
	if [ -z "$filecheck" ]; then
		echo "Recording "$input" needs to be fixed. Proceeding..."
		oldname=$(basename "$input")
		fixedname=fixed-$(basename "$input")
		directory=$(dirname $input)
		ffmpeg -i "$directory"/"$oldname" -aspect 16:9 -c copy "$directory"/"$fixedname" </dev/null
		mv "$directory"/"$oldname" "$directory"/"$oldname".old
		mv "$directory"/"$fixedname" "$directory"/"$oldname"
		rm "$directory"/"$oldname".old
	else
		echo "Recording "$input" has been fixed already. Skipping..."
	fi
	rm /tmp/ffprobe-techage.txt
done < <(/usr/bin/find $CCTVDIR -name '*-video.mp4' -mmin +15 -mmin -1440 -type f)

```

### Sample footage
Will add at some point. Overall very nice image for $35.