
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
@codedimension/video-editor
Advanced tools
A simple Node.js CLI tool for common video editing tasks, primarily focused on .mkv files.
This tool provides three main commands:
trim-silence: Detects and removes silence from the beginning and end of .mkv files.merge-videos: Merges multiple .mkv files sequentially into a single .mp4 file.process-course: Orchestrates the processing of an entire folder structure, merging videos per class and copying auxiliary files.This tool relies on FFmpeg. You must have FFmpeg installed and available in your system's PATH.
sudo apt install ffmpegbrew install ffmpegwinget install ffmpegYou can run the CLI directly if you are inside the project folder:
npm install
npm run build
## How to use locally
To use the `video-editor` command directly from any directory in your terminal (like a global system command), you need to link it using npm.
1. Ensure you have built the latest version of the code:
```bash
npm run build
npm link
Now you can open a new terminal anywhere on your computer and run commands directly, for example:
cd /my/course/directory
video-editor process-course ./MyCourse
Note: Whenever you modify the TypeScript source code, you only need to run npm run build again. Because the package is linked, the global video-editor command will automatically use the newly built files in the dist folder.
If you linked the package, you can run video-editor directly from any directory. Otherwise, run node dist/index.js or npx video-editor instead.
trim-silence)Automatically detects silence (below -30dB) at the start and end of your video recordings and trims it out. This is useful for removing the 1-2 seconds of dead air when starting or stopping a recording.
Options:
--input <path>: The path to a single .mkv file, or a directory containing multiple .mkv files. (Required)--output <path>: The path where the trimmed file(s) should be saved. Can be a directory or a specific file name. (Required)Examples:
Process a single file:
video-editor trim-silence --input my-recording.mkv --output ./trimmed-recording.mkv
Batch process an entire directory of .mkv files (saves them to a folder named trimmed_videos):
video-editor trim-silence --input ./raw_videos/ --output ./trimmed_videos/
merge-videos)Merges all .mkv files within a specified directory into a single .mp4 output file. The files are merged in alphabetical order. As part of this process, the command automatically detects and trims silence from the beginning and end of each .mkv file before merging them.
Options:
--videosDir <path>: The directory containing the .mkv files you want to merge. (Required)--outputFile <path>: The exact path and filename for the resulting .mp4 file. (Required)Example:
Merge all MKV files in the raw_clips directory into final_video.mp4:
video-editor merge-videos --videosDir ./raw_clips/ --outputFile ./final_video.mp4
process-course)Orchestrates the video editing workflow across a defined directory structure. It expects a course directory containing a nao-editado folder, which in turn contains a two-level structure: module/class.
For each class, the tool merges all .mkv files into a .mp4 named after the class folder itself, and copies any auxiliary files (like .pdf or .txt) to an editado folder, preserving the structure.
Options:
<coursePath>: The path to the root course directory containing the nao-editado folder. (Required)--skip-existing: Skip classes that already have a generated .mp4 file in the editado folder. Useful for resuming an interrupted process. (Optional)Example Structure:
/MyCourse
/nao-editado
/Module-1
/Class-A
- video1.mkv
- video2.mkv
- notes.pdf
Output Structure:
/MyCourse
/editado
/Module-1
/Class-A
- Class-A.mp4
- notes.pdf
Example:
Process a whole course:
video-editor process-course /path/to/MyCourse
Resume processing by skipping existing files:
video-editor process-course /path/to/MyCourse --skip-existing
ffmpeg is accessible from your terminal by running ffmpeg -version.trim-silence command looks for audio below -30dB lasting at least 0.5 seconds. If your background noise is louder than -30dB, it might not detect the start/end as "silence".FAQs
Video Editor CLI merges .mkv files to a single .mp4 file
The npm package @codedimension/video-editor receives a total of 249 weekly downloads. As such, @codedimension/video-editor popularity was classified as not popular.
We found that @codedimension/video-editor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.