Skip to content

MPEG-4 Scene Encoding Options

General considerations

MP4Box supports encoding and decoding of of BT, XMT, VRML and (partially) X3D formats int MPEG-4 BIFS, and encoding and decoding of XSR and SVG into MPEG-4 LASeR
Any media track specified through a MuxInfo element will be imported in the resulting MP4 file.
See https://wiki.gpac.io/Howtos/scenecoding/MPEG-4-BIFS-Textual-Format and related pages.

Scene Random Access

MP4Box can encode BIFS or LASeR streams and insert random access points at a given frequency. This is useful when packaging content for broadcast, where users will not turn in the scene at the same time. In MPEG-4 terminology, this is called the scene carousel.## BIFS Chunk Processing
The BIFS chunk encoding mode allows encoding single BIFS access units from an initial context and a set of commands.
The generated AUs are raw BIFS (not SL-packetized), in files called FILE-ESID-AUIDX.bifs, with FILE the basename of the input file.
Commands with a timing of 0 in the input will modify the carousel version only (i.e. output context).
Commands with a timing different from 0 in the input will generate new AUs.

Options:

-mp4: specify input file is for BIFS/LASeR encoding

-def: encode DEF names in BIFS

-sync (int): force BIFS sync sample generation every given time in ms (cannot be used with -shadow or -carousel )

-shadow (int): force BIFS sync shadow sample generation every given time in ms (cannot be used with -sync or -carousel )

-carousel (int): use BIFS carousel (cannot be used with -sync or -shadow )

-sclog: generate scene codec log file if available

-ms (string): import tracks from the given file

-ctx-in (string): specify initial context (MP4/BT/XMT) file for chunk processing. Input file must be a commands-only file

-ctx-out (string): specify storage of updated context (MP4/BT/XMT) file for chunk processing, optional

-resolution (int): resolution factor (-8 to 7, default 0) for LASeR encoding, and all coordinates are multiplied by 2^res before truncation (LASeR encoding)

-coord-bits (int): number of bits used for encoding truncated coordinates (0 to 31, default 12) (LASeR encoding)

-scale-bits (int): extra bits used for encoding truncated scales (0 to 4, default 0) (LASeR encoding)

-auto-quant (int): resolution is given as if using -resolution but coord-bits and scale-bits are inferred (LASeR encoding)

-global-quant (int): resolution is given as if using -resolution but the res is inferred (BIFS encoding)

Live Scene Encoder Options

The options shall be specified as opt_name=opt_val.
Options:

-live: enable live BIFS/LASeR encoder

-dst (string): destination IP

-port (int, default: 7000): destination port

-mtu (int, default: 1450): path MTU for RTP packets

-ifce (string): IP address of the physical interface to use

-ttl (int, default: 1): time to live for multicast packets

-sdp (string, default: session.sdp): output SDP file

-dims: turn on DIMS mode for SVG input

-no-rap: disable RAP sending and carousel generation

-src (string): source of scene updates

-rap (int): duration in ms of base carousel; you can specify the RAP period of a single ESID (not in DIMS) using ESID=X:time

Runtime options:

  • q: quits
  • u: inputs some commands to be sent
  • U: same as u but signals the updates as critical
  • e: inputs some commands to be sent without being aggregated
  • E: same as e but signals the updates as critical
  • f: forces RAP sending
  • F: forces RAP regeneration and sending
  • p: dumps current scene

SWF Importer Options

MP4Box can import simple Macromedia Flash files (".SWF")
You can specify a SWF input file with '-bt', '-xmt' and '-mp4' options

Options:

-global: all SWF defines are placed in first scene replace rather than when needed

-no-ctrl: use a single stream for movie control and dictionary (this will disable ActionScript)

-no-text: remove all SWF text

-no-font: remove all embedded SWF Fonts (local playback host fonts used)

-no-line: remove all lines from SWF shapes

-no-grad: remove all gradients from swf shapes

-quad: use quadratic bezier curves instead of cubic ones

-xlp: support for lines transparency and scalability

-ic2d: use indexed curve 2D hardcoded proto

-same-app: appearance nodes are reused

-flatten (number): complementary angle below which 2 lines are merged, value 0 means no flattening

Was this page helpful?