Skip to content

Instantly share code, notes, and snippets.

@coderofsalvation
Last active August 19, 2025 14:37
Show Gist options
  • Save coderofsalvation/79d50b41ca3e6600ecf16cc4db11819f to your computer and use it in GitHub Desktop.
Save coderofsalvation/79d50b41ca3e6600ecf16cc4db11819f to your computer and use it in GitHub Desktop.
TAPO camera merge SD-card files to one MP4 #fast #nocloud #ffmpeg
#!/bin/sh
test -z "$1" && { echo "usage: find $(pwd)/file{01..05}.mp4 | ffmpeg.concat out.mp4"; exit 0; }
echo "" > /tmp/files.txt
cat | while read file; do
echo "file '$file'" >> /tmp/files.txt
done
set -x
ffmpeg -y -f concat -safe 0 -i /tmp/files.txt -an -c copy "$1"
rm /tmp/files.txt

TAPO camera's are pretty neat for hasslefree filming of events (splashproof, wide angle, scheduled recording, great auto-exposure-sharpening). However, due to limited memory/cpu you'll end up with segmented mp4 files on your SD-card. The app does not help either (*)

Solution with the shellscript below you can combine all separate TAPO videofiles to one file:

$ cd /run/media/yourTAPOSDcard
$ find $(pwd)/*tp000{41..70}.mp4 | ffmpeg.concat /tmp/merged.mp4

Here files 00041 till 00070 are combined into merged.mp4 without re-encoding (=fast)

NOTE: audio is ignored (for events you'll want to record audio separately, and merge in POST anyways).

* = The app either allows realtime recording the SD-video again (good luck waiting 6 hours for a 6hour event) or creating clips (max 10 mins?). Perhaps all this is an upsell for the cloud subscription, however we don't need that..we need FFMPEG ❤

TAPO-camera's like Tapo260 cannot handle light-changes (discolights e.g.) without introducing artifacts. This can be mitigated by adding the -vf "spp=5:10:0:1" ffmpeg argument (see postprocessing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment