JPEG Multi-Picture Format: remade_ffmpeg_rs matches FFmpeg 9.1 jpeg_mpf
FFmpeg 9.1 shipped jpeg_mpf on 20 November 2026. The next day remade_ffmpeg_rs merged JPEG Multi-Picture Format demux and mux, checked byte for byte against that release.

Does remade_ffmpeg_rs include FFmpeg 9.1 jpeg_mpf demux and mux?
Yes. Pull request 184 merged on 21 November 2026 adds JPEG Multi-Picture Format demux and mux as jpeg_mpf. On the files in that pull request, a primary-plus-gain-map mux and every extracted image matched FFmpeg 9.1 byte for byte. Applying the gain map is still out of scope.
I work on remade_ffmpeg_rs, the Remade with Rust rebuild of FFmpeg that sits under MATA. FFmpeg 9.1 "Gauss" was released on 20 November 2026. The changelog on the n9.1 tag is a long list: an extensively improved AAC encoder, an APV Vulkan encoder, a gainmap filter, and, the reason I am writing this, a JPEG Multi-Picture Format muxer and demuxer. The next day we merged pull request 184 so that container is available in our engine and in the rff command line.
The standard behind the container is CIPA DC-007. One file holds several JPEGs, which is how Ultra HDR gain-map photos, .mpo stereo pairs, and camera previews are stored. This post is about that container work. It is not a claim that remade_ffmpeg_rs now implements every row of the 9.1 changelog.
What the 9.1 release actually shipped
Gauss is the latest stable release from the 9.1 branch, which was cut from master on 24 October 2026 and published on 20 November 2026. The official release notes are short and point at the changelog. I will not recap every row. The rows that matter here are the JPEG Multi-Picture Format muxer, the matching demuxer, and the gainmap filter.
A household already meets that container without naming it. A phone saves an Ultra HDR photo as one JPEG with a second image tucked after the first. A stereo camera writes an .mpo. A preview thumbnail rides in the same file as the full frame. Until 9.1, stock FFmpeg did not ship a dedicated muxer and demuxer for that layout. The 9.1 changelog is also where the gainmap filter appears. That filter applies a gain map. The work I merged does not.
What pull request 184 adds to the Rust engine
I merged the pull request into remade_ffmpeg_rs on 21 November 2026 (merge commit c265523, from a3499f1). It is one commit across 13 files: 2,502 lines added and 40 removed. The title names the job: demux and mux for this container, with jpeg_mpf parity against that release. The engine those formats sit in is the pure-Rust media pipeline, and the same tree is on the remade_ffmpeg_rs crate page.
Demux and the stream layout
The jpeg demuxer and a new jpeg_mpf demuxer both split the file the way FFmpeg does: one stream per image, in MP Index entry order. Each image is one packet that holds its exact bytes. Stream metadata records mpf_type (primary, gain_map, disparity, multi_angle, panorama, the large-thumbnail sizes, original, or undefined), plus mpf_type_code, mpf_entry, mpf_flags, and mpf_source. FFmpeg does not expose those as tags. It uses disposition and a gain-map stream group. The first image is marked default.
If a file has no index, but whole JPEGs follow the first EOI, the default policy splits them into one image each (mpf_source=trailing). A non-JPEG trailer, such as a motion photo's MP4, stays a single whole-file image, which is the old behaviour and FFmpeg's. FFmpeg itself reads concatenated JPEGs as one image. Library users can ask for that behaviour.
The parser lives in rff-format-jpeg, as core plus alloc only, with no I/O and #![forbid(unsafe_code)]. It is a container concern, not a codec one, so it does not depend on rusty_jpeg. That crate is a separate crates.io release. Putting the parser there would have blocked the pull request on a cross-repo cut. The module is self-contained so it can move later.
Mux, and where it goes further than FFmpeg
Mux is -f jpeg_mpf, or a .mpo filename. N JPEG streams become one file, laid out byte for byte as the 9.1 muxer writes it. The index is big-endian and is spliced after SOI / APP0 / APP1. For a gain map, the primary also gets the ISO 21496-1 version segment and the GContainer XMP.
Each image's MP type is chosen by the first match: an mpf_type stream tag, else stream 0 is the primary, else an image carrying ISO 21496-1 metadata is the gain map, else the type is undefined. Thumbnails, the original-preservation image, and the gain map are recorded as dependents of the primary. A stale MP Index already inside the primary is replaced, so a remux is idempotent.
FFmpeg's muxer only writes a primary plus a gain map, because it requires a gain-map stream group. Ours takes any N up to 4,092, the most one APP2 segment can index. Transcode passes stream metadata through, like FFmpeg's default -map_metadata, so a remux keeps its types. rffprobe now prints that metadata in text and as tags in JSON.
The checks against the 9.1 oracle
The check that matters most is this: the files we write follow the JPEG Multi-Picture Format layout FFmpeg 9.1 writes. The oracle was BtbN's master build (N-129166-gae9f4540cb). BtbN publishes no n9.1 asset, but libavformat/jpegmpf decoder and encoder sources are byte-identical between tag n9.1 and that master. I diffed them through the GitHub API.
Mux of a primary plus a gain map is byte-identical to FFmpeg's (-stream_group type=gain_map), both with and without hdrgm XMP. Demux covered 12 files and 29 streams. Stream counts matched on every file, and every image extracted with -map 0:N was byte-identical to FFmpeg's -c copy extraction. Those files included FFmpeg's mux, our mux (two and three images), camera-style MPOs from an independent Python writer (both endians, several types, an index past 4 KiB), our remuxes, and a plain JPEG. Images 2..N extracted from our mux equal the source JPEGs. Remux of a remux is a byte-identical no-op.
No MPF, MPO, or Ultra HDR samples existed in the local corpora (13.7k JPEGs scanned) or the cargo registry, so every sample was generated. exiftool was not available, so there is no exiftool cross-check. A damage sweep (truncation, corrupted tables, extreme sizes and offsets) ran through the real rffprobe and rff -map 0:1 on three files: 0 panics, 0 timeouts. There is a new cargo fuzz target named mpf. The gates reported 42 test suites and 0 failures.
What changes for rff, and what we did not ship
This is a container landing, not a new JPEG codec. The decode work already in rusty_jpeg 0.4.4 and the earlier AV2 and AVIF decode fixes stay where they are. If you already drive the engine from a script or an assistant, the AI-assisted coding guide is the place to start. The Learn index lists the rest of the house media notes.
Commands that now work
rff -i photo.jpg -map 0:1 gainmap.jpg
rff -i sdr.jpg -i gain.jpg -map 0 -map 1 -f jpeg_mpf hdr.jpg
rffprobe photo.jpg
The first line extracts image 2, byte for byte. The second builds a file from a primary and a gain map. rffprobe prints one stream per image, with mpf_type. A still-image output with no -map keeps a single video stream: the default one, which is the primary. FFmpeg also picks one video stream in that case.
Behaviour that changed
rff -i ultrahdr.jpg out.jpg, when the codec already matches and the job is a stream copy, now writes only the primary image, as FFmpeg 9.1 does with -c copy. It used to copy the whole file, gain map included. To keep every image: -map 0 -f jpeg_mpf. The jpeg muxer refuses more than one stream instead of concatenating them, and the error points at -f jpeg_mpf. One more difference is worth saying out loud: FFmpeg re-encodes -map 0:1 gain.jpg unless you pass -c copy. rff stream-copies when the codec already matches, so the extracted image is exact.
Hostile input is supposed to degrade, not panic: bad index entries are dropped, overlaps are cut, a short first-image size is recomputed, and an unusable index is ignored. FFmpeg's libultrahdr workaround is mirrored: with ISO 21496-1 metadata present and exactly two images, an untyped second image is treated as the gain map.
Follow-ups that are still open
The pull request lists work it did not do. We do not yet parse the gain-map metadata (the ISO 21496-1 payload and the hdrgm XMP fields). We do not apply the gain map. The 9.1 changelog also lists a gainmap filter for that, and we do not. We do not represent the pairing as a stream group, because rff has no model for that yet. CLI -metadata:s:N is not there, so a user cannot set mpf_type by hand today; the spec is parsed and then dropped. The mpf module is not yet upstreamed to rusty_jpeg.
Those limits are honest. The part that shipped is the container: demux, mux, probe, and a byte-for-byte match on the files in the pull request, in a memory-safe Rust engine, the day after FFmpeg 9.1 made the same container a stable feature.
On this site, see the remade_ffmpeg_rs media pipeline, the crate landing, how to run it from an AI coding assistant, rusty_jpeg 0.4.4, and the AV2 and AVIF decode fixes.
FAQ
Short answers already in this article.
When did FFmpeg 9.1 ship, and what did it add for this container?
FFmpeg 9.1 Gauss was released on 20 November 2026, according to the project's download page. Its changelog lists a JPEG Multi-Picture Format muxer, a matching demuxer, and a gainmap filter.
What did remade_ffmpeg_rs pull request 184 land?
Demux and mux for MPF files, the CIPA DC-007 container used by Ultra HDR gain-map photos, .mpo stereo pairs, and camera previews. The jpeg and jpeg_mpf demuxers expose one stream per image. Mux uses -f jpeg_mpf or a .mpo name.
How was jpeg_mpf in remade_ffmpeg_rs checked against FFmpeg 9.1?
The pull request used a BtbN master build as the oracle, after confirming libavformat/jpegmpf decoder and encoder sources are byte-identical between tag n9.1 and that master. Mux of primary plus gain map was byte-identical to FFmpeg. Across 12 files and 29 streams, stream counts matched and every extracted image matched FFmpeg's -c copy extraction. A remux of a remux was a byte-identical no-op. A damage sweep reported 0 panics and 0 timeouts.
What behavior changes for people already running the rff CLI?
When the codec already matches, rff -i ultrahdr.jpg out.jpg now writes only the primary image, as FFmpeg 9.1 does with -c copy. To keep every image, use -map 0 -f jpeg_mpf. The jpeg muxer now refuses more than one stream and points at -f jpeg_mpf, instead of concatenating them.
What did pull request 184 leave out?
It does not parse the ISO 21496-1 gain-map payload or hdrgm XMP fields, does not apply a gain map (FFmpeg 9.1 has a gainmap filter for that), has no stream-group model yet, and does not expose CLI -metadata:s:N for setting mpf_type by hand. The mpf module is also not yet upstreamed to rusty_jpeg.

