npm.io
1.5.4 • Published 7 months agoCLI

menc

Licence
ISC
Version
1.5.4
Deps
3
Size
3.5 MB
Vulns
0
Weekly
0
Stars
1

Menc (media encoder) helps convert media files into different formats in a simpler way, with a friendly UI that shows progress, ETA, and compression rate.

Media Encoder (ffmpeg wrapper)

Compress and Convert Your Videos with Command Line

Quick Start

  1. Install ffmpeg.
  2. Install Node.js or Bun.sh.
  3. Run npx menc or bunx menc.

Usage

Usage: menc [options] <files...>

Media encoder (ffmpeg wrapper)

  It helps to convert media files into different
  formats in a simpler way with friendly UI showing
  progress, eta, and compression rate.


Arguments:
  files                        one or more files to encode

Options:
  -v, --version                print version
  -i, --info                   print media information
  -d, --dir <name>             output directory
  -s, --start-time <hh:mm:ss>  trim start time
  -e, --end-time <hh:mm:ss>    trim end time
  --copy                       copy the input stream (the output will not to be re-encoded)
  -c, --custom <value>         use custom ffmpeg options
  -f, --format <format>        output format (choices: "mp3", "ogg", "mp4", "sd:480p", "hd:720p", "fhd:1080p", "qhd:1440p", "2k:1080p",
                               default: "mp4")
  -h, --help                   display help for command

Hint:
  You can also use short names for the "--format" argument.
  For example, instead of "--format sd:480p", you can type
  "--format sd" or "--format 480p".

Formats:
  mp3 (mpeg-1 Audio Layer 3) is a music format that can compress files by up to 95%.
  ogg is a multimedia container format commonly used for audio and video files.
  mp4 is a widely used multimedia file storage format for storing video.
  sd or 480p is a video format with 4:3 ratio and 640x480 size.
  hd or 720p is a video format with 16:9 ratio and 1280x720 size.
  fhd or 1080p is a video format with 16:9 ratio and 1920x1080 size.
  qhd or 1440p is a video format with 16:9 ratio and 2560x1440 size.
  2k video or 1080p is a video format with 1:1.77 ratio and 2048x1080 size.

Examples:
  $ npx menc <filename>

  Since "--format" argument is default to "mp4", this command
  will compress your input file and create a new <filename>.mp4
  file inside the current directory.

  $ npx menc -d 123 *.mov

  It will compress all MOV files from the current directory and
  put them inside the "123" sub-directory.

  $ npx menc -f hd <filename>

  It will convert the <filename> video to HD:720p format and
  create a new <filename_hd>.mp4 file inside the current
  directory.

  $ npx menc -s 10 -e 1:09:04 <filename>

  Compress the input file into a new <filename>.mp4 from
  the 10th second until 1:09:04.

  $ npx menc -e 1:05 --copy <filename>

  Trim the input file (no re-encoding) into a new file from
  the beginning until 1:05.

  $ npx menc --custom '-vf scale=320:-2' <filename>

  Scale the output video, making the width equal to 320, keeping
  the aspect ratio ("-2" ensures that the aspect ratio always
  conforms to the codec requirements).

  $ npx menc -c '-qscale:a 6' -f mp3 <filename>

  Set audio quality (variable bitrate) for the output MP3 file
  to 6 (smaller size).