Skip to content

About

Helper App for creating YTPMV (YouTube Poop Music Videos) or MAD videos.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

ytpmv-maker

A Node.js command-line tool for automatically generating YTPMV (YouTube Poop Music Videos) or MAD videos. It takes a short source video and a target MIDI file, and automatically pitch-shifts and sequences the source video to match the notes of a specified MIDI track.

Demo

⚠️ Video containts flashing imagery.

Demo Output

Prerequisites

  • Node.js installed on your system.
  • FFmpeg installed and accessible in your system's PATH. This tool heavily relies on fluent-ffmpeg to process video and audio.

Installation

Clone the repository and install the dependencies:

git clone https://github.com/yourusername/ytpmv-maker.git
cd ytpmv-maker
npm install

Usage

Basic usage:

node index.js --video input.mp4 --midi input.mid --channel 0 --basePitch 60 --output output.mp4

Options

The CLI supports the following configuration options:

Option Alias Description Default
--video -v Path to the source video file to be pitched. ./input.mp4
--midi -m Path to the target MIDI file. ./input.mid
--channel -c MIDI track/channel index to use for the sequence. 0
--basePitch -b MIDI Pitch value describing the un-shifted source video note (e.g., 60 is C4). 60
--output -o Output file name. output.mp4
--info -i Print MIDI file information (tracks and note counts) and exit without rendering.
--audioOnly -a Only generate the audio track. Useful for faster rendering and debugging. false
--tenSeconds -t Only generate the first 10 seconds of output. Useful for testing before doing a full render. false
--debugNotes -d Output the parsed MIDI notes to the specified JSON file and exit.
--help -h Show help information.

How it works

  1. The tool reads the target MIDI file (--midi) using @tonejs/midi.
  2. It parses the specified track (--channel) into a sequence of notes with timings and duration.
  3. It takes the source video (--video) and determines how much it needs to be pitch-shifted. The base pitch of the source video is defined by --basePitch.
  4. It uses FFmpeg via fluent-ffmpeg to generate clips at the correct pitch, scale the duration of the clips to match the MIDI notes, and eventually concatenates or mixes them to produce the final output.mp4.

Example Workflow

  1. Find out the MIDI tracks: Run node index.js -m your_song.mid -i to list all available tracks in your MIDI file. Find the track index (e.g., 2) that contains the main melody.

    You can use an online tool like https://www.openmusic.ai/midi-editor to view and edit a MIDI file.

  2. Find out the base note of your source video: Determine the pitch of the subject in your source video. For example, if the subject is singing an 'A4', the --basePitch would be 69. Use the same online tools as above to find the base note.

  3. Test the output: Run a quick 10-second test to see if it sounds correct: node index.js -v source.mp4 -m your_song.mid -c 2 -b 69 -t

  4. Render the final video: node index.js -v source.mp4 -m your_song.mid -c 2 -b 69 -o final.mp4

Dependencies

About

Helper App for creating YTPMV (YouTube Poop Music Videos) or MAD videos.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages