Troubleshooting

Common issues and solutions when working with MediaProc CLI.

Installation Issues

Command Not Found

Problem: After installing MediaProc, running mediaproc returns "command not found".

Solutions:

Check global npm bin directory:

Terminal
$ npm config get prefix
/usr/local

Ensure this directory is in your PATH. Add to your ~/.bashrc or ~/.zshrc:

export PATH="$PATH:/usr/local/bin"

Reinstall globally:

Terminal
$ npm uninstall -g @mediaproc/cli
$ npm install -g @mediaproc/cli
✓ Installed @mediaproc/cli@latest

Use npx as alternative:

Terminal
$ npx @mediaproc/cli image resize photo.jpg --width 1920

Permission Errors

Problem: Getting EACCES or permission denied errors during installation.

Solutions:

Fix npm permissions (recommended):

Terminal
$ mkdir -p ~/.npm-global
$ npm config set prefix ~/.npm-global
$ echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
$ source ~/.bashrc

Use sudo (not recommended):

Terminal
$ sudo npm install -g @mediaproc/cli
Warning

Using sudo for npm installs can cause permission issues later. The first solution is preferred.


Plugin Issues

Plugin Not Found

Problem: After adding a plugin, commands return "plugin not found" error.

Check installed plugins:

Terminal
$ mediaproc list
Installed plugins:
• image (50 commands)
• video (6 commands)

Reinstall the plugin:

Terminal
$ mediaproc remove audio
$ mediaproc add audio
✓ Installed audio plugin

Verify plugin installation path:

Terminal
$ ls ~/.mediaproc/plugins

Plugin Installation Fails

Problem: Plugin installation fails with dependency errors.

Common causes:

  • Missing system dependencies (FFmpeg, Sharp)
  • Network issues
  • Incompatible Node.js version

Check Node.js version:

Terminal
$ node --version
v18.17.0

MediaProc requires Node.js 16 or higher.

Install system dependencies:

macOS:

Terminal
$ brew install ffmpeg

Ubuntu/Debian:

Terminal
$ sudo apt update
$ sudo apt install ffmpeg

Windows:

Terminal
$ choco install ffmpeg

Processing Errors

FFmpeg Not Found

Problem: Video or audio commands fail with "FFmpeg not found" error.

Install FFmpeg:

Terminal
$ ffmpeg -version
ffmpeg version 6.0

If not installed, see FFmpeg installation guide.

Specify FFmpeg path manually:

Terminal
$ export FFMPEG_PATH=/usr/local/bin/ffmpeg

Out of Memory Errors

Problem: Processing large files causes memory errors.

Solutions:

Increase Node.js memory limit:

Terminal
$ NODE_OPTIONS="--max-old-space-size=8192" mediaproc video transcode large.mp4

Process in smaller batches:

Instead of:

Terminal
$ mediaproc image resize *.jpg --width 1920

Do:

Terminal
$ ls *.jpg | xargs -n 10 mediaproc image resize --width 1920

Use streaming mode for video:

Terminal
$ mediaproc video transcode large.mp4 --stream

File Not Found Errors

Problem: MediaProc can't find input files.

Common causes:

  • Wrong working directory
  • Special characters in filenames
  • Glob patterns not expanding

Use absolute paths:

Terminal
$ mediaproc image resize /full/path/to/photo.jpg

Quote filenames with spaces:

Terminal
$ mediaproc image resize "my photo.jpg" --width 1920

Check working directory:

Terminal
$ pwd
$ ls -la photo.jpg

Format Issues

Unsupported Format

Problem: Getting "unsupported format" errors.

Check supported formats:

Terminal
$ mediaproc image convert --help

Convert to supported format first:

Terminal
$ ffmpeg -i input.mkv -c copy temp.mp4
$ mediaproc video transcode temp.mp4

Codec Issues

Problem: Output video won't play in certain players.

Use widely compatible codecs:

Terminal
$ mediaproc video transcode video.mp4 --codec h264 --format mp4

Check codec support:

Terminal
$ ffmpeg -codecs | grep h264

Performance Issues

Slow Processing

Problem: Processing takes much longer than expected.

Enable hardware acceleration:

Terminal
$ mediaproc video transcode video.mp4 --hw-accel

Use fast mode (stream copy):

Terminal
$ mediaproc video trim video.mp4 --start 10 --duration 30 --fast

Process in parallel:

Terminal
$ ls *.mp4 | xargs -P 4 -I {} mediaproc video transcode {}

Reduce quality for faster processing:

Terminal
$ mediaproc image resize *.jpg --width 1920 --quality 80

CPU Usage Too High

Problem: MediaProc uses 100% CPU.

Limit concurrent operations:

Terminal
$ mediaproc image batch *.jpg --concurrency 2

Nice the process (lower priority):

Terminal
$ nice -n 10 mediaproc video transcode large.mp4

Configuration Issues

Settings Not Persisting

Problem: Configuration changes don't persist between runs.

Check config file location:

Terminal
$ mediaproc config list

Set config explicitly:

Terminal
$ mediaproc config set output.directory ./processed
$ mediaproc config set image.default.quality 90

Reset to defaults:

Terminal
$ mediaproc config reset

Common Error Messages

"ENOSPC: no space left on device"

Solution: Free up disk space before processing.

Terminal
$ df -h
$ du -sh * | sort -h

"Error: spawn ENOMEM"

Solution: Reduce memory usage or increase available memory.


"Error: Command failed with exit code 1"

Run with verbose flag to see full error:

Terminal
$ mediaproc video transcode video.mp4 --verbose

Debug Mode

Enable Detailed Logging

Terminal
$ DEBUG=* mediaproc image resize photo.jpg --verbose

Save Debug Log to File

Terminal
$ mediaproc video transcode video.mp4 --verbose 2>&1 | tee debug.log

Getting Help

Check Command Help

Terminal
$ mediaproc --help
$ mediaproc image --help
$ mediaproc image resize --help

Validate Configuration

Terminal
$ mediaproc validate

Report an Issue

If you've found a bug or issue not covered here:

  1. Check existing issues: GitHub Issues
  2. Collect debug information:
    Terminal
    $ mediaproc --version
    $ node --version
    $ npm --version
    $ ffmpeg -version
  3. Create a new issue with reproduction steps

Platform-Specific Issues

macOS

Gatekeeper blocking FFmpeg:

Terminal
$ xattr -d com.apple.quarantine /usr/local/bin/ffmpeg

M1/M2 Rosetta issues:

Terminal
$ arch -arm64 npm install -g @mediaproc/cli

Windows

PowerShell execution policy:

Terminal
$ Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Path separator issues:

Use forward slashes or escape backslashes:

Terminal
$ mediaproc image resize C:/Users/name/photo.jpg

Linux

Missing shared libraries:

Terminal
$ ldd $(which ffmpeg)
$ sudo apt install libavcodec-extra

Best Practices

Always test commands first:

Terminal
$ mediaproc image resize photo.jpg --width 1920 --dry-run

Keep backups of original files

Use descriptive output names

Monitor disk space for batch operations

Update MediaProc regularly:

Terminal
$ npm update -g @mediaproc/cli

Found an issue? Help us improve this page.

Edit on GitHub →