Every second matters
Always backup your original media files before running any scripts. The renaming and compression tools modify files in place or move them, which could lead to data loss if a script fails or is interrupted.
• Compressed files are saved to new compressed_*/ folders.
• Original files are moved to a done/ folder.
Warning: This significantly reduces file size (e.g., 24GB → 4GB) but reduces quality and may strip metadata (e.g., GPS).
Video (MP4/MOV to 1080p):
mkdir -p compressed_mp4 done; for f in *.mp4; do ffmpeg -i "$f" -vf "scale=-2:1080,format=yuv420p" -c:v h264_nvenc -preset p4 -c:a aac -b:a 192k "compressed_mp4/$f"; done
* See scripts/converter.txt for CPU-only or MOV commands.
Images (JPEG):
mkdir -p compressed_jpeg done && find . -name "*.jpg" | xargs -I {} convert "{}" -quality 85 -strip "compressed_jpeg/$(basename "{}")"Media files must be named with a date pattern (e.g., YYYYMMDD_HHmmss) for correct sorting.
1. Edit the script:
renamer/index.jsUpdate the dir variable to point to your media folder:
const dir = '/path/to/your/media'
2. Run the script:
cd renamer node index.js
Run the master script to generate thumbnails and index files (.the_files.txt, .thumbnails_index.txt).
./scripts/generate-all-indexes.sh /path/to/your/media
* This may take a while for large collections. It uses FFmpeg with hardware acceleration if available.
Click the folder icon in the top-left corner and select the same folder you processed.