Skip to content

About

Utilities for analyzing and restoring videos

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

mediasnacks

Utilities video and images.

Install

FFmpeg and Node.js must be installed.

npm install -g mediasnacks

Overview

mediasnacks <command> <args>

Commands

  • avif Converts images to AVIF

  • png Optimizes PNG images with oxipng

  • sqcrop Square crops images

  • base64 Encodes image to data URI

  • resize Resizes videos or images

  • edgespic Extracts first and last frames

  • frameseq Converts video to sequence of PNGs

  • countframes Counts frames in a video

  • ssim Computes similarity of two images

  • gif: Video to GIF

  • info: Prints video attributes

  • tag: Sets color tag for Finder

  • detectdups Detects sequentially duplicate frames in a video

  • dropdups Removes sequentially duplicate frames in a video

  • framediff: Plays a video of adjacent frames diff

  • hev1tohvc1: Fixes video thumbnails not rendering in macOS Finder

  • moov2front Rearranges .mov and .mp4 metadata for fast-start streaming

  • vconcat: Concatenates videos

  • vdiff: Plays a video with the difference of two videos

  • vsplit: Splits a video into multiple clips from CSV timestamps

  • vtrim: Trims video from start to end time

  • prores: Converts video to Apple ProRes

  • flattendir: Moves unique files to the top dir and deletes empty dirs

  • qdir Sequentially runs all *.sh files in a folder

  • seqcheck Finds missing sequence number

  • openrand Opens a random file

  • play Plays filtered playlist with mpv

  • dlaudio: yt-dlp best audio

  • dlvideo: yt-dlp best video

  • unemoji: Removes emojis from filenames

  • rmcover: Removes cover art

Globs

Glob patterns are expanded by Node.js.

mediasnacks avif file[234].png
# Expands to: file2.png, file3.png, file4.png
mediasnacks avif -- file[234].png
# Literal filename: "file[234].png"

Adding a macOS Quick Action

For example, for dropdups -n2 file.mov

  • Open Automator
  • Select: Quick Action
  • Workflow receives current: movie files in Finder.app
  • Action: Run Shell Script
export PATH="/opt/homebrew/bin:/opt/homebrew/opt/node@24/bin"
for f in "$@"; do
  $HOME/bin/mediasnacks dropdups -n2 "$f"
done

It will be saved to ~/Library/Services

About

Utilities for analyzing and restoring videos

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages