Sign inSign up

psyb0t/mediaproc

By psyb0t

•Updated 2 months ago

Image
0

3.8K

psyb0t/mediaproc repository overview

⁠docker-mediaproc

CI version license Docker Pulls

Containerized media processing tools over SSH. Drop files in, run ffmpeg/sox/imagemagick over SSH, get your shit out.

Built on top of psyb0t/lockbox⁠ - see that repo for the security model, file operations, path sandboxing, and all the SSH lockdown details.

⁠Features

  • FFmpeg 7.1 with frei0r, LADSPA, and LV2 plugins - video effects, audio effects, all the good shit
  • Sox - audio processing swiss army knife
  • ImageMagick - image manipulation, conversion, thumbnails, whatever
  • 2200+ fonts - emoji, CJK, Arabic, Thai, Indic, monospace, you fuckin' name it

⁠Quick Start

curl -fsSL https://raw.githubusercontent.com/psyb0t/docker-mediaproc/main/install.sh | sudo bash

This sets up ~/.mediaproc/ with the docker-compose file, authorized_keys, and work directory, then drops a mediaproc command into /usr/local/bin. Uses your UID/GID so you don't end up with shit permissions on files like some fuckin' animal.

Add your SSH key and start it:

cat ~/.ssh/id_rsa.pub >> ~/.mediaproc/authorized_keys
mediaproc start -d
ssh -p 2222 mediaproc@localhost "ffmpeg -version"
mediaproc start              # foreground
mediaproc start -d           # detached
mediaproc start -d -p 22    # custom port (default 2222)
mediaproc start -d -c 4     # limit to 4 CPUs
mediaproc start -d -r 4g    # limit to 4GB RAM
mediaproc start -d -s 2g    # limit swap to 2GB
mediaproc start -d -f /path/to/fonts  # custom fonts directory
mediaproc stop               # stop
mediaproc upgrade            # pull latest image, asks to stop/restart if running
mediaproc uninstall          # stop and remove everything
mediaproc status             # show status
mediaproc logs               # show logs
⁠docker run

If you just wanna run it raw without the install script:

docker pull psyb0t/mediaproc

cat ~/.ssh/id_rsa.pub > authorized_keys
mkdir -p work host_keys

docker run -d \
  --name mediaproc \
  --restart unless-stopped \
  -p 2222:22 \
  -e "LOCKBOX_UID=$(id -u)" \
  -e "LOCKBOX_GID=$(id -g)" \
  -v $(pwd)/authorized_keys:/etc/lockbox/authorized_keys:ro \
  -v $(pwd)/host_keys:/etc/lockbox/host_keys \
  -v $(pwd)/work:/work \
  psyb0t/mediaproc

ssh -p 2222 mediaproc@localhost "ffmpeg -version"

⁠Allowed Commands

That's it. That's the list. Everything else gets a nice "not allowed" message.

CommandDescription
ffmpegVideo/audio encoding, transcoding, filtering
ffprobeMedia file analysis
soxAudio processing
soxiAudio file info
convertImage conversion/manipulation
identifyImage file info
magickImageMagick CLI
⁠File Operations

All file paths are relative to /work. Traversal attempts get blocked, absolute paths get remapped under /work.

CommandDescription
putUpload file from stdin
getDownload file to stdout
list-filesList directory (plain names, --json for detailed)
remove-fileDelete a file
create-dirCreate directory (recursive)
remove-dirRemove empty directory
remove-dir-recursiveRemove directory and everything in it recursively
move-fileRename or move a file
copy-fileCopy a file
file-infoGet file metadata as JSON
file-existsCheck if file exists (exits 0 or 1)
file-hashGet SHA256 hash of a file
disk-usageGet bytes used in path or all of /work
search-filesSearch for files matching a glob pattern
append-fileAppend stdin to a file

⁠Usage Examples

# Upload a file, process it, download the result
ssh mediaproc@host "put input.mp4" < input.mp4
ssh mediaproc@host "ffmpeg -i /work/input.mp4 -c:v libx264 /work/output.mp4"
ssh mediaproc@host "get output.mp4" > output.mp4

# Get video info as JSON
ssh mediaproc@host "ffprobe -v quiet -print_format json -show_format /work/video.mp4"

# Apply frei0r glow effect
ssh mediaproc@host "ffmpeg -i /work/in.mp4 -vf frei0r=glow:0.5 /work/out.mp4"

# Convert audio format
ssh mediaproc@host "sox /work/input.wav /work/output.mp3"

# Resize image
ssh mediaproc@host "convert /work/input.png -resize 50% /work/output.png"

# Create thumbnail
ssh mediaproc@host "convert /work/input.jpg -thumbnail 200x200 /work/thumb.jpg"

# List files
ssh mediaproc@host "list-files"
ssh mediaproc@host "list-files --json"

# Manage files
ssh mediaproc@host "create-dir project1"
ssh mediaproc@host "move-file old.mp4 new.mp4"
ssh mediaproc@host "remove-file output.mp4"
ssh mediaproc@host "remove-dir-recursive project1"

⁠Fonts

Over 2200 fonts covering pretty much every script and use case:

  • Core: DejaVu, Liberation, Ubuntu, Roboto, Open Sans
  • Emoji & CJK: Noto Color Emoji, Noto Sans CJK (Chinese, Japanese, Korean)
  • Monospace: Fira Code, Hack, Inconsolata
  • International: Arabic, Thai, Khmer, Lao, Tibetan, Indic scripts

Need more? Mount your custom fonts to /usr/share/fonts/custom and the container will pick them up on startup. Font cache gets rebuilt automatically.

⁠SSH Client Config

Stop typing port numbers like it's 1995. Add this kinda shit to ~/.ssh/config:

Host mediaproc
    HostName localhost
    Port 2222
    User mediaproc

Then just: ssh mediaproc "ffmpeg -version"

⁠Agent integrations

The skill⁠ works in any agent that reads .agents/skills/, and installs natively in the clients below.

⁠Claude Code
claude plugin marketplace add psyb0t/agents
claude plugin install mediaproc@psyb0t

Claude Code prompts for the mediaproc host and port at enable time.

⁠Codex
codex plugin marketplace add psyb0t/agents
codex plugin add mediaproc@psyb0t

Installed via the marketplace, the skill invokes as $mediaproc:mediaproc. Codex also picks the skill up automatically, no install needed, in any repo containing .agents/skills/, where it invokes as plain $mediaproc.

⁠OpenClaw

The skill is published to ClawHub on every release:

openclaw skills install @psyb0t/mediaproc

⁠Building

make build       # build Docker image
make test        # build + run integration tests
make installer   # generate install.sh from installer.yaml

⁠License

This project is licensed under WTFPL⁠ - Do What The Fuck You Want To Public License.

Tag summary

Content type

Image

Digest

sha256:723854ffe…

Size

744.2 MB

Last updated

2 months ago

docker pull psyb0t/mediaproc