Utilities optimizing and preparing video and images for the web.
FFmpeg and Node.js must be installed.
npx mediasnacks <command> <args>Commands:
-
avifConverts images to AVIF -
resizeResizes videos or images -
sqcropSquare crops images -
moov2frontRearranges .mov and .mp4 metadata for fast-start streaming -
dropdupsRemoves duplicate frames in a video -
seqcheckFinds missing sequence number -
qdirSequentially runs all *.sh files in a folder -
hev1tohvc1: Fixes video thumbnails not rendering in macOS Finder -
framediff: Plays a video of adjacent frames diff -
vdiff: Plays a video with the difference of two videos -
vconcat: Concatenates videos -
dlaudio: yt-dlp best audio -
dlvideo: yt-dlp best video -
unemoji: Removes emojis from filenames -
rmcover: Removes cover art -
curltime: Measures request response timings -
gif: Video to GIF -
vcut: Split video in two parts at a given time -
flattendir: Moves unique files to the top dir and deletes empty dirs
npx mediasnacks avif [-y | --overwrite] [--output-dir=<dir>] <images> Resizes videos and images. The aspect ratio is preserved when only one dimension is specified.
--width and --height are -2 by default:
-1auto-compute while preserving the aspect ratio (may result in an odd number)-2same as-1but rounds to the nearest even number
npx mediasnacks resize [--width=<num>] [--height=<num>] [-y | --overwrite] [--output-dir=<dir>] <files>Example: Overwrites the input file (-y)
npx mediasnacks resize -y --width 480 'dir-a/**/*.png' 'dir-b/**/*.mp4'Example: Output directory (-o)
npx mediasnacks resize --height 240 --output-dir /tmp/out video.movRearranges .mov and .mp4 metadata to the start of the file for fast-start streaming.
Files are overwritten
npx mediasnacks moov2front <videos>hat is Fast Start?
- https://wiki.avblocks.com/avblocks-for-cpp/muxer-parameters/mp4
- https://trac.ffmpeg.org/wiki/HowToCheckIfFaststartIsEnabledForPlayback
MIT