It&#x27;s not a great situation yeah - I&#x27;d heard there was some effort on Ocaml multimedia libraries but I don&#x27;t know what&#x27;s happened to that. Mozilla appear to have got some of their video stack implemented in rust but nowhere near the range of what ffmpeg supports. Hopefully in a few years we&#x27;ll get there, but in the meantime there&#x27;s no way around running <i>some</i> C code.<p>Even so, I would (and have) still use an FFI and put as much as possible in a safer language. You will get segfaults and memory leaks because you&#x27;re still calling C code, but you won&#x27;t be adding more, and IME that&#x27;s well worth the overhead of an FFI. (Also ffmpeg has had quite a bit of attention from people using valgrind, afl-fuzz etc, so its defect rate is lower than your C code would likely have, unless you&#x27;re also using those tools). Alternatively, depending on your use case you might be able to separate the decoding&#x2F;encoding stages from the processing, in which case you can write the code without needing much in the way of libraries, and pipe to&#x2F;from ffmpeg.<p>Write a quick prototype and see if you can get the performance you need within GC or a small amount of -XXasdf (you might be surprised, particularly with the state of Haskell and OCaml today. I&#x27;ve done literally this from Java, JNI-ing the ffmpeg libraries to do realtime streaming, and had it work fine, and that was five years ago). In the rare case something like that doesn&#x27;t cut it Rust is what I&#x27;d use (there are other options but I know less about them).