Repository navigation
Description
Unit
libobs/media-io/media-remux.c.h, all of it, into rust/obs-media-io. About 315 lines. Unit 7 of #1846. It is the remux job behind Tools > Remux Recordings: it copies every stream of a recording into another container without re-encoding, keeps audio frames sample accurate (#360), and reports progress.
media_remux_job_createmedia_remux_job_processmedia_remux_job_destroy
Phase and position
Phase 5/6 (media-io). The file is its own include in the FFmpeg-backed libobs.media unity group, so it can leave the production build whole by moving to a ported group. No open port touches it.
Dependencies and existing tests
media_remux_job_t is opaque in media-io/media-remux.h, so there is no public struct layout. FFmpeg's struct layouts (AVFormatContext, AVStream, AVCodecParameters, AVPacket) differ between FFmpeg versions, so they stay in C: a private adapter media-io/media-remux-ffmpeg.c.h (hidden obs_media_remux_*, in the libobs.media group) makes one libavformat call or reads/writes one field per function, and the Rust job decides every call in the C's order. No Rust crate links FFmpeg.
test_remux_audio_timestamps covers the audio timestamps against real FFmpeg. Nothing covers refused jobs, progress, or channel layouts, so a characterization test comes first.
Covers the _MSC_VER stat/_stat64 conditional of #870 for this file: the Rust port reads the size with os_get_file_size.
Plan
One PR, as #1846 asks:
- Characterization:
test/cmocka/test_media_remux.c, with WAV inputs written byte by byte (no encoder): refused jobs (no job pointer, missing input, same file, unreadable input, unknown output format, missing output directory), NULL job, every sample kept, 5 channels written as 4.1, 6 as 5.1, progress from 0 to 100, a callback that stops the remux (characterized, not endorsed: still a success), a muxer that rejects the stream. - RED: Tier 1 in the existing obs-media-io test binary against a
todo!()core over a scriptedHost. - GREEN: safe core and
#[no_mangle]shims;media-remux.c.hmoves to a ported group;rust-exports.d/obs-media-io-media_remux.txt. - Tier 3: the original built as
oracle_media_remux_job_*against a recording FFmpeg stand-in in the oracle crate (no FFmpeg on the Rust test runners); the Rust shim runs through the real adapter over the same stand-in; proptest over random scripts comparing results, progress reports and the full log of FFmpeg calls andbloglines; one mutation check. - rust/README.md row and a
port_comparisonbench.
Tier 4 does not apply.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Oct 23, 2026
Claiming: #1927 (unit 7 of #1846). Plan: one PR, the five steps in the issue body (characterization test, RED, GREEN, Tier 3 with an FFmpeg stand-in, README and bench). Draft PR expected within a few hours.
obs-media-io: Port media-io/media-remux.c.h (GREEN)
obs-media-io: Port media-io/media-remux.c.h (obs-rust#1928)
zackees commentedon Oct 23, 2026
Fixed by #1928: media_remux_job_* now come from obs-media-io; FFmpeg struct access stays in the private C adapter media-io/media-remux-ffmpeg.c.h. Intentional differences are listed in the PR and in rust/README.md. Nothing left for this unit.