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

Specifications

Worth mentioning

RTSP stream URL for ZoneMinder or VLC:

rtsp://192.168.1.150:554/user=admin_password=tlJwpbo6_channel=1_stream=0&protocol=unicast.sdp?real_stream

Random settings:

# 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:

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:

#!/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.


Revision #18
Created 17 March 2022 08:27:54 by jiripavlik
Updated 2 February 2023 12:06:41 by jiripavlik