Efficient Search of Live-Coding Screencasts from Online Videos

Chengran Yang, Ferdian Thung, David Lo

Introduction

Online video platforms like YouTube and MOOCs have become essential repositories for programming knowledge. Among the various formats available, developers often prefer "live-coding" screencasts—videos where experts write and edit code in real-time—because they demonstrate authentic problem-solving habits and step-by-step logic. However, finding these specific videos is challenging; a standard keyword search often returns a cluttered mix of slide-based lectures, vlogs, and static presentations. While existing research focuses on extracting code from such videos, there is a significant "discovery gap" in identifying the videos themselves. PSFinder addresses this by automatically classifying whether a video is a live-coding session based on its visual content.

Methodology

PSFinder employs a two-stage pipeline designed to balance high classification accuracy with computational efficiency.

1. Frame Sampler

To avoid the overhead of analyzing every frame in a multi-hour video, PSFinder samples one frame every 30 seconds. It then utilizes Normalized Root-Mean-Square Error (NRMSE) to compare consecutive frames. If the pixel-level difference falls below a 0.05 threshold, the frame is discarded as a duplicate. This pruning step reduces the total running time by approximately 32% without compromising accuracy.

2. Video Classifier

The remaining non-duplicate frames are processed through a fine-tuned Vision Transformer (ViT). This model classifies individual frames as either "IDE" (containing an Integrated Development Environment) or "non-IDE."

To confirm a video is a live-coding screencast, PSFinder applies a two-part strategy:

  • Continuity: The video must contain at least one sequence of four consecutive non-duplicate IDE frames, ensuring the user is actively interacting with the code.
  • Density: At least 50% of the total non-duplicate frames must be identified as IDE frames.
The PSFinder pipeline, illustrating the transition from raw video to frame sampling and final classification.

Experimental Setup

The researchers evaluated PSFinder using a curated dataset of 112 videos, consisting of 80 live-coding screencasts (covering IDEs like IntelliJ IDEA, VS Code, and Eclipse) and 32 non-live-coding videos (vlogs and slide presentations). For training and testing the ViT classifier, a total of 28,135 frames were manually labeled.

Key Results

PSFinder demonstrated exceptional reliability across different IDEs and video lengths. It achieved a Recall of 1.0, meaning it successfully identified every live-coding video in the test set, and a Precision of 0.94, resulting in an overall F1-score of 0.97. As shown in the performance comparison, PSFinder significantly outperforms both random and all-positive baselines.

Performance metrics of PSFinder compared to baseline methods.

Discussion and Future Work

A key insight from the study is that detecting an IDE window alone is insufficient; identifying dynamic changes (typing or scrolling) is the true hallmark of live coding. However, the authors noted a challenge with "picture-in-picture" videos: if a presenter's face moves while the code remains static, the NRMSE may incorrectly flag the frame as non-duplicate.

Future work will focus on scaling the evaluation to larger datasets and incorporating Optical Character Recognition (OCR) to track text-level changes specifically. Ultimately, PSFinder is intended to serve as a front-end for automated documentation tools or as a real-time filter for search engine results.

Summary updated

BibTeX
@inproceedings{yang2022efficient,
  author = {Chengran Yang and Ferdian Thung and David Lo},
  title = {{Efficient Search of Live-Coding Screencasts from Online Videos}},
  booktitle = {SANER},
  year = {2022},
  url = {https://openreview.net/forum?id=NfiqTysv4J},
}
Figure