npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@yoseiyamazaki/media-compression-integrater

v1.0.12

Published

A flexible, profile-based media compression tool using ffmpeg.

Readme

Media Compression Integrater

npm version License: MIT

Media Compression Integrater

Media Compression Integraterは、ffmpegを使用して画像や動画を圧縮するためのコマンドラインツールです。ffmpegのコマンドを直接記述した独自の圧縮プロファイルを定義でき、出力を完全にコントロールし、設定を共有することが可能です。

主な機能

  • プロファイルベースの圧縮: 動画用のHEVC、画像用のWebP/AVIFなど、用途に応じた複数の圧縮プロファイルを定義できます。
  • 対象拡張子の指定: プロファイルごとに変換対象とするファイルの拡張子を指定でき、無関係なファイルは自動でスキップされます。
  • 柔軟な実行: 圧縮プロファイルを指定すればその一つだけを、指定しなければ定義された全プロファイルを実行します。
  • ffmpegコマンドを直接利用: ffmpegのコマンドラインオプションを直接記述できるため、最大限の柔軟性を持ちます。
  • スマートなファイル命名: 変換元と変換先の拡張子が同じ場合、ファイルの上書きを防ぐためにファイル名が自動的に変更されます (例: video.mp4 -> video.hevc.mp4)。
  • 同一階層への出力: デフォルトでは、圧縮されたファイルは元ファイルと同じディレクトリに保存されます。

必須要件

本ツールを使用する前に、お使いのシステムに上記がインストールされていることを確認してください。

インストール

グローバルインストール (推奨)

コマンドラインツールとしてどこからでも利用したい場合は、グローバルにインストールします。

npm install -g @yoseiyamazaki/media-compression-integrater

ローカルインストール

特定のプロジェクトでのみ利用する場合は、開発依存関係としてインストールします。

npm install -D @yoseiyamazaki/media-compression-integrater

この場合、コマンドの実行は npx mci のように npx を接頭辞として使用します。

使い方

1. 設定ファイルの初期化

まず、プロジェクトディレクトリで以下のコマンドを実行し、設定ファイル compress.config.json を生成します。

# グローバルインストールの場合
mci init

# ローカルインストールの場合
npx mci init

2. 設定ファイルの編集

生成された compress.config.json を開き、圧縮プロファイルを定義します。各プロファイルでは、対象の拡張子 (targetExtensions) と ffmpeg のコマンド (command) を指定します。

設定例 (compress.config.json):

{
  "profiles": {
    "hevc": {
      "targetExtensions": [".mov", ".mp4"],
      "command": "-c:v libx265 -crf 28 -c:a aac -b:a 128k"
    },
    "webp": {
      "targetExtensions": [".png", ".jpg", ".jpeg"],
      "command": "-c:v libwebp -lossless 0 -q:v 80"
    }
  }
}

3. 圧縮の実行

ファイルを指定して圧縮を実行します。

# hevcプロファイルを使って動画を圧縮
mci my_video.mp4 -p hevc

# webpプロファイルを使って画像を圧縮
mci my_image.png -p webp

プロファイルを指定しない場合、対象の拡張子に一致するすべてのプロファイルが実行されます。

mci my_video.mp4

また、ファイルだけでなくフォルダのパスを指定することも可能です。その場合、指定されたフォルダ配下のすべてのファイルが圧縮対象となります。

# hevcプロファイルを使ってフォルダ内の動画をすべて圧縮
mci path/to/your/directory -p hevc

オプション

  • -p, --profile <name>: 使用する圧縮プロファイルを指定します。
  • -o, --output <path>: 圧縮ファイルの出力先ディレクトリを指定します。デフォルトは入力元と同じディレクトリです。
  • -c, --config <path>: 使用する設定ファイルのパスを指定します。デフォルトは ./compress.config.json です。

ライセンス

このプロジェクトは MIT License の下で公開されています。