npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@codedimension/video-editor

v1.1.0

Published

Video Editor CLI merges .mkv files to a single .mp4 file

Readme

Video Editor CLI

A simple Node.js CLI tool for common video editing tasks, primarily focused on .mkv files.

This tool provides three main commands:

  1. trim-silence: Detects and removes silence from the beginning and end of .mkv files.
  2. merge-videos: Merges multiple .mkv files sequentially into a single .mp4 file.
  3. process-course: Orchestrates the processing of an entire folder structure, merging videos per class and copying auxiliary files.

Prerequisites

This tool relies on FFmpeg. You must have FFmpeg installed and available in your system's PATH.

  • Ubuntu/Debian: sudo apt install ffmpeg
  • macOS: brew install ffmpeg
  • Windows: Download from the official website or use winget install ffmpeg

Installation

You can run the CLI directly if you are inside the project folder:

Install dependencies

npm install

Build the project

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
  1. Link the package globally:
    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.

Usage

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.

1. Trim Silence (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/

2. Merge 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

3. Process Course (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

Troubleshooting

  • FFmpeg not installed/found: Ensure ffmpeg is accessible from your terminal by running ffmpeg -version.
  • No silence detected: The 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".