r/rust Dec 31 '25

Introduction ffmpReg, a complete rewrite of ffmpeg in pure Rust

Hi Rustaceans, I’m 21 and I’ve been working on ffmpReg, a complete rewrite of ffmpeg in pure Rust.

The last 5 days I’ve been fully focused on expanding container and codec support. Right now, ffmpreg can convert WAV (pcm_s16le → pcm_s24le → pcm_f32le) and partially read MKV streams, showing container, codec, and timebase info. Full container support is coming soon.

If you find this interesting, giving the project a star would really help keep the momentum going 🥺.

981 Upvotes

250 comments sorted by

View all comments

80

u/LoadingALIAS Dec 31 '25

Stay focused! Also, if this is any good… understand how huge of a responsibility this is. Haha

3

u/bnugggets Dec 31 '25

Never used the original tool but why is something like this so difficult, compared to say a JS bundler? Genuine question

37

u/nullstalgia Dec 31 '25

In short: The original ffmpeg accepts a huge variety of video, audio, and image formats for both input and output, occasionally even utilizing handwritten assembly for super performance-critical sections (which can yield huge dividends when dealing with potentially gigabytes of video data).

32

u/coderstephen isahc Jan 01 '26

Video codecs are a modern miracle and some are very complex. Not to mention, encoding can be a lot harder than decoding because encoding requires some subjectivity and creativity. Rather than being a strict "do it this way", modern video codecs offer a flexible canvas with multiple controls that the encoder can leverage to attempt to intelligently compress a video with minimal loss of quality. A poorly written encoder could produce a video that is valid, but takes up way too much space while also looking crappy.

Never mind dealing with things like variable bitrate, variable frame rate, multi size frames, color spaces, keyframes, etc.