Preface¶
In DSH, doing multimedia processing, the two common paths are not smooth: one is letting the agent assemble commands, which breaks when paths, parameters, or ffmpeg versions change; the other is uploading files to a cloud service, compromising privacy and network. dsh-media-converter (maintainer a1121611810) takes the third path: the plugin packages common operations like conversion, trimming, extracting audio tracks, exporting subtitles, compressing images, rewriting metadata, and Base64 encoding/decoding into a GUI. It uses the local ffmpeg underneath, so files never leave the machine. Below, I introduce its capabilities, installation, and typical usage.
1. What is this¶
The plugin name is dsh-media-converter, categorized as “Workflow”, currently has 0 stars, is published to npm, version 1.3.1, license MIT.
One-sentence positioning: A local multimedia toolbox plugin for DeepSeek Harness, conversion/trimming/extracting audio/subtitles/metadata/Base64 all done by local ffmpeg. The UI has two layers: the queue handles processing multiple files at once, clicking a row enters file details where single file operations happen.
For agent developers, the same engine is also registered as a tool media_toolbox, which the agent can call directly. The tool consumes local absolute paths, no upload involved.
2. Core Features¶
Supported functional actions are as follows (from the README feature list):
- Convert to X: Video 12 types (mp4/mov/mkv/webm/avi/flv/wmv/ts/ogv/gif/mp3/m4a), Audio 8 types (mp3/m4a/aac/wav/flac/ogg/opus/aiff), Image 7 types (png/jpg/webp/gif/bmp/tiff/avif).
- Trim a segment: Get start/end from player, or manually fill
min:sec; trimming and conversion are completed in one go. - Extract audio / Extract frame: Directly copy streams, no re-encoding.
- Extract subtitle: Export embedded subtitle tracks to
.srt, filename includes language code (e.g.,clip.chi.srt). - Image compression: Select JPG / WEBP and re-encode via quality slider; real-time preview on the right, supports side-by-side/slider comparison.
- Metadata: View container, chapters, per-track parameters, and all tags; rewrite title/author/album/notes/date/genre, save as new file.
- Base64: Convert current file to
data:URL; or paste Base64 to restore to file/text. - Batch processing: Group by type, video/audio/images each have a target; text is separate and doesn’t participate; “reading/unknown” separate; select all per group, quality, progress/result per line/cancel.
Several implementation details worth noting:
- GPU / Direct copy: macOS VideoToolbox H.264 can enable GPU encoding (mp4/mov/mkv/flv/ts); compatible codecs/containers use
-c copy, no re-encoding. - Cancel: Canceling mid-batch stops the current ffmpeg and clears the queue; single file tasks can be canceled anytime; upload can also be interrupted.
- PTC scheduling: Optional for batch conversion. Choose one from registered models in DSH (default follows main model). The model returns a JSON plan per file; the host validates and passes it to PTC sandbox for execution; low inference tier, staged progress. Default off, costs tokens.
README provides a set of benchmark data (10s 1080p30 sample, machine load ~4.6, not real files): libx264 veryfast CRF 23 takes 2.1–2.3s, output 6.35MB, VMAF 95.02; h264_videotoolbox 5Mbps two-pass parallel 3.2s, output 6.45MB, VMAF 95.15; direct copy 0.02s, output 11.48MB, VMAF none. Conclusion: Direct copy is fastest when compatible; GPU quality is close to CPU with lower CPU usage. For real files, resolution and load differ, follow on-site results.
3. Installation and Enablement¶
Published to npm (dsh-media-converter), install in one line:
dsh plugin --profile web add dsh-media-converter
Replace web with your own profile name. Can also use install_bundle from plugin_manager in Harness.
Install from GitHub (fallback if not on npm):
dsh plugin add github:a1121611810/dsh-media-converter --profile <profile>
After installation, “Media Toolbox” appears in the left sidebar. Restart app after changing package name: running Host caches old package name client entries, hot reload doesn’t clear them.
4. Typical Usage¶
1. Trim a video in the web interface¶
- Drag files into the queue.
- Click “Details” on that row to enter file details page.
- Select “Trim a segment” in the action grid. Start/End can be manually filled
min:sec, e.g., trim 0:10 to 1:00. - Select mp4 as target format, parameters expand in place, result displays in place after conversion.
2. Batch conversion¶
- Check multiple video files in the queue.
- Select “Convert” in the “Batch Processing” card at the top. Set target format in the video group title.
- Check “GPU Encoding (VideoToolbox)” if needed.
- After submission, view progress and results line by line, cancel anytime.
3. Let the Agent call directly¶
Actions of tool media_toolbox include probe (read duration, resolution, codec, audio tracks, subtitle tracks, tags), convert (convert format, can include trim for trimming, quality for image quality), extract-audio / extract-video (extract audio/frames, no re-encoding), subtitle (export embedded subtitles to .srt), rewrite-tags (rewrite title/author/album/notes/date/genre).
There is a “Media Toolbox” button in the input box toolbar (the row with the “+” button): click it to insert example command convert xx.mov 0:10 to 1:00 to mp4 into the input box, change to your own file and interval, then send.
5. Configuration and Dependencies¶
Dependency: ffmpeg¶
Plugin looks for ffmpeg in order: config.ffmpegPath -> FFMPEG_PATH -> PATH -> common installation directories -> static package bundled with imageio-ffmpeg. If not found, page top shows installation method. Works without ffprobe, metadata parsed from ffmpeg -i output.
Configuration Items¶
In the settings popup sidebar, the “Media Toolbox” page allows direct editing: saved after host’s settings service validates and writes to profile (corresponding config block appears in cordis.patch.yml), immediately applied to running plugin, no restart needed. Same config drives the official config form in the “Built-in Plugins” page for this plugin row, from the plugin’s exported Schemastery schema:
- id: media-converter
name: 'dsh-media-converter'
config:
outputDir: ~/Movies/converted
ffmpegPath: /opt/homebrew/bin/ffmpeg
maxUploadMb: 2048
outputDir:~expands to home directory, path parsed to absolute. Default~/Downloads/media-toolbox.ffmpegPath: Manually specify if ffmpeg not found.maxUploadMb: Single upload limit, default 2048 MB, reject directly if exceeded, don’t write to disk.composerButton: Whether to show “Media Toolbox” button in input box toolbar, default on.groups: Order and visibility of action modules in file details page (convert,edit,view, only those written as strings are shown).
6. Scenarios and Notes¶
Suitable for scenarios in DSH that require frequent, batch multimedia processing without wanting files to leave: transcoding, trimming trailers, extracting audio, exporting embedded subtitles, compressing images, editing metadata, Base64 round-trips. Regarding large files: upload saves to disk as received, preview uses HTTP Range, DSH interface responds normally during transcoding. Temporary files placed in $TMPDIR/dsh-media-converter, auto-deleted after >2 hours, cleared when plugin is uninstalled.
Three notes:
- Plugin runs with current DSH process permissions; check source code and license before installing (this plugin is MIT).
- Upload limit, CPU scheduling capacity, GPU encoding switch all depend on local ffmpeg and system environment; corresponding switches are hidden if undetectable.
- PTC batch conversion is default off and consumes tokens; only turn on when you need the model to decide the target format for each file.
7. Conclusion¶
One-sentence recap: dsh-media-converter brings common ffmpeg operations into DSH’s GUI and the media_toolbox tool. Conversion and trimming done in one go, direct -c copy when compatible, processing locally without external transfer.
Directory page: https://www.skillhub.cn/plugins/a1121611810/dsh-media-converter
Repository: https://github.com/a1121611810/dsh-media-converter