JPEG Multi-Picture Format: remade_ffmpeg_rs matches FFmpeg 9.1 jpeg_mpf
FFmpeg 9.1 added jpeg_mpf on 20 November 2026. remade_ffmpeg_rs merged the same JPEG Multi-Picture Format container the next day, with mux and extract checks against that release.

Did remade_ffmpeg_rs add FFmpeg 9.1 jpeg_mpf support?
Yes. On 21 November 2026 remade_ffmpeg_rs merged pull request 184, which adds JPEG Multi-Picture Format demux and mux as jpeg_mpf. Mux of a primary plus gain map, and each extracted image, matched FFmpeg 9.1 byte for byte on the files in that request. Applying the gain map remains out of scope.
I maintain remade_ffmpeg_rs at Remade with Rust. The catalog is a MATA project, staffed by security and technology engineers in the United States. FFmpeg 9.1, named Gauss, went up on 20 November 2026. In the n9.1 changelog you will find a stronger native AAC encoder, an APV Vulkan encoder, a gainmap filter, and a dedicated muxer and demuxer for JPEG Multi-Picture Format. Pull request 184 landed in our tree the next day, so the rff CLI and the library can read and write that container.
CIPA DC-007 is the standard. Several still JPEGs share one file. Ultra HDR gain-map photographs, .mpo stereo pairs, and in-camera previews all use it. I am writing about that container, and only that container. The rest of the 9.1 changelog is not in this merge.
The 9.1 release, and the one feature this note covers
The 9.1 branch left master on 24 October 2026. The stable tarball is dated 20 November 2026. Release notes from the project are a short pointer at the changelog, not a marketing essay. Two changelog lines add the JPEG Multi-Picture Format muxer and the matching demuxer. A third line adds the gainmap filter, which is a different job: it applies a gain map. Our merge does not.
If you have opened an Ultra HDR still from a phone, you have already held a file of this kind. The primary image is a JPEG. Another JPEG, the gain map, is stored after it, with an index in an APP2 segment of the first image. Stereo .mpo files and some camera previews use the same idea. Gauss is the first stable FFmpeg release that ships a named muxer and demuxer for that layout.
Inside the remade_ffmpeg_rs merge
The merge is dated 21 November 2026 (commit c265523, carrying a3499f1). One commit, 13 files, 2,502 insertions and 40 deletions. The pull request title is the scope: demux and mux, with jpeg_mpf parity against that release. Background on the engine is in the remade_ffmpeg_rs field note. The Cargo pin and source links sit on the repo landing. Why we rebuild the C tool at all is on the pure Rust alternative page.
How demux presents each image
Both the existing jpeg demuxer and the new jpeg_mpf demuxer emit one stream per image, in the order of the MP Index, which is also FFmpeg's stream layout. Each packet is that image's exact bytes. Metadata on the stream includes mpf_type (primary, gain_map, disparity, multi_angle, panorama, large-thumbnail sizes, original, undefined) and the companion keys mpf_type_code, mpf_entry, mpf_flags, and mpf_source. FFmpeg keeps those facts as disposition and a gain-map stream group, not as tags. The first image is the default stream.
When there is no index, but complete JPEGs are packed after the first EOI, the default TrailingPolicy::Split treats each as its own image and marks mpf_source=trailing. A trailer that is not JPEG, including a motion photo's MP4, stays one whole-file image: the previous behaviour, and FFmpeg's. Concatenated JPEGs are a single image in FFmpeg. Callers who want that can set TrailingPolicy::Ignore.
The parser is rff-format-jpeg/src/mpf.rs. It uses core and alloc only, has no I/O, and forbids unsafe code. rusty_jpeg is the codec, and this parser does not take a dependency on it, because MPF is a container problem. rusty_jpeg ships from its own repo on crates.io, and routing the work through that repo would have stalled the merge on a second release. The module is written so it can move later without API churn.
How mux writes the file
Give rff -f jpeg_mpf, or name the output .mpo, and N JPEG streams become one file with the 9.1 muxer's byte layout. The index is big-endian, with the three tags, and is inserted after SOI / APP0 / APP1. A gain map also causes the primary to receive the ISO 21496-1 version segment and the GContainer XMP.
Type assignment is first-match: a stream's mpf_type tag, otherwise stream 0 as primary, otherwise ISO 21496-1 metadata as the gain map, otherwise undefined. Thumbnails, an original-preservation image, and the gain map are dependents of the primary. If the primary already carried a stale MP Index, it is replaced, so remuxing twice does not keep growing the header.
FFmpeg will only mux a primary and a gain map, because it insists on a gain-map stream group. Our muxer accepts any count up to 4,092, the APP2 index cap. Stream metadata is passed through transcode the way FFmpeg's default -map_metadata does, so types survive a remux. rffprobe prints Metadata: in the human view and tags in JSON, via probe_with_metadata.
What the oracle comparison actually showed
Stated as a measurement, not a slogan: our mux of a primary and a gain map is byte-identical to the JPEG Multi-Picture Format output of FFmpeg 9.1. The oracle was BtbN's master build, N-129166-gae9f4540cb. There is no BtbN n9.1 package, but libavformat/jpegmpf{dec,enc}.c is byte-identical between tag n9.1 and that master. That was checked through the GitHub API.
The same identity holds with and without hdrgm XMP, using FFmpeg's -stream_group type=gain_map. Demux was 12 files, 29 streams. Every file had a matching stream count. Every -map 0:N extract was byte-identical to FFmpeg's -c copy extract. The set mixed FFmpeg mux, our two- and three-image mux, independently written camera-style MPOs (both endians, disparity, thumbnail, and original types, per-image MP Attribute IFDs, an index past 4 KiB), our remuxes, and a plain JPEG. Round trip: images 2..N taken from our mux equal the input JPEGs, and remuxing a remux is a no-op.
The local JPEG corpora, 13.7k files, and the cargo registry had no MPF, MPO, or Ultra HDR samples, so the fixtures were generated. exiftool was not on the machine, and no exiftool comparison is claimed. A damage sweep (byte truncation, tables forced to extreme values, wild sizes and offsets) went through real rffprobe and rff -map 0:1 on three files and reported 0 panics and 0 timeouts. A fuzz target mpf was added. CI on the touched crates reported 42 suites and 0 failures.
Using it from rff, including the sharp edges
This merge does not replace the JPEG decoder. Decode speed work already has its own note in rusty_jpeg 0.4.4. If an assistant is the one typing the commands, start with how to drive remade_ffmpeg_rs from an AI coding assistant. Earlier engine repairs are in the AV2 and AVIF debug-fix write-up.
The three commands in the pull request
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
Extract image 2 exactly. Build a container from two stills. Probe, and see one stream per image plus its mpf_type. With no -map and a still-image output, rff keeps a single video stream: the default, which is the primary. FFmpeg makes the same one-stream choice.
Compatibility breaks worth knowing
A same-codec copy, rff -i ultrahdr.jpg out.jpg, now emits only the primary, matching FFmpeg 9.1's -c copy. Before the merge, the whole file (gain map included) was copied. Keep every image with -map 0 -f jpeg_mpf. The jpeg muxer no longer concatenates a second stream; it errors and names -f jpeg_mpf. And unlike FFmpeg, which re-encodes -map 0:1 gain.jpg unless you add -c copy, rff stream-copies when the codec already matches, so the extract stays exact.
On hostile input the policy is to degrade: entries that point past the file or miss an SOI are dropped, an image that overruns the next one is cut, a truncated tail is kept as far as it goes, a useless first-image size is recomputed by scanning to EOI, and a broken index is ignored. The libultrahdr workaround from FFmpeg is present: ISO 21496-1 metadata and exactly two images, with an untyped second image, treats that second image as the gain map.
Work the pull request left for later
Gain-map metadata is not parsed: not the ISO 21496-1 payload, and not the hdrgm XMP fields. The gain map is not applied. The 9.1 changelog lists a gainmap filter for that job, and it is not in this merge. There is no stream-group type in rff yet, so the pairing is not modelled that way. You cannot set mpf_type from the CLI with -metadata:s:N; the value is read and then dropped. Upstreaming the mpf module into rusty_jpeg is also listed as a follow-up.
That is the perimeter. What shipped is the container in a memory-safe Rust engine, with a byte-for-byte mux and extract match on the files in the pull request, one day after FFmpeg 9.1 made the same container a stable feature.
On this site, see the remade_ffmpeg_rs field note, the repo landing, the FFmpeg alternative page, how to drive it from an AI coding assistant, and rusty_jpeg.
FAQ
Quick answers for builders evaluating this technology.
What in the FFmpeg 9.1 changelog covers this still-image container?
FFmpeg 9.1 Gauss was published on 20 November 2026. The n9.1 changelog names a JPEG Multi-Picture Format muxer, a JPEG Multi-Picture Format demuxer, and a gainmap filter.
Which remade_ffmpeg_rs change landed the container?
Pull request 184, merged on 21 November 2026. It adds demux and mux for MPF (CIPA DC-007), the layout behind Ultra HDR gain-map photos, .mpo stereo pairs, and camera previews. Drive mux with -f jpeg_mpf or a .mpo filename.
What evidence does the pull request give against FFmpeg 9.1?
The oracle was a BtbN master build whose jpegmpf encoder and decoder sources match tag n9.1. A primary-plus-gain-map mux was byte-identical to FFmpeg. On 12 files and 29 streams, counts matched and every -map 0:N extract was byte-identical to FFmpeg's -c copy extract. Remuxing a remux was a no-op. A damage sweep reported 0 panics and 0 timeouts.
Do existing rff commands behave differently after the merge?
Yes. A same-codec copy of an Ultra HDR JPEG now emits only the primary image, matching FFmpeg 9.1 with -c copy. Keep every image with -map 0 -f jpeg_mpf. The plain jpeg muxer rejects a second stream and tells you to use -f jpeg_mpf.
Which FFmpeg 9.1 pieces did this merge not take on?
Gain-map metadata (ISO 21496-1 and hdrgm XMP) is not parsed. The gain map is not applied, even though FFmpeg 9.1 ships a gainmap filter. Stream groups, CLI -metadata:s:N for mpf_type, and moving the parser into rusty_jpeg are listed as follow-ups.