This tool replaces the international House MD intro, present in current public releases of House, with the audio of the original Teardrop Intro sequence. The replacement is acccomplished by aligning a Teardrop landmark (piano chord) to the audio from the international intro. Specifically, it relies on two landmark transients from the two international intros which are detected in each episode, or leaves the episode as-is if Teardrop is already present.
This is intended for personal usage only; it is the user's responsibility to acquire the source files. The output of this utility is not intended for public distribution.
- Python 3.11+
uvffmpegandffprobeavailable onPATH
uv sync
uv run house-teardrop --help- This repository does not include episode files, reference audio, or any copyrighted soundtrack assets.
- The
data/directory is intentionally gitignored; supply your own source episodes and reference files locally. config/no_intro_skip_episodes.jsonis the default skip-list file used by the batch pipeline.
# 1) Batch run (recursive source scan, mirrored output tree)
uv run house-teardrop run \
--input-root /path/to/house_source \
--output-root /path/to/house_output \
--teardrop-audio /path/to/teardrop.flac \
--reference-landmarks-json data/intl-intro/reference_landmarks.json \
--confidence-min 0.55 \
--peak-ratio-min 1.3 \
--no-intro-skip-json config/no_intro_skip_episodes.json \
--existing-teardrop-confidence-min 0.85 \
--existing-teardrop-confidence-margin 0.20 \
--manifest-file sync_manifest.json \
-j 4
# Optional: restrict candidates to specific references
uv run house-teardrop run \
--input-root /path/to/house_source \
--output-root /path/to/house_output \
--teardrop-audio /path/to/teardrop.flac \
--reference-audio data/intl-intro/intl_house-md.mp3 \
--reference-audio data/intl-intro/intl_house-md_type2.mp3
# Optional verification clip
uv run house-teardrop verify \
--episode /path/to/output_episode.mkv \
--sync-time 188.458 \
--output-clip /path/to/preview.mp4- Recursive input discovery under
--input-root - Output path mirrors source tree under
--output-root - Chapter markers are used only to narrow search windows
- Landmark-based audio matching determines final placement timing
- Replacement requires both confidence and isolated-peak checks to pass
- Existing Teardrop intros are detected and skipped automatically
- Optional chapter-missing/outlier fallback scan (
60s..600s) - Known no-intro episodes are blocked via skip list safety net
- No-intro episodes are copied through unchanged and marked
no_introin manifest - Batch run always continues and prints summary
- Video/subtitles are stream-copied
- Audio preserved as stereo or 5.1; Teardrop injected into front L/R
detection: loads reference profiles, decodes audio windows, extracts landmark features, and scores candidate intro matchesmedia: probes media metadata, builds ffmpeg filtergraphs, and performs the intro-audio replacementpipeline: builds batch work items, processes one episode through explicit phases, and persists manifest results
uv run python -m unittest discover -s tests -qGenerated files such as sync_manifest.json are intended to stay local and are gitignored.
Default path: data/intl-intro/reference_landmarks.json
{
"intl_type1": {
"path": "intl_house-md.mp3",
"landmark_seconds": 6.64,
"role": "production"
},
"intl_type2": {
"path": "intl_house-md_type2.mp3",
"landmark_seconds": 6.23,
"role": "production"
},
"s01e02_diag": {
"path": "s01e02_intro_ref_10s.wav",
"landmark_seconds": 6.23,
"role": "diagnostic"
}
}role=diagnosticentries are ignored unless--include-diagnostic-referencesis set.
Default path: config/no_intro_skip_episodes.json
{
"skip_episodes": ["S01E01", "S08E22"]
}sync_manifest.json stores one record per episode with fields including:
status:processed|no_intro|failed|skipped_existingreasonsource_path,output_pathchapter_end_time,search_windowconfidence,detection_methodmatched_reference_key,matched_reference_audio,reference_confidencesteardrop_confidence,teardrop_peak_ratio,teardrop_confidence_margindetected_start_time,detected_transient_timeaudio_start_time,intro_end_timeplacement_mode,teardrop_landmark_seconds,applied_alignment_shifthas_intro
Code in this repository is licensed under the MIT License. Media files, episode sources, and soundtrack assets are not included and remain subject to their own licenses and ownership restrictions.