jo_mpeg.cxx is a C++ simple, minimalistic, no allocations MPEG writer written as a single header library by Jon Olick, which creates MPEG-1 videos (without audio). It is listed as a C++ only library in stb’s single header library collection. However, only the & reference format is what makes this library C++ only. Replacing those with simple pointers makes this compile with both C and C++. Artsimovich is also a big fan of stb-type of library code, so he converted the library to C.
Run:
$ npm i jo_mpeg.cAnd then include jo_mpeg.h as follows:
// main.c
#include <jo_mpeg.h>
int main() { /* ... */ }Finally, compile while adding the path node_modules/jo_mpeg.c to your compiler's include paths.
$ clang -I./node_modules/jo_mpeg.c main.c # or, use gcc
$ gcc -I./node_modules/jo_mpeg.c main.cYou may also use a simpler approach with the cpoach tool, which automatically adds the necessary include paths of all the installed dependencies for your project.
$ cpoach clang main.c # or, use gcc
$ cpoach gcc main.c