Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@codedimension/video-editor

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codedimension/video-editor

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

npmnpm
Version
1.2.1
Version published
Weekly downloads
259
-21.52%
Maintainers
1
Weekly downloads
 
Created
Source

Video Editor CLI

A powerful Node.js command-line interface (CLI) tool for automated video editing tasks, primarily focused on .mkv files. It optimizes common workflows such as silence removal, batch merging, and course processing with high-quality output.

Key Features

  • Automatic Silence Removal: Detects and removes silence (start, end, or middle) using FFmpeg filters.
  • Natural Sorting: Intelligently sorts files numerically (e.g., part2.mkv comes before part10.mkv).
  • High-Quality Output: Default encoding uses libx264 with CRF 18 and slow preset for visually lossless results.
  • Batch Processing: Orchestrates complex folder structures for courses or large collections.

Prerequisites

This tool depends 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

To install and use video-editor from anywhere in your terminal without downloading the source code:

npm install -g @codedimension/video-editor

After installation, you can run the video-editor command directly.

Development Installation

If you want to run the CLI from source code:

# Install dependencies
npm install

# Build the project
npm run build

To use the video-editor command locally during development:

  • Build the latest version:

    npm run build
    
  • Link the package globally:

    npm link
    

Source code changes will be reflected after each npm run build.

Commands

1. Remove Silence from Videos (remove-silence-of-videos or rsov)

The most advanced trimming command. It removes all silence sections from a batch of videos, including silence in the middle of a recording.

Arguments:

  • [directory]: The directory containing .mkv files (Defaults to the current directory).

Options:

  • --start <number>: Manual start time in seconds (overrides silence detection).
  • --end <number>: Manual end time in seconds (overrides silence detection).

Features:

  • Removes middle silence by default.
  • Automatically skips files containing [skip] in their name.
  • Exports processed files to a trimmed-videos subfolder as .mp4.

Example:

video-editor rsov ./raw_recordings --start 5 --end 120

2. Trim Silence (trim-silence)

A simpler version that focuses on removing silence only from the start and end of files.

Options:

  • --input <path>: The path to a single .mkv file or a directory. (Required)
  • --output <path>: The path where the trimmed file(s) should be saved. (Required)

Example:

video-editor trim-silence --input recording.mkv --output ./trimmed/

3. Merge Videos (merge-videos)

Merges multiple .mkv files into a single high-quality .mp4 file.

Options:

  • --videosDir <path>: The directory containing the .mkv video files. (Required)
  • --outputFile <path>: The exact path and filename for the resulting .mp4. (Required)

Features:

  • Automatic Trimming: Detects and removes silence at the ends of each clip before merging.
  • Natural Order: Merges files in numerical/natural order.
  • High Quality: Uses CRF 18 and slow preset for the final export.

Example:

video-editor merge-videos --videosDir ./parts/ --outputFile final.mp4

4. Process Course (process-course)

Orchestrates a complete course editing workflow through a defined directory structure.

Input Structure:

/MyCourse
  /nao-editado
    /Module-1
      /Lesson-A
        - 1_intro.mkv
        - 2_demo.mkv
        - materials.pdf

Output Structure (/editado folder):

/MyCourse
  /editado
    /Module-1
      /Lesson-A
        - Lesson-A.mp4 (Merged and trimmed)
        - materials.pdf (Automatically copied)

Options:

  • <coursePath>: Path to the course root folder. (Required)
  • --skip-existing: Skips lessons that already have an output .mp4 file.

Example:

video-editor process-course /path/to/MyCourse --skip-existing

Technical Details

  • Silence Detection: Threshold set at -30dB for at least 0.5s.
  • Encoding Settings:
    • Video: libx264, pix_fmt yuv420p
    • Audio: aac
    • Quality: CRF 18, Preset: slow (optimized for high quality and reasonable file size).

Troubleshooting

  • FFmpeg not found: Make sure the ffmpeg -version command works in your terminal.
  • No silence detected: If the background noise is higher than -30dB, the tool might not detect silence correctly.

FAQs

Package last updated on 01 Jun 2026

Did you know?

Socket

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.

Install

Related posts