FreezeTrimmer

Batch video tail trimming driven by motion analysis: detect sustained no-motion/freeze sections, keep the meaningful recording, and optionally clean the final motion tail.

Windows EXE pending upload Explore features
The uploaded source archive does not contain the compiled EXE yet
Video utility

Automatically trim long frozen or inactive tails

FreezeTrimmer scans video recordings, looks for a stable no-motion period, and trims the recording at the point where that inactive tail begins. It is designed for folder-based processing rather than manual one-video-at-a-time editing.

Why this tool exists

Have you ever forgotten to stop a recording — and later found hours of empty video filling your disk?

This happens more easily than it sounds, especially with medical endoscopic recordings. The examination ends, attention moves immediately to the patient, documentation or the next procedure, and the recording is simply left running. A useful ten-minute examination can then become a file containing hours of an unchanged or inactive scene.

Do you really want to open every oversized recording and find the true ending by hand?

One forgotten recording is inconvenient. Repeated across days or months, these inactive tails consume substantial storage space and make archives unnecessarily large. FreezeTrimmer is designed to detect sustained no-motion sections and remove the unnecessary tail automatically across a batch of recordings.

Recover wasted disk spaceRemove hours of accidental inactive recording that can accumulate after the real procedure has finished.
Built for recording archivesParticularly useful where medical endoscopic or similar recordings are created frequently and may be left running unintentionally.
Clean entire foldersApply the same detection rules to many videos instead of finding and trimming each ending manually.
Current source version reviewed: v2.9. The published site describes the behavior found in that source. Source code is intentionally not exposed on the public product page.

Core workflow

  • Select a source folder containing multiple video files
  • Optionally include all subdirectories
  • Supported default extensions: MP4, MOV, MKV, M4V, AVI, MPG and MPEG
  • Analyze each video for sustained no-motion using OpenCV
  • Apply a configurable post-hold period before accepting the frozen/stable section
  • Skip videos where no suitable stable section is detected
  • Keep recordings unchanged when the removable tail is shorter than the configured minimum duration
  • Trim all qualifying files in one batch operation

Two output modes

1

Overwrite originals

Processed output is created in a temporary pipeline and then safely moved over the original file after confirmation.

2

Choose a target folder

Keep the originals and write trimmed files to a separate destination using the same filenames.

3

Preserve folder layout

When subdirectories are included, the source folder hierarchy can be mirrored under the selected target directory.

Motion detection

The main detection stage uses OpenCV background subtraction and motion-ratio analysis. The thresholds are exposed in the GUI rather than being hard-coded.

MOG2 background subtractionConfigurable variance threshold for distinguishing foreground motion.
Motion ratio thresholdControls how much detected foreground movement is accepted as “still”.
Analysis FPSAdjustable sampling rate balances processing speed and temporal resolution.
Resize widthAnalysis frames can be downscaled for faster processing.
Top-band maskingAn optional upper image strip can be ignored during motion analysis.
Morphology kernelForeground masks can be cleaned before the motion ratio is evaluated.

Optional homogeneity support

FreezeTrimmer can strengthen the no-motion decision by checking whether the candidate stable section is visually flat and similar across sampled frames.

  • Optional homogeneity detection can be enabled or disabled
  • Laplacian variance threshold evaluates local image detail
  • Gray-level standard deviation helps recognize visually uniform frames
  • PSNR threshold evaluates similarity between consecutive sampled frames
  • These checks are combined with motion-ratio analysis rather than replacing it

Tail cleanup

After the initial trim, an optional second pass searches the new output for the last actual motion event. When enough extra inactive material remains, FreezeTrimmer can trim closer to that final movement.

  • Second-pass tail cleanup can be enabled independently
  • Uses PSNR between sampled grayscale frames to recognize motion
  • Configurable tail-analysis sampling FPS
  • Configurable motion PSNR threshold
  • Adds a small configurable pad after the last detected motion
  • Only applies the extra trim when the potential gain exceeds a configurable minimum

Fast or safe trimming

Fast trim / stream copyUses FFmpeg codec copy for speed when re-encoding is not required.
Safe trim / re-encodeRe-encodes video as H.264 (libx264, CRF 18, veryfast) and audio as AAC 160 kbps.

Batch-processing details

  • Live per-file and overall progress bars
  • Overall percentage and estimated remaining time (ETA)
  • Processing runs in a worker thread so the GUI remains responsive
  • Cancel button requests a controlled stop of the active batch
  • Detailed activity log shows analysis, trim, tail cleanup, skipped files and errors
  • Output keeps the original filename; no automatic suffix is appended
  • Original file timestamps are copied to processed output where possible
  • Overwrite mode restores the original timestamps after replacement

Default behavior in v2.9

  • Minimum removable recording tail: 15 seconds
  • Post-hold period: 3 minutes
  • Subdirectory processing enabled
  • Fast stream-copy trimming selected
  • Homogeneity support enabled
  • Tail cleanup enabled
FFmpeg dependency: the reviewed source expects ffmpeg.exe and ffprobe.exe either in the system PATH or selected manually in the GUI. The final downloadable EXE should therefore be published together with clear FFmpeg packaging/install information unless those binaries are bundled into the release.

Public distribution

The public sothis.dev page will distribute the compiled Windows application only. The Python source archive used to document the software is not copied into the website and is not linked from this page.