Referencia Zigtransmux

transmux/cmaf_muxer.zig

Declaraciones públicas de transmux/cmaf_muxer.zig (transmux).

ImplementadoSin versión del tren todavía· generada desde apps/docs/generated/zig/transmux.json

Página generada desde native/zig/transmux/transmux.zig. No se edita a mano: bun run docs:gen la regenera y bun run docs:check falla si difiere.

fMP4-CMAF fragment muxer of engine = zig (clean-room; dec-0110 §1.1).

Header (ftyp + moov with empty sample tables + mvex/trex) built from the facts of the selected tracks; each fragment is moof (mfhd, one traf per track with samples: tfhd default-base-is-moof, tfdt v1, trun v1 with duration, size, flags and signed composition offset per sample) followed by one mdat holding each track's samples contiguously, in track order.

Timing rules shared with engine = libav (so a fragment of each engine carries the same tfdt/trun, see timebase.outputTimescale):

  • timestamps are rescaled to the output timescale with timebase.rescale (av_rescale_q rounding);
  • a sample lasts until the next sample's DTS; the last one lasts its packet duration (or until end_dts when the container declared none);
  • composition offsets are signed (trun v1) and never shift the timeline: the DTS mapping is the packager's (DtsMap), not the muxer's.

cmaf_muxer.passthrough

const · línea 37

pub const passthrough = [_]facts.Codec{ .h264, .hevc, .av1, .vp9, .aac, .mp3, .opus, .flac, .ac3, .eac3 }

Codecs this muxer writes a sample entry for (the capability engine=zig declares for fMP4-CMAF).

cmaf_muxer.CmafMuxer

type · línea 45

pub const CmafMuxer = struct

Sin ///.

cmaf_muxer.CmafMuxer.open

fn · línea 57

pub fn open(gpa: std.mem.Allocator, specs: []const contract.TrackSpec) EngineError!*CmafMuxer

Sin ///.

cmaf_muxer.CmafMuxer.deinit

fn · línea 89

pub fn deinit(self: *CmafMuxer) void

Sin ///.

cmaf_muxer.CmafMuxer.writeFragment

fn · línea 350

pub fn writeFragment(self: *CmafMuxer, gpa: std.mem.Allocator, sequence: u32, samples: []const contract.TrackSamples, out: *std.ArrayList(u8)) EngineError!void

Sin ///.

cmaf_muxer.CmafMuxer.remuxer

fn · línea 441

pub fn remuxer(self: *CmafMuxer) contract.Remuxer

Sin ///.