# A small FFmpeg for johnmcm.com The engine behind https://johnmcm.com/dav-to-mp4 and https://johnmcm.com/dss-to-mp3: FFmpeg 5.1.6 and LAME 3.100 compiled to WebAssembly with only what those two pages need. It is served from `/vendor/local/ffmpeg@1/` and runs in its own worker, one FFmpeg per conversion. ## Licence FFmpeg is built here without `--enable-gpl` and with no GPL libraries, so it is under the GNU Lesser General Public License 2.1 or later; LAME is LGPL too. See `COPYING.LGPLv2.1` (copied into the build output). The page loads the engine as separate files, which can be rebuilt from this folder and replaced. ## What is in it - Readers: Dahua DAV (`dhav`), raw H.264 and HEVC, MPEG program and transport streams, AVI, MP4/MOV, DSS, WAV, MP3, AAC, G.726. - Decoders: H.264 and HEVC (only so FFmpeg can read a stream's picture size; the pages copy video, never decode it), G.711 A-law and ยต-law, PCM, MS ADPCM, G.722, G.726, G.729, AAC, MP1/MP2/MP3, DSS SP, G.723.1. - Encoders: AAC, MP3 (LAME), 16-bit PCM. - Writers: MP4, MOV, M4A, MP3, WAV. ## Files - `Dockerfile`: the whole build, in Emscripten 6.0.10 (pinned by digest). - `source/`: the two release tarballs built from, checked against their SHA-256 sums. - `src/run.mjs`: one run of ffmpeg with an input and a streaming output. - `src/worker.mjs`: the worker the pages talk to. - `build.ps1`: downloads and checks the tarballs if missing, runs the Docker build and copies the result to `frontend/vendor/local/ffmpeg@1/`.