$ show transitive-bullshit/ffmpeg-concat
ffmpeg-concat is a Node.js CLI tool and library for concatenating video files with OpenGL-based transitions. It extracts frames from input videos using ffmpeg, applies GLSL transitions between consecutive frames using headless-gl, and transcodes the result to MP4. The architecture is modular with separate modules for frame extraction, transition rendering, audio handling, and final encoding. Key entry points are lib/index.js (library API) and lib/cli.js (command-line interface). The system relies on ffmpeg as a system dependency and wraps it with fluent-ffmpeg for Node.js integration. The code demonstrates solid engineering practices with clear separation of concerns, proper error handling, and test coverage. However, the dependency ecosystem shows signs of age - many packages date to 2018-2019, and the Travis CI configuration uses outdated Node.js versions. The OpenGL-based transition system is the core innovation, allowing complex visual transitions that would be difficult to implement with ffmpeg filter graphs alone. This is a practical tool for video editors and developers needing programmatic video concatenation with visual effects. It's not a research project or data pipeline - it's a production-ready library with CLI support.
The LLM identified 4 files worth highlighting for reuse:
Wraps the gl-transition library with a clean interface for applying GLSL transitions between video frames. Demonstrates non-obvious skill in OpenGL texture management, buffer creation, and GLSL shader integration. The draw() method handles loading source/target frames, creating textures, and invoking the transition shader. Could be extracted as a standalone GLSL transition renderer for other video processing projects.
Handles writing rendered frames to disk in multiple formats (raw, png, jpg). Uses sharp for efficient image encoding with configurable compression. The write() method reads pixels from OpenGL buffer and encodes to the specified format. Isolated pattern that could be reused in other video processing pipelines where frame output is needed.
Implements audio concatenation using ffmpeg's concat demuxer. Creates a properly formatted input list file and uses ffmpeg's -f concat option to merge audio segments. Solves a common data engineering problem (audio merging) with a clean, parameterized approach. Could be extracted for any project needing audio track concatenation.
Orchestrates video scene initialization, frame counting, and transition mapping. Uses ffmpeg-probe to extract video metadata (fps, dimensions, duration) and calculates frame indices for transition rendering. The initScene() function is particularly well-structured, handling video probing, frame pattern generation, and audio extraction. Demonstrates good data engineering practices for video processing pipelines.