Abstract:
This work presents VidLang, a new domain-specific language that makes frequent video editing operations more straightforward via an expressive, concise, pipeline-based syntax. Contrary to existing solutions, VidLang introduces a context-sensitive lexer and three-token lookahead parser—implemented in Go—that together ensure unambiguous processing of constructs such as mutable stream references and global pipeline state. Our design involved a thorough analysis of current video processing pipelines, a formal EBNF-based grammar definition, and iterative prototyping with performance monitoring. Experimental results indicate that VidLang scripts reduce commands by over 40% compared to similar FFmpeg pipelines, and up to a 30% reduction in execution time for common editing tasks. Such optimizations stem from VidLang's ability to suppress unnecessary parameter specification and pipeline scheduling optimization. The advances in the language's core are a lightweight set of trimming, merging, filtering, and subtitle insert commands; a simple-to-use syntax with which to hurdle the programming barrier; and an extensible architecture upon which to base future acceleration with GPUs. We conclude that VidLang is an unusually well-balanced mix of simplicity, performance, and extensibility and therefore a precious resource for content creators, researchers, and teachers who need to have efficient, script-based video processing available to them.