cs.iso14496


Namecs.iso14496 JSON
Version 20240422 PyPI version JSON
download
home_pageNone
SummaryFacilities for ISO14496 files - the ISO Base Media File Format, the basis for several things including MP4 and MOV.
upload_time2024-04-22 06:42:36
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseGNU General Public License v3 or later (GPLv3+)
keywords python3
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Facilities for ISO14496 files - the ISO Base Media File Format,
the basis for several things including MP4 and MOV.

*Latest release 20240422*:
* Replace dropped UTF16NULField with BinaryUTF16NUL.
* Comment out unused CO64BoxBody.chunk_offsets, uses dropped (and not replaced) deferred_field.
* Drop FallbackBoxBody, we'll just use BoxBody when there's no box specific subclass.
* Replace pick_boxbody_class with BoxBody.for_box_type.
* Rename boxbody_type_from_klass to boxbody_type_from_class.
* Drop obsolete KNOWN_BOXBODY_CLASSES.
* MP4Command.cmd_info: print moov.udta.meta.ilst.cover in SIXEL format on a terminal.
* Rename parse_deref_path to get_deref_path like other lexical functions.
* ILSTBoxBody.__getattr__: fix lookup of long names.

ISO make the standard available here:
* [available standards main page](http://standards.iso.org/ittf/PubliclyAvailableStandards/index.html)
* [zip file download](http://standards.iso.org/ittf/PubliclyAvailableStandards/c068960_ISO_IEC_14496-12_2015.zip)

## Function `add_body_subclass(superclass, box_type, section, desc)`

Create and register a new `BoxBody` class that is simply a subclass of
another.
Return the new class.

## Function `add_generic_sample_boxbody(box_type, section, desc, struct_format_v0, sample_fields, struct_format_v1=None, has_inferred_entry_count=False)`

Create and add a specific Time to Sample box - section 8.6.1.

## Function `add_time_to_sample_boxbody(box_type, section, desc)`

Add a Time to Sample box - section 8.6.1.

## Class `Box(cs.binary.SimpleBinary)`

Base class for all boxes - ISO14496 section 4.2.

This has the following fields:
* `header`: a `BoxHeader`
* `body`: a `BoxBody` instance, usually a specific subclass
* `unparsed`: any unconsumed bytes from the `Box` are stored as here

*Property `Box.BOX_TYPE`*:
The default .BOX_TYPE is inferred from the class name.

*Method `Box.__getattr__(self, attr)`*:
If there is no direct attribute from `SimpleBinary.__getattr__`,
have a look in the `.header` and `.body`.

*Method `Box.__iter__(self)`*:
Iterating over a `Box` iterates over its body.
Typically that would be the `.body.boxes`
but might be the samples if the body is a sample box,
etc.

*Method `Box.ancestor(self, box_type)`*:
Return the closest ancestor box of type `box_type`.

*Property `Box.box_type`*:
The `Box` header type.

*Property `Box.box_type_path`*:
The type path to this Box.

*Property `Box.box_type_s`*:
The `Box` header type as a string.

If the header type bytes decode as ASCII, return that,
otherwise the header bytes' repr().

*Method `Box.dump(self, **kw)`*:
Dump this Box.

*Method `Box.gather_metadata(self)`*:
Walk the `Box` hierarchy looking for metadata.
Yield `(Box,TagSet)` for each `b'moov'` or `b'trak'` `Box`.

*Method `Box.metatags(self)`*:
Return a `TagSet` containing metadata for this box.

*Method `Box.parse(bfr: cs.buffer.CornuCopyBuffer)`*:
Decode a `Box` from `bfr` and return it.

*Method `Box.parse_field(self, field_name, bfr: cs.buffer.CornuCopyBuffer, binary_cls)`*:
`parse_field` delegates to the `Box` body `parse_field`.

*Property `Box.parse_length`*:
The length of the box as consumed from the buffer,
computed as `self.end_offset-self.offset`.

*Method `Box.reparse_buffer(self)`*:
Context manager for continuing a parse from the `unparsed` field.

Pops the final `unparsed` field from the `Box`,
yields a `CornuCopyBuffer` make from it,
then pushes the `unparsed` field again
with the remaining contents of the buffer.

*Method `Box.self_check(self)`*:
Sanity check this Box.

*Method `Box.transcribe(self)`*:
Transcribe the `Box`.

Before transcribing the data, we compute the total box_size
from the lengths of the current header, body and unparsed
components, then set the header length if that has changed.
Since setting the header length can change its representation
we compute the length again and abort if it isn't stable.
Otherwise we proceeed with a regular transcription.

*Property `Box.unparsed_bs`*:
The unparsed data as a single `bytes` instance.

*Property `Box.user_type`*:
The header user_type.

*Method `Box.walk(self) -> Iterable[Tuple[ForwardRef('Box'), List[ForwardRef('Box')]]]`*:
Walk this `Box` hierarchy.

Yields the starting box and its children as `(self,subboxes)`
and then yields `(subbox,subsubboxes)` for each child in turn.

As with `os.walk`, the returned `subboxes` list
may be modified in place to prune or reorder the subsequent walk.

## Class `BoxBody(cs.binary.SimpleBinary)`

Abstract basis for all `Box` bodies.

*Method `BoxBody.__getattr__(self, attr)`*:
The following virtual attributes are defined:
* *TYPE*`s`:
  "boxes of type *TYPE*",
  an uppercased box type name with a training `s`;
  a list of all elements whose `.box_type`
  equals *TYPE*`.lower().encode('ascii')`.
  The elements are obtained by iterating over `self`
  which normally means iterating over the `.boxes` attribute.
* *TYPE*:
  "the box of type *TYPE*",
  an uppercased box type name;
  the sole element whose box type matches the type,
  obtained from `.`*TYPE*`s[0]`
  with a requirement that there is exactly one match.
* *TYPE*`0`:
  "the optional box of type *TYPE*",
  an uppercased box type name with a trailing `0`;
  the sole element whose box type matches the type,
  obtained from `.`*TYPE*`s[0]`
  with a requirement that there is exactly zero or one match.
  If there are zero matches, return `None`.
  Otherwise return the matching box.

*Method `BoxBody.add_field(self, field_name, value)`*:
Add a field named `field_name` with the specified `value`
to the box fields.

*Method `BoxBody.boxbody_type_from_class()`*:
Compute the Box's 4 byte type field from the class name.

*Method `BoxBody.for_box_type(box_type: bytes)`*:
Return the `BoxBody` subclass suitable for the `box_type`.

*Method `BoxBody.parse(bfr: cs.buffer.CornuCopyBuffer)`*:
Create a new instance and gather the `Box` body fields from `bfr`.

Subclasses implement a `parse_fields` method to parse additional fields.

*Method `BoxBody.parse_boxes(self, bfr: cs.buffer.CornuCopyBuffer, **kw)`*:
Utility method to parse the remainder of the buffer as a
sequence of `Box`es.

*Method `BoxBody.parse_field(self, field_name, bfr: cs.buffer.CornuCopyBuffer, binary_cls)`*:
Parse an instance of `binary_cls` from `bfr`
and store it as the attribute named `field_name`.

`binary_cls` may also be an `int`, in which case that many
bytes are read from `bfr`.

*Method `BoxBody.parse_field_value(self, field_name, bfr: cs.buffer.CornuCopyBuffer, binary_cls)`*:
Parse a single value binary, store the value as `field_name`,
store the instance as the field `field_name+'__Binary'`
for transcription.

Note that this disassociaes the plain value attribute
from what gets transcribed.

*Method `BoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Parse additional fields.
This base class implementation consumes nothing.

*Method `BoxBody.transcribe(self)`*:
Transcribe the binary structure.

This default implementation transcribes the fields parsed with the
`parse_field` method in the order parsed.

*Method `BoxBody.transcribe_fields(self)`*:
Transcribe the fields parsed with the `parse_field` method in the
order parsed.

## Class `BoxHeader(cs.binary.BoxHeader)`

An ISO14496 `Box` header packet.

*Method `BoxHeader.parse(bfr: cs.buffer.CornuCopyBuffer)`*:
Decode a box header from `bfr`.

## Class `BTRTBoxBody(BoxBody)`

BitRateBoxBody - section 8.5.2.2.

*Method `BTRTBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Gather the `bufferSizeDB`, `maxBitrate` and `avgBitrate` fields.

## Class `CO64BoxBody(FullBoxBody)`

A 'c064' Chunk Offset box - section 8.7.5.

*Method `CO64BoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Gather the `entry_count` and `chunk_offsets` fields.

*Method `CO64BoxBody.transcribe(self)`*:
Transcribe a `CO64BoxBody`.

## Class `ContainerBoxBody(BoxBody)`

Common subclass of several things with `.boxes`.

## Class `CPRTBoxBody(FullBoxBody)`

A 'cprt' Copyright box - section 8.10.2.

*Property `CPRTBoxBody.language`*:
The `language_field` as the 3 character ISO 639-2/T language code.

*Method `CPRTBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Gather the `language` and `notice` fields.

## Class `CSLGBoxBody(FullBoxBody)`

A 'cslg' Composition to Decode box - section 8.6.1.4.

*`CSLGBoxBody.CSLGParamsLong`*

*`CSLGBoxBody.CSLGParamsQuad`*

*Method `CSLGBoxBody.__getattr__(self, attr)`*:
Present the `params` attributes at the top level.

*Method `CSLGBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Gather the compositionToDTSShift`, `leastDecodeToDisplayDelta`,
`greatestDecodeToDisplayDelta`, `compositionStartTime` and
`compositionEndTime` fields.

## Function `decode_itunes_date_field(data) -> datetime.datetime`

The iTunes 'Date' meta field: a year or an ISO timestamp.

## Function `deref_box(B, path)`

Dereference a path with respect to this Box.

## Class `DREFBoxBody(FullBoxBody)`

A 'dref' Data Reference box containing Data Entry boxes - section 8.7.2.1.

*Method `DREFBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Gather the `entry_count` and `boxes` fields.

## Function `dump_box(B, indent='', fp=None, crop_length=170, indent_incr=None)`

Recursively dump a Box.

## Class `ELNGBoxBody(FullBoxBody)`

A ELNGBoxBody is a Extended Language Tag box - ISO14496 section 8.4.6.

*Method `ELNGBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Gather the `extended_language` field.

## Class `ELSTBoxBody(FullBoxBody)`

An 'elst' Edit List FullBoxBody - section 8.6.6.

*`ELSTBoxBody.V0EditEntry`*

*`ELSTBoxBody.V1EditEntry`*

*Property `ELSTBoxBody.entry_class`*:
The class representing each entry.

*Property `ELSTBoxBody.entry_count`*:
The number of entries.

*Method `ELSTBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Parse the fields of an `ELSTBoxBody`.

*Method `ELSTBoxBody.transcribe(self)`*:
Transcribe an `ELSTBoxBody`.

## Class `FREEBoxBody(BoxBody)`

A 'free' or 'skip' box - ISO14496 section 8.1.2.
Note the length and discard the data portion.

*Method `FREEBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer, end_offset=Ellipsis, **kw)`*:
Gather the `padding` field.

## Class `FTYPBoxBody(BoxBody)`

An 'ftyp' File Type box - ISO14496 section 4.3.
Decode the major_brand, minor_version and compatible_brands.

*Property `FTYPBoxBody.compatible_brands`*:
The compatible brands as a list of 4 byte bytes instances.

*Method `FTYPBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer, **kw)`*:
Gather the `major_brand`, `minor_version` and `brand_bs` fields.

## Class `FullBoxBody(BoxBody)`

A common extension of a basic BoxBody, with a version and flags field.
ISO14496 section 4.2.

*Property `FullBoxBody.flags`*:
The flags value, computed from the 3 flag bytes.

## Function `get_deref_path(path, offset=0)`

Parse a `path` string from `offset`.
Return the path components and the offset where the parse stopped.

Path components:
* _identifier_: an identifier represents a `Box` field or if such a
  field is not present, a the first subbox of this type
* `[`_index_`]`: the subbox with index _index_

Examples:

    >>> get_deref_path('.abcd[5]')
    (['abcd', 5], 8)

## Class `HDLRBoxBody(FullBoxBody)`

A HDLRBoxBody is a Handler Reference box - ISO14496 section 8.4.3.

*Property `HDLRBoxBody.handler_type`*:
The handler_type as an ASCII string, its usual form.

*Method `HDLRBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Gather the `handler_type_long` and `name` fields.

## Function `ILSTAofBSchema(attribute_name)`

Attribute name and type for ILST "A of B" schema.

## Class `ILSTBoxBody(ContainerBoxBody)`

Apple iTunes Information List, container for iTunes metadata fields.

The basis of the format knowledge here comes from AtomicParsley's
documentation here:

    http://atomicparsley.sourceforge.net/mpeg-4files.html

and additional information from:

    https://github.com/sergiomb2/libmp4v2/wiki/iTunesMetadata

*Method `ILSTBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
pylint: disable=attribute-defined-outside-init,too-many-locals
pylint: disable=too-many-statements,too-many-branches

## Function `ILSTISOFormatSchema(attribute_name)`

Attribute name and type for ILST ISO format schema.

## Function `ILSTRawSchema(attribute_name)`

Attribute name and type for ILST raw schema.

## Function `ILSTTextSchema(attribute_name)`

Attribute name and type for ILST text schema.

## Function `ILSTUInt32BESchema(attribute_name)`

Attribute name and type for ILST `UInt32BE` schema.

## Function `ILSTUInt8Schema(attribute_name)`

Attribute name and type for ILST `UInt8BE` schema.

## Class `itunes_media_type(builtins.tuple)`

itunes_media_type(type, stik)

*Property `itunes_media_type.stik`*:
Alias for field number 1

*Property `itunes_media_type.type`*:
Alias for field number 0

## Class `itunes_store_country_code(builtins.tuple)`

itunes_store_country_code(country_name, iso_3166_1_code, itunes_store_code)

*Property `itunes_store_country_code.country_name`*:
Alias for field number 0

*Property `itunes_store_country_code.iso_3166_1_code`*:
Alias for field number 1

*Property `itunes_store_country_code.itunes_store_code`*:
Alias for field number 2

## Function `main(argv=None)`

Command line mode.

## Class `MDATBoxBody(BoxBody)`

A Media Data Box - ISO14496 section 8.1.1.

*Method `MDATBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Gather all data to the end of the field.

*Method `MDATBoxBody.transcribe(self)`*:
Transcribe the data.
Raise an `AssertionError` if we skipped the data during the parse.

*Method `MDATBoxBody.transcribed_length(self)`*:
Return the transcription length even if we didn't keep the data.

## Class `MDHDBoxBody(FullBoxBody)`

A MDHDBoxBody is a Media Header box - ISO14496 section 8.4.2.

*Method `MDHDBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Gather the `creation_time`, `modification_time`, `timescale`,
`duration` and `language_short` fields.

## Class `METABoxBody(FullBoxBody)`

A 'meta' Meta BoxBody - section 8.11.1.

*Method `METABoxBody.__getattr__(self, attr)`*:
Present the `ilst` attributes if present.

*Method `METABoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Gather the `theHandler` `Box` and gather the following Boxes as `boxes`.

## Class `MOOVBoxBody(ContainerBoxBody)`

An 'moov' Movie box - ISO14496 section 8.2.1.
Decode the contained boxes.

## Class `MP4Command(cs.cmdutils.BaseCommand)`

Command line implementation.

Usage summary:

    Usage: mp4 subcommand [...]
      Subcommands:
        autotag [-n] [-p prefix] [--prefix=prefix] paths...
          Tag paths based on embedded MP4 metadata.
          -n  No action.
          -p prefix, --prefix=prefix
              Set the prefix of added tags, default: 'mp4'
        deref boxspec paths...
          Dereference a Box specification against ISO14496 files.
        extract [-H] filename boxref output
          Extract the referenced Box from the specified filename into output.
          -H  Skip the Box header.
        help [-l] [subcommand-names...]
          Print help for subcommands.
          This outputs the full help for the named subcommands,
          or the short help for all subcommands if no names are specified.
          -l  Long help even if no subcommand-names provided.
        info [{-|filename}]...]
          Print informative report about each source.
        parse [{-|filename}...]
          Parse the named files (or stdin for "-").
        shell
          Run a command prompt via cmd.Cmd using this command's subcommands.
        tags [{-p,--prefix} prefix] path
          Report the tags of `path` based on embedded MP4 metadata.
        test [testnames...]
          Run self tests.

*Method `MP4Command.cmd_autotag(self, argv, fstags: Optional[cs.fstags.FSTags] = <function <lambda> at 0x108080040>)`*:
Usage: {cmd} [-n] [-p prefix] [--prefix=prefix] paths...
Tag paths based on embedded MP4 metadata.
-n  No action.
-p prefix, --prefix=prefix
    Set the prefix of added tags, default: 'mp4'

*Method `MP4Command.cmd_deref(self, argv)`*:
Usage: {cmd} boxspec paths...
Dereference a Box specification against ISO14496 files.

*Method `MP4Command.cmd_extract(self, argv)`*:
Usage: {cmd} [-H] filename boxref output
Extract the referenced Box from the specified filename into output.
-H  Skip the Box header.

*Method `MP4Command.cmd_info(self, argv)`*:
Usage: {cmd} [{{-|filename}}]...]
Print informative report about each source.

*Method `MP4Command.cmd_parse(self, argv)`*:
Usage: {cmd} [{{-|filename}}...]
Parse the named files (or stdin for "-").

*Method `MP4Command.cmd_tags(self, argv)`*:
Usage: {cmd} [{{-p,--prefix}} prefix] path
Report the tags of `path` based on embedded MP4 metadata.

*Method `MP4Command.cmd_test(self, argv)`*:
Usage: {cmd} [testnames...]
Run self tests.

## Class `MVHDBoxBody(FullBoxBody)`

An 'mvhd' Movie Header box - ISO14496 section 8.2.2.

## Class `OverBox(cs.binary.BinaryListValues, HasBoxesMixin)`

A fictitious `Box` encompassing all the Boxes in an input buffer.

*Property `OverBox.boxes`*:
Alias `.value` as `.boxes`: the `Box`es encompassed by this `OverBox`.

*Method `OverBox.dump(self, **kw)`*:
Dump this OverBox.

*Property `OverBox.length`*:
The `OverBox` is as long as the subsidary Boxes.

*Method `OverBox.parse(bfr: cs.buffer.CornuCopyBuffer)`*:
Parse the `OverBox`.

*Method `OverBox.walk(self)`*:
Walk the `Box`es in the `OverBox`.

This does not yield the `OverBox` itself, it isn't really a `Box`.

## Function `parse(o)`

Return the `OverBox` from a source (str, int, bytes, file).

The leading `o` parameter may be one of:
* `str`: a filesystem file pathname
* `int`: a OS file descriptor
* `bytes`: a `bytes` object
* `file`: if not `int` or `str` the presumption
  is that this is a file-like object

Keyword arguments are as for `OverBox.from_buffer`.

## Function `parse_fields(bfr, copy_offsets=None, **kw)`

Parse an ISO14496 stream from the CornuCopyBuffer `bfr`,
yield top level OverBoxes.

Parameters:
* `bfr`: a `CornuCopyBuffer` provided the stream data,
  preferably seekable
* `discard_data`: whether to discard unparsed data, default `False`
* `copy_offsets`: callable to receive `Box` offsets

## Function `parse_tags(path, tag_prefix=None)`

Parse the tags from `path`.
Yield `(box,tags)` for each subbox with tags.

The optional `tag_prefix` parameter
may be specified to prefix each tag name with a prefix.
Other keyword arguments are passed to `parse()`
(typical example: `discard_data=True`).

## Class `PDINBoxBody(FullBoxBody)`

A 'pdin' Progressive Download Information box - ISO14496 section 8.1.3.

*`PDINBoxBody.PDInfo`*

*Method `PDINBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer, **kw)`*:
Gather the normal version information
and then the `(rate,initial_delay)` pairs of the data section
as the `pdinfo` field.

## Function `report(box, indent='', fp=None, indent_incr=None)`

Report some human friendly information about a box.

## Class `SMHDBoxBody(FullBoxBody)`

A 'smhd' Sound Media Headerbox - section 12.2.2.

*Method `SMHDBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Gather the `balance` field.

## Class `STCOBoxBody(FullBoxBody)`

A 'stco' Chunk Offset box - section 8.7.5.

*Property `STCOBoxBody.chunk_offsets`*:
Parse the `UInt32BE` chunk offsets from stashed buffer.

*Method `STCOBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Gather the `entry_count` and `chunk_offsets` fields.

## Class `STSCBoxBody(FullBoxBody)`

'stsc' (Sample Table box - section 8.7.4.1.

*`STSCBoxBody.STSCEntry`*

*Property `STSCBoxBody.entries`*:
A list of `int`s parsed from the `STSCEntry` list.

*Method `STSCBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Gather the `entry_count` and `entries` fields.

## Class `STSZBoxBody(FullBoxBody)`

A 'stsz' Sample Size box - section 8.7.3.2.

*Property `STSZBoxBody.entry_sizes`*:
Parse the `UInt32BE` entry sizes from stashed buffer
into a list of `int`s.

*Method `STSZBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Gather the `sample_size`, `sample_count`, and `entry_sizes` fields.

*Method `STSZBoxBody.transcribe(self)`*:
Transcribe the `STSZBoxBody`.

## Class `STZ2BoxBody(FullBoxBody)`

A 'stz2' Compact Sample Size box - section 8.7.3.3.

*Method `STZ2BoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Gather the `field_size`, `sample_count` and `entry_sizes` fields.

*Method `STZ2BoxBody.transcribe(self)`*:
transcribe the STZ2BoxBody.

## Class `TimeStamp32(cs.binary.UInt32BE, TimeStampMixin)`

The 32 bit form of an ISO14496 timestamp.

## Class `TimeStamp64(cs.binary.UInt64BE, TimeStampMixin)`

The 64 bit form of an ISO14496 timestamp.

## Class `TimeStampMixin`

Methods to assist with ISO14496 timestamps.

*Property `TimeStampMixin.datetime`*:
This timestamp as an UTC datetime.

*Property `TimeStampMixin.unixtime`*:
This timestamp as a UNIX time (seconds since 1 January 1970).

## Class `TKHDBoxBody(FullBoxBody)`

A 'tkhd' Track Header box - ISO14496 section 8.2.2.

*`TKHDBoxBody.TKHDMatrix`*

## Class `TrackGroupTypeBoxBody(FullBoxBody)`

A TrackGroupTypeBoxBody contains a track group id - ISO14496 section 8.3.3.2.

*Method `TrackGroupTypeBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Gather the `track_group_id` field.

## Class `TrackReferenceTypeBoxBody(BoxBody)`

A TrackReferenceTypeBoxBody contains references to other tracks - ISO14496 section 8.3.3.2.

*Method `TrackReferenceTypeBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Gather the `track_ids` field.

## Class `TREFBoxBody(ContainerBoxBody)`

Track Reference BoxBody, container for trackReferenceTypeBoxes - ISO14496 section 8.3.3.

## Class `TTSB_Sample(builtins.tuple)`

TTSB_Sample(count, delta)

*Property `TTSB_Sample.count`*:
Alias for field number 0

*Property `TTSB_Sample.delta`*:
Alias for field number 1

## Class `URL_BoxBody(FullBoxBody)`

An 'url ' Data Entry URL BoxBody - section 8.7.2.1.

*Method `URL_BoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Gather the `location` field.

## Class `URN_BoxBody(FullBoxBody)`

An 'urn ' Data Entry URL BoxBody - section 8.7.2.1.

*Method `URN_BoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Gather the `name` and `location` fields.

## Class `UTF8or16Field(cs.binary.SimpleBinary)`

An ISO14496 UTF8 or UTF16 encoded string.

*Method `UTF8or16Field.parse(bfr: cs.buffer.CornuCopyBuffer)`*:
Gather optional BOM and then UTF8 or UTF16 string.

*Method `UTF8or16Field.transcribe(self)`*:
Transcribe the field suitably encoded.

## Class `VMHDBoxBody(FullBoxBody)`

A 'vmhd' Video Media Headerbox - section 12.1.2.

*`VMHDBoxBody.OpColor`*

*Method `VMHDBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:
Gather the `graphicsmode` and `opcolor` fields.

# Release Log



*Release 20240422*:
* Replace dropped UTF16NULField with BinaryUTF16NUL.
* Comment out unused CO64BoxBody.chunk_offsets, uses dropped (and not replaced) deferred_field.
* Drop FallbackBoxBody, we'll just use BoxBody when there's no box specific subclass.
* Replace pick_boxbody_class with BoxBody.for_box_type.
* Rename boxbody_type_from_klass to boxbody_type_from_class.
* Drop obsolete KNOWN_BOXBODY_CLASSES.
* MP4Command.cmd_info: print moov.udta.meta.ilst.cover in SIXEL format on a terminal.
* Rename parse_deref_path to get_deref_path like other lexical functions.
* ILSTBoxBody.__getattr__: fix lookup of long names.

*Release 20231129*:
Small updates and fixes.

*Release 20230212*:
* Drop cs.context.StackableState in favour of cs.threads.State.
* MP4Command.cmd_autotag: use @uses_fstags for the fstags parameter.

*Release 20220606*:
Update obsolete use of Tag.with_prefix.

*Release 20210306*:
* Huge refactor of the Box classes to the new Binary* classes from cs.binary.
* mp4: new "tags" subcommand to print the tags parsed from a file.
* BoxHeader: fix the definition of MAX_BOX_SIZE_32.
* BoxBody: new parse_boxes utility method to part the remainder of a Box as subBoxes.
* MP4.cmd_parse: run the main parse in discard_data=True mode.
* METABoxBody.__getattr__: fix ILST typo.
* MP4Command: update for new cs.cmdutils.BaseCommand API.
* Many small fixes and tweaks.

*Release 20200229*:
* ILST: recognise @cpy as copyright, sfID as itunes_store_country_code.
* ILST: new SFID_ISO_3166_1_ALPHA_3_CODE and STIK_MEDIA_TYPES providing context data for various field values, as yet unused.
* Make various list fields of some boxes deferred because they are expensive to parse (uses new cs.binary deferred_field).
* add_generic_sample_boxbody: drop __iter__, causes dumb iterators to parse the samples.
* ILST: iTunes "Date" metadata seem to contain plain years or ISO8601 datestamps.
* mp4 autotag: add -n (no action) and -p,--prefix (set tag prefix, default 'mp4') options.
* mp4 autotag: use "mp4." as the tag prefix.

*Release 20200130*:
* Parsing of ILST boxes (iTunes metadata).
* Command line: new "info" subcommand reporting metadata, "autotag" applying metadata to fstags.
* Box tree walk, ancestor, iteration.
* Assorted cleanups and internal changes.

*Release 20190220*:
parse_buffer yields instead of returns; some small bugfixes.

*Release 20180810*:
* parse_fd(): use a mmap to access the descriptor if a regular file and not discard_data;
* this lets us use the mmapped file as backing store for the data, a big win for the media sections.

*Release 20180805*:
Initial PyPI release.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cs.iso14496",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "python3",
    "author": null,
    "author_email": "Cameron Simpson <cs@cskk.id.au>",
    "download_url": "https://files.pythonhosted.org/packages/e8/30/99f666fdb38d557306b8864445527cdcb667e83f933f8b53c449a2853590/cs.iso14496-20240422.tar.gz",
    "platform": null,
    "description": "Facilities for ISO14496 files - the ISO Base Media File Format,\nthe basis for several things including MP4 and MOV.\n\n*Latest release 20240422*:\n* Replace dropped UTF16NULField with BinaryUTF16NUL.\n* Comment out unused CO64BoxBody.chunk_offsets, uses dropped (and not replaced) deferred_field.\n* Drop FallbackBoxBody, we'll just use BoxBody when there's no box specific subclass.\n* Replace pick_boxbody_class with BoxBody.for_box_type.\n* Rename boxbody_type_from_klass to boxbody_type_from_class.\n* Drop obsolete KNOWN_BOXBODY_CLASSES.\n* MP4Command.cmd_info: print moov.udta.meta.ilst.cover in SIXEL format on a terminal.\n* Rename parse_deref_path to get_deref_path like other lexical functions.\n* ILSTBoxBody.__getattr__: fix lookup of long names.\n\nISO make the standard available here:\n* [available standards main page](http://standards.iso.org/ittf/PubliclyAvailableStandards/index.html)\n* [zip file download](http://standards.iso.org/ittf/PubliclyAvailableStandards/c068960_ISO_IEC_14496-12_2015.zip)\n\n## Function `add_body_subclass(superclass, box_type, section, desc)`\n\nCreate and register a new `BoxBody` class that is simply a subclass of\nanother.\nReturn the new class.\n\n## Function `add_generic_sample_boxbody(box_type, section, desc, struct_format_v0, sample_fields, struct_format_v1=None, has_inferred_entry_count=False)`\n\nCreate and add a specific Time to Sample box - section 8.6.1.\n\n## Function `add_time_to_sample_boxbody(box_type, section, desc)`\n\nAdd a Time to Sample box - section 8.6.1.\n\n## Class `Box(cs.binary.SimpleBinary)`\n\nBase class for all boxes - ISO14496 section 4.2.\n\nThis has the following fields:\n* `header`: a `BoxHeader`\n* `body`: a `BoxBody` instance, usually a specific subclass\n* `unparsed`: any unconsumed bytes from the `Box` are stored as here\n\n*Property `Box.BOX_TYPE`*:\nThe default .BOX_TYPE is inferred from the class name.\n\n*Method `Box.__getattr__(self, attr)`*:\nIf there is no direct attribute from `SimpleBinary.__getattr__`,\nhave a look in the `.header` and `.body`.\n\n*Method `Box.__iter__(self)`*:\nIterating over a `Box` iterates over its body.\nTypically that would be the `.body.boxes`\nbut might be the samples if the body is a sample box,\netc.\n\n*Method `Box.ancestor(self, box_type)`*:\nReturn the closest ancestor box of type `box_type`.\n\n*Property `Box.box_type`*:\nThe `Box` header type.\n\n*Property `Box.box_type_path`*:\nThe type path to this Box.\n\n*Property `Box.box_type_s`*:\nThe `Box` header type as a string.\n\nIf the header type bytes decode as ASCII, return that,\notherwise the header bytes' repr().\n\n*Method `Box.dump(self, **kw)`*:\nDump this Box.\n\n*Method `Box.gather_metadata(self)`*:\nWalk the `Box` hierarchy looking for metadata.\nYield `(Box,TagSet)` for each `b'moov'` or `b'trak'` `Box`.\n\n*Method `Box.metatags(self)`*:\nReturn a `TagSet` containing metadata for this box.\n\n*Method `Box.parse(bfr: cs.buffer.CornuCopyBuffer)`*:\nDecode a `Box` from `bfr` and return it.\n\n*Method `Box.parse_field(self, field_name, bfr: cs.buffer.CornuCopyBuffer, binary_cls)`*:\n`parse_field` delegates to the `Box` body `parse_field`.\n\n*Property `Box.parse_length`*:\nThe length of the box as consumed from the buffer,\ncomputed as `self.end_offset-self.offset`.\n\n*Method `Box.reparse_buffer(self)`*:\nContext manager for continuing a parse from the `unparsed` field.\n\nPops the final `unparsed` field from the `Box`,\nyields a `CornuCopyBuffer` make from it,\nthen pushes the `unparsed` field again\nwith the remaining contents of the buffer.\n\n*Method `Box.self_check(self)`*:\nSanity check this Box.\n\n*Method `Box.transcribe(self)`*:\nTranscribe the `Box`.\n\nBefore transcribing the data, we compute the total box_size\nfrom the lengths of the current header, body and unparsed\ncomponents, then set the header length if that has changed.\nSince setting the header length can change its representation\nwe compute the length again and abort if it isn't stable.\nOtherwise we proceeed with a regular transcription.\n\n*Property `Box.unparsed_bs`*:\nThe unparsed data as a single `bytes` instance.\n\n*Property `Box.user_type`*:\nThe header user_type.\n\n*Method `Box.walk(self) -> Iterable[Tuple[ForwardRef('Box'), List[ForwardRef('Box')]]]`*:\nWalk this `Box` hierarchy.\n\nYields the starting box and its children as `(self,subboxes)`\nand then yields `(subbox,subsubboxes)` for each child in turn.\n\nAs with `os.walk`, the returned `subboxes` list\nmay be modified in place to prune or reorder the subsequent walk.\n\n## Class `BoxBody(cs.binary.SimpleBinary)`\n\nAbstract basis for all `Box` bodies.\n\n*Method `BoxBody.__getattr__(self, attr)`*:\nThe following virtual attributes are defined:\n* *TYPE*`s`:\n  \"boxes of type *TYPE*\",\n  an uppercased box type name with a training `s`;\n  a list of all elements whose `.box_type`\n  equals *TYPE*`.lower().encode('ascii')`.\n  The elements are obtained by iterating over `self`\n  which normally means iterating over the `.boxes` attribute.\n* *TYPE*:\n  \"the box of type *TYPE*\",\n  an uppercased box type name;\n  the sole element whose box type matches the type,\n  obtained from `.`*TYPE*`s[0]`\n  with a requirement that there is exactly one match.\n* *TYPE*`0`:\n  \"the optional box of type *TYPE*\",\n  an uppercased box type name with a trailing `0`;\n  the sole element whose box type matches the type,\n  obtained from `.`*TYPE*`s[0]`\n  with a requirement that there is exactly zero or one match.\n  If there are zero matches, return `None`.\n  Otherwise return the matching box.\n\n*Method `BoxBody.add_field(self, field_name, value)`*:\nAdd a field named `field_name` with the specified `value`\nto the box fields.\n\n*Method `BoxBody.boxbody_type_from_class()`*:\nCompute the Box's 4 byte type field from the class name.\n\n*Method `BoxBody.for_box_type(box_type: bytes)`*:\nReturn the `BoxBody` subclass suitable for the `box_type`.\n\n*Method `BoxBody.parse(bfr: cs.buffer.CornuCopyBuffer)`*:\nCreate a new instance and gather the `Box` body fields from `bfr`.\n\nSubclasses implement a `parse_fields` method to parse additional fields.\n\n*Method `BoxBody.parse_boxes(self, bfr: cs.buffer.CornuCopyBuffer, **kw)`*:\nUtility method to parse the remainder of the buffer as a\nsequence of `Box`es.\n\n*Method `BoxBody.parse_field(self, field_name, bfr: cs.buffer.CornuCopyBuffer, binary_cls)`*:\nParse an instance of `binary_cls` from `bfr`\nand store it as the attribute named `field_name`.\n\n`binary_cls` may also be an `int`, in which case that many\nbytes are read from `bfr`.\n\n*Method `BoxBody.parse_field_value(self, field_name, bfr: cs.buffer.CornuCopyBuffer, binary_cls)`*:\nParse a single value binary, store the value as `field_name`,\nstore the instance as the field `field_name+'__Binary'`\nfor transcription.\n\nNote that this disassociaes the plain value attribute\nfrom what gets transcribed.\n\n*Method `BoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nParse additional fields.\nThis base class implementation consumes nothing.\n\n*Method `BoxBody.transcribe(self)`*:\nTranscribe the binary structure.\n\nThis default implementation transcribes the fields parsed with the\n`parse_field` method in the order parsed.\n\n*Method `BoxBody.transcribe_fields(self)`*:\nTranscribe the fields parsed with the `parse_field` method in the\norder parsed.\n\n## Class `BoxHeader(cs.binary.BoxHeader)`\n\nAn ISO14496 `Box` header packet.\n\n*Method `BoxHeader.parse(bfr: cs.buffer.CornuCopyBuffer)`*:\nDecode a box header from `bfr`.\n\n## Class `BTRTBoxBody(BoxBody)`\n\nBitRateBoxBody - section 8.5.2.2.\n\n*Method `BTRTBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nGather the `bufferSizeDB`, `maxBitrate` and `avgBitrate` fields.\n\n## Class `CO64BoxBody(FullBoxBody)`\n\nA 'c064' Chunk Offset box - section 8.7.5.\n\n*Method `CO64BoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nGather the `entry_count` and `chunk_offsets` fields.\n\n*Method `CO64BoxBody.transcribe(self)`*:\nTranscribe a `CO64BoxBody`.\n\n## Class `ContainerBoxBody(BoxBody)`\n\nCommon subclass of several things with `.boxes`.\n\n## Class `CPRTBoxBody(FullBoxBody)`\n\nA 'cprt' Copyright box - section 8.10.2.\n\n*Property `CPRTBoxBody.language`*:\nThe `language_field` as the 3 character ISO 639-2/T language code.\n\n*Method `CPRTBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nGather the `language` and `notice` fields.\n\n## Class `CSLGBoxBody(FullBoxBody)`\n\nA 'cslg' Composition to Decode box - section 8.6.1.4.\n\n*`CSLGBoxBody.CSLGParamsLong`*\n\n*`CSLGBoxBody.CSLGParamsQuad`*\n\n*Method `CSLGBoxBody.__getattr__(self, attr)`*:\nPresent the `params` attributes at the top level.\n\n*Method `CSLGBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nGather the compositionToDTSShift`, `leastDecodeToDisplayDelta`,\n`greatestDecodeToDisplayDelta`, `compositionStartTime` and\n`compositionEndTime` fields.\n\n## Function `decode_itunes_date_field(data) -> datetime.datetime`\n\nThe iTunes 'Date' meta field: a year or an ISO timestamp.\n\n## Function `deref_box(B, path)`\n\nDereference a path with respect to this Box.\n\n## Class `DREFBoxBody(FullBoxBody)`\n\nA 'dref' Data Reference box containing Data Entry boxes - section 8.7.2.1.\n\n*Method `DREFBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nGather the `entry_count` and `boxes` fields.\n\n## Function `dump_box(B, indent='', fp=None, crop_length=170, indent_incr=None)`\n\nRecursively dump a Box.\n\n## Class `ELNGBoxBody(FullBoxBody)`\n\nA ELNGBoxBody is a Extended Language Tag box - ISO14496 section 8.4.6.\n\n*Method `ELNGBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nGather the `extended_language` field.\n\n## Class `ELSTBoxBody(FullBoxBody)`\n\nAn 'elst' Edit List FullBoxBody - section 8.6.6.\n\n*`ELSTBoxBody.V0EditEntry`*\n\n*`ELSTBoxBody.V1EditEntry`*\n\n*Property `ELSTBoxBody.entry_class`*:\nThe class representing each entry.\n\n*Property `ELSTBoxBody.entry_count`*:\nThe number of entries.\n\n*Method `ELSTBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nParse the fields of an `ELSTBoxBody`.\n\n*Method `ELSTBoxBody.transcribe(self)`*:\nTranscribe an `ELSTBoxBody`.\n\n## Class `FREEBoxBody(BoxBody)`\n\nA 'free' or 'skip' box - ISO14496 section 8.1.2.\nNote the length and discard the data portion.\n\n*Method `FREEBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer, end_offset=Ellipsis, **kw)`*:\nGather the `padding` field.\n\n## Class `FTYPBoxBody(BoxBody)`\n\nAn 'ftyp' File Type box - ISO14496 section 4.3.\nDecode the major_brand, minor_version and compatible_brands.\n\n*Property `FTYPBoxBody.compatible_brands`*:\nThe compatible brands as a list of 4 byte bytes instances.\n\n*Method `FTYPBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer, **kw)`*:\nGather the `major_brand`, `minor_version` and `brand_bs` fields.\n\n## Class `FullBoxBody(BoxBody)`\n\nA common extension of a basic BoxBody, with a version and flags field.\nISO14496 section 4.2.\n\n*Property `FullBoxBody.flags`*:\nThe flags value, computed from the 3 flag bytes.\n\n## Function `get_deref_path(path, offset=0)`\n\nParse a `path` string from `offset`.\nReturn the path components and the offset where the parse stopped.\n\nPath components:\n* _identifier_: an identifier represents a `Box` field or if such a\n  field is not present, a the first subbox of this type\n* `[`_index_`]`: the subbox with index _index_\n\nExamples:\n\n    >>> get_deref_path('.abcd[5]')\n    (['abcd', 5], 8)\n\n## Class `HDLRBoxBody(FullBoxBody)`\n\nA HDLRBoxBody is a Handler Reference box - ISO14496 section 8.4.3.\n\n*Property `HDLRBoxBody.handler_type`*:\nThe handler_type as an ASCII string, its usual form.\n\n*Method `HDLRBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nGather the `handler_type_long` and `name` fields.\n\n## Function `ILSTAofBSchema(attribute_name)`\n\nAttribute name and type for ILST \"A of B\" schema.\n\n## Class `ILSTBoxBody(ContainerBoxBody)`\n\nApple iTunes Information List, container for iTunes metadata fields.\n\nThe basis of the format knowledge here comes from AtomicParsley's\ndocumentation here:\n\n    http://atomicparsley.sourceforge.net/mpeg-4files.html\n\nand additional information from:\n\n    https://github.com/sergiomb2/libmp4v2/wiki/iTunesMetadata\n\n*Method `ILSTBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\npylint: disable=attribute-defined-outside-init,too-many-locals\npylint: disable=too-many-statements,too-many-branches\n\n## Function `ILSTISOFormatSchema(attribute_name)`\n\nAttribute name and type for ILST ISO format schema.\n\n## Function `ILSTRawSchema(attribute_name)`\n\nAttribute name and type for ILST raw schema.\n\n## Function `ILSTTextSchema(attribute_name)`\n\nAttribute name and type for ILST text schema.\n\n## Function `ILSTUInt32BESchema(attribute_name)`\n\nAttribute name and type for ILST `UInt32BE` schema.\n\n## Function `ILSTUInt8Schema(attribute_name)`\n\nAttribute name and type for ILST `UInt8BE` schema.\n\n## Class `itunes_media_type(builtins.tuple)`\n\nitunes_media_type(type, stik)\n\n*Property `itunes_media_type.stik`*:\nAlias for field number 1\n\n*Property `itunes_media_type.type`*:\nAlias for field number 0\n\n## Class `itunes_store_country_code(builtins.tuple)`\n\nitunes_store_country_code(country_name, iso_3166_1_code, itunes_store_code)\n\n*Property `itunes_store_country_code.country_name`*:\nAlias for field number 0\n\n*Property `itunes_store_country_code.iso_3166_1_code`*:\nAlias for field number 1\n\n*Property `itunes_store_country_code.itunes_store_code`*:\nAlias for field number 2\n\n## Function `main(argv=None)`\n\nCommand line mode.\n\n## Class `MDATBoxBody(BoxBody)`\n\nA Media Data Box - ISO14496 section 8.1.1.\n\n*Method `MDATBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nGather all data to the end of the field.\n\n*Method `MDATBoxBody.transcribe(self)`*:\nTranscribe the data.\nRaise an `AssertionError` if we skipped the data during the parse.\n\n*Method `MDATBoxBody.transcribed_length(self)`*:\nReturn the transcription length even if we didn't keep the data.\n\n## Class `MDHDBoxBody(FullBoxBody)`\n\nA MDHDBoxBody is a Media Header box - ISO14496 section 8.4.2.\n\n*Method `MDHDBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nGather the `creation_time`, `modification_time`, `timescale`,\n`duration` and `language_short` fields.\n\n## Class `METABoxBody(FullBoxBody)`\n\nA 'meta' Meta BoxBody - section 8.11.1.\n\n*Method `METABoxBody.__getattr__(self, attr)`*:\nPresent the `ilst` attributes if present.\n\n*Method `METABoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nGather the `theHandler` `Box` and gather the following Boxes as `boxes`.\n\n## Class `MOOVBoxBody(ContainerBoxBody)`\n\nAn 'moov' Movie box - ISO14496 section 8.2.1.\nDecode the contained boxes.\n\n## Class `MP4Command(cs.cmdutils.BaseCommand)`\n\nCommand line implementation.\n\nUsage summary:\n\n    Usage: mp4 subcommand [...]\n      Subcommands:\n        autotag [-n] [-p prefix] [--prefix=prefix] paths...\n          Tag paths based on embedded MP4 metadata.\n          -n  No action.\n          -p prefix, --prefix=prefix\n              Set the prefix of added tags, default: 'mp4'\n        deref boxspec paths...\n          Dereference a Box specification against ISO14496 files.\n        extract [-H] filename boxref output\n          Extract the referenced Box from the specified filename into output.\n          -H  Skip the Box header.\n        help [-l] [subcommand-names...]\n          Print help for subcommands.\n          This outputs the full help for the named subcommands,\n          or the short help for all subcommands if no names are specified.\n          -l  Long help even if no subcommand-names provided.\n        info [{-|filename}]...]\n          Print informative report about each source.\n        parse [{-|filename}...]\n          Parse the named files (or stdin for \"-\").\n        shell\n          Run a command prompt via cmd.Cmd using this command's subcommands.\n        tags [{-p,--prefix} prefix] path\n          Report the tags of `path` based on embedded MP4 metadata.\n        test [testnames...]\n          Run self tests.\n\n*Method `MP4Command.cmd_autotag(self, argv, fstags: Optional[cs.fstags.FSTags] = <function <lambda> at 0x108080040>)`*:\nUsage: {cmd} [-n] [-p prefix] [--prefix=prefix] paths...\nTag paths based on embedded MP4 metadata.\n-n  No action.\n-p prefix, --prefix=prefix\n    Set the prefix of added tags, default: 'mp4'\n\n*Method `MP4Command.cmd_deref(self, argv)`*:\nUsage: {cmd} boxspec paths...\nDereference a Box specification against ISO14496 files.\n\n*Method `MP4Command.cmd_extract(self, argv)`*:\nUsage: {cmd} [-H] filename boxref output\nExtract the referenced Box from the specified filename into output.\n-H  Skip the Box header.\n\n*Method `MP4Command.cmd_info(self, argv)`*:\nUsage: {cmd} [{{-|filename}}]...]\nPrint informative report about each source.\n\n*Method `MP4Command.cmd_parse(self, argv)`*:\nUsage: {cmd} [{{-|filename}}...]\nParse the named files (or stdin for \"-\").\n\n*Method `MP4Command.cmd_tags(self, argv)`*:\nUsage: {cmd} [{{-p,--prefix}} prefix] path\nReport the tags of `path` based on embedded MP4 metadata.\n\n*Method `MP4Command.cmd_test(self, argv)`*:\nUsage: {cmd} [testnames...]\nRun self tests.\n\n## Class `MVHDBoxBody(FullBoxBody)`\n\nAn 'mvhd' Movie Header box - ISO14496 section 8.2.2.\n\n## Class `OverBox(cs.binary.BinaryListValues, HasBoxesMixin)`\n\nA fictitious `Box` encompassing all the Boxes in an input buffer.\n\n*Property `OverBox.boxes`*:\nAlias `.value` as `.boxes`: the `Box`es encompassed by this `OverBox`.\n\n*Method `OverBox.dump(self, **kw)`*:\nDump this OverBox.\n\n*Property `OverBox.length`*:\nThe `OverBox` is as long as the subsidary Boxes.\n\n*Method `OverBox.parse(bfr: cs.buffer.CornuCopyBuffer)`*:\nParse the `OverBox`.\n\n*Method `OverBox.walk(self)`*:\nWalk the `Box`es in the `OverBox`.\n\nThis does not yield the `OverBox` itself, it isn't really a `Box`.\n\n## Function `parse(o)`\n\nReturn the `OverBox` from a source (str, int, bytes, file).\n\nThe leading `o` parameter may be one of:\n* `str`: a filesystem file pathname\n* `int`: a OS file descriptor\n* `bytes`: a `bytes` object\n* `file`: if not `int` or `str` the presumption\n  is that this is a file-like object\n\nKeyword arguments are as for `OverBox.from_buffer`.\n\n## Function `parse_fields(bfr, copy_offsets=None, **kw)`\n\nParse an ISO14496 stream from the CornuCopyBuffer `bfr`,\nyield top level OverBoxes.\n\nParameters:\n* `bfr`: a `CornuCopyBuffer` provided the stream data,\n  preferably seekable\n* `discard_data`: whether to discard unparsed data, default `False`\n* `copy_offsets`: callable to receive `Box` offsets\n\n## Function `parse_tags(path, tag_prefix=None)`\n\nParse the tags from `path`.\nYield `(box,tags)` for each subbox with tags.\n\nThe optional `tag_prefix` parameter\nmay be specified to prefix each tag name with a prefix.\nOther keyword arguments are passed to `parse()`\n(typical example: `discard_data=True`).\n\n## Class `PDINBoxBody(FullBoxBody)`\n\nA 'pdin' Progressive Download Information box - ISO14496 section 8.1.3.\n\n*`PDINBoxBody.PDInfo`*\n\n*Method `PDINBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer, **kw)`*:\nGather the normal version information\nand then the `(rate,initial_delay)` pairs of the data section\nas the `pdinfo` field.\n\n## Function `report(box, indent='', fp=None, indent_incr=None)`\n\nReport some human friendly information about a box.\n\n## Class `SMHDBoxBody(FullBoxBody)`\n\nA 'smhd' Sound Media Headerbox - section 12.2.2.\n\n*Method `SMHDBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nGather the `balance` field.\n\n## Class `STCOBoxBody(FullBoxBody)`\n\nA 'stco' Chunk Offset box - section 8.7.5.\n\n*Property `STCOBoxBody.chunk_offsets`*:\nParse the `UInt32BE` chunk offsets from stashed buffer.\n\n*Method `STCOBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nGather the `entry_count` and `chunk_offsets` fields.\n\n## Class `STSCBoxBody(FullBoxBody)`\n\n'stsc' (Sample Table box - section 8.7.4.1.\n\n*`STSCBoxBody.STSCEntry`*\n\n*Property `STSCBoxBody.entries`*:\nA list of `int`s parsed from the `STSCEntry` list.\n\n*Method `STSCBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nGather the `entry_count` and `entries` fields.\n\n## Class `STSZBoxBody(FullBoxBody)`\n\nA 'stsz' Sample Size box - section 8.7.3.2.\n\n*Property `STSZBoxBody.entry_sizes`*:\nParse the `UInt32BE` entry sizes from stashed buffer\ninto a list of `int`s.\n\n*Method `STSZBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nGather the `sample_size`, `sample_count`, and `entry_sizes` fields.\n\n*Method `STSZBoxBody.transcribe(self)`*:\nTranscribe the `STSZBoxBody`.\n\n## Class `STZ2BoxBody(FullBoxBody)`\n\nA 'stz2' Compact Sample Size box - section 8.7.3.3.\n\n*Method `STZ2BoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nGather the `field_size`, `sample_count` and `entry_sizes` fields.\n\n*Method `STZ2BoxBody.transcribe(self)`*:\ntranscribe the STZ2BoxBody.\n\n## Class `TimeStamp32(cs.binary.UInt32BE, TimeStampMixin)`\n\nThe 32 bit form of an ISO14496 timestamp.\n\n## Class `TimeStamp64(cs.binary.UInt64BE, TimeStampMixin)`\n\nThe 64 bit form of an ISO14496 timestamp.\n\n## Class `TimeStampMixin`\n\nMethods to assist with ISO14496 timestamps.\n\n*Property `TimeStampMixin.datetime`*:\nThis timestamp as an UTC datetime.\n\n*Property `TimeStampMixin.unixtime`*:\nThis timestamp as a UNIX time (seconds since 1 January 1970).\n\n## Class `TKHDBoxBody(FullBoxBody)`\n\nA 'tkhd' Track Header box - ISO14496 section 8.2.2.\n\n*`TKHDBoxBody.TKHDMatrix`*\n\n## Class `TrackGroupTypeBoxBody(FullBoxBody)`\n\nA TrackGroupTypeBoxBody contains a track group id - ISO14496 section 8.3.3.2.\n\n*Method `TrackGroupTypeBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nGather the `track_group_id` field.\n\n## Class `TrackReferenceTypeBoxBody(BoxBody)`\n\nA TrackReferenceTypeBoxBody contains references to other tracks - ISO14496 section 8.3.3.2.\n\n*Method `TrackReferenceTypeBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nGather the `track_ids` field.\n\n## Class `TREFBoxBody(ContainerBoxBody)`\n\nTrack Reference BoxBody, container for trackReferenceTypeBoxes - ISO14496 section 8.3.3.\n\n## Class `TTSB_Sample(builtins.tuple)`\n\nTTSB_Sample(count, delta)\n\n*Property `TTSB_Sample.count`*:\nAlias for field number 0\n\n*Property `TTSB_Sample.delta`*:\nAlias for field number 1\n\n## Class `URL_BoxBody(FullBoxBody)`\n\nAn 'url ' Data Entry URL BoxBody - section 8.7.2.1.\n\n*Method `URL_BoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nGather the `location` field.\n\n## Class `URN_BoxBody(FullBoxBody)`\n\nAn 'urn ' Data Entry URL BoxBody - section 8.7.2.1.\n\n*Method `URN_BoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nGather the `name` and `location` fields.\n\n## Class `UTF8or16Field(cs.binary.SimpleBinary)`\n\nAn ISO14496 UTF8 or UTF16 encoded string.\n\n*Method `UTF8or16Field.parse(bfr: cs.buffer.CornuCopyBuffer)`*:\nGather optional BOM and then UTF8 or UTF16 string.\n\n*Method `UTF8or16Field.transcribe(self)`*:\nTranscribe the field suitably encoded.\n\n## Class `VMHDBoxBody(FullBoxBody)`\n\nA 'vmhd' Video Media Headerbox - section 12.1.2.\n\n*`VMHDBoxBody.OpColor`*\n\n*Method `VMHDBoxBody.parse_fields(self, bfr: cs.buffer.CornuCopyBuffer)`*:\nGather the `graphicsmode` and `opcolor` fields.\n\n# Release Log\n\n\n\n*Release 20240422*:\n* Replace dropped UTF16NULField with BinaryUTF16NUL.\n* Comment out unused CO64BoxBody.chunk_offsets, uses dropped (and not replaced) deferred_field.\n* Drop FallbackBoxBody, we'll just use BoxBody when there's no box specific subclass.\n* Replace pick_boxbody_class with BoxBody.for_box_type.\n* Rename boxbody_type_from_klass to boxbody_type_from_class.\n* Drop obsolete KNOWN_BOXBODY_CLASSES.\n* MP4Command.cmd_info: print moov.udta.meta.ilst.cover in SIXEL format on a terminal.\n* Rename parse_deref_path to get_deref_path like other lexical functions.\n* ILSTBoxBody.__getattr__: fix lookup of long names.\n\n*Release 20231129*:\nSmall updates and fixes.\n\n*Release 20230212*:\n* Drop cs.context.StackableState in favour of cs.threads.State.\n* MP4Command.cmd_autotag: use @uses_fstags for the fstags parameter.\n\n*Release 20220606*:\nUpdate obsolete use of Tag.with_prefix.\n\n*Release 20210306*:\n* Huge refactor of the Box classes to the new Binary* classes from cs.binary.\n* mp4: new \"tags\" subcommand to print the tags parsed from a file.\n* BoxHeader: fix the definition of MAX_BOX_SIZE_32.\n* BoxBody: new parse_boxes utility method to part the remainder of a Box as subBoxes.\n* MP4.cmd_parse: run the main parse in discard_data=True mode.\n* METABoxBody.__getattr__: fix ILST typo.\n* MP4Command: update for new cs.cmdutils.BaseCommand API.\n* Many small fixes and tweaks.\n\n*Release 20200229*:\n* ILST: recognise @cpy as copyright, sfID as itunes_store_country_code.\n* ILST: new SFID_ISO_3166_1_ALPHA_3_CODE and STIK_MEDIA_TYPES providing context data for various field values, as yet unused.\n* Make various list fields of some boxes deferred because they are expensive to parse (uses new cs.binary deferred_field).\n* add_generic_sample_boxbody: drop __iter__, causes dumb iterators to parse the samples.\n* ILST: iTunes \"Date\" metadata seem to contain plain years or ISO8601 datestamps.\n* mp4 autotag: add -n (no action) and -p,--prefix (set tag prefix, default 'mp4') options.\n* mp4 autotag: use \"mp4.\" as the tag prefix.\n\n*Release 20200130*:\n* Parsing of ILST boxes (iTunes metadata).\n* Command line: new \"info\" subcommand reporting metadata, \"autotag\" applying metadata to fstags.\n* Box tree walk, ancestor, iteration.\n* Assorted cleanups and internal changes.\n\n*Release 20190220*:\nparse_buffer yields instead of returns; some small bugfixes.\n\n*Release 20180810*:\n* parse_fd(): use a mmap to access the descriptor if a regular file and not discard_data;\n* this lets us use the mmapped file as backing store for the data, a big win for the media sections.\n\n*Release 20180805*:\nInitial PyPI release.\n\n",
    "bugtrack_url": null,
    "license": "GNU General Public License v3 or later (GPLv3+)",
    "summary": "Facilities for ISO14496 files - the ISO Base Media File Format, the basis for several things including MP4 and MOV.",
    "version": "20240422",
    "project_urls": {
        "URL": "https://bitbucket.org/cameron_simpson/css/commits/all"
    },
    "split_keywords": [
        "python3"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5771bc331094a1a209bd61ac809277eb15227618995fbd239ed8f570a0545782",
                "md5": "90e033d3a2b57dcb617d345834d67763",
                "sha256": "3c7d4d8ae1cfa3a34c0be1d281beb8aaa85f044b6953db2472f7877d52ee3170"
            },
            "downloads": -1,
            "filename": "cs.iso14496-20240422-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "90e033d3a2b57dcb617d345834d67763",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 30568,
            "upload_time": "2024-04-22T06:42:34",
            "upload_time_iso_8601": "2024-04-22T06:42:34.692635Z",
            "url": "https://files.pythonhosted.org/packages/57/71/bc331094a1a209bd61ac809277eb15227618995fbd239ed8f570a0545782/cs.iso14496-20240422-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e83099f666fdb38d557306b8864445527cdcb667e83f933f8b53c449a2853590",
                "md5": "0f7b96f387804ab28ba8e57c2b075e9f",
                "sha256": "73f74ad7fae0ee48f73017a47fe4ae6993b676c53ba6e580913e40ff44dbf658"
            },
            "downloads": -1,
            "filename": "cs.iso14496-20240422.tar.gz",
            "has_sig": false,
            "md5_digest": "0f7b96f387804ab28ba8e57c2b075e9f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 43981,
            "upload_time": "2024-04-22T06:42:36",
            "upload_time_iso_8601": "2024-04-22T06:42:36.679718Z",
            "url": "https://files.pythonhosted.org/packages/e8/30/99f666fdb38d557306b8864445527cdcb667e83f933f8b53c449a2853590/cs.iso14496-20240422.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-22 06:42:36",
    "github": false,
    "gitlab": false,
    "bitbucket": true,
    "codeberg": false,
    "bitbucket_user": "cameron_simpson",
    "bitbucket_project": "css",
    "lcname": "cs.iso14496"
}
        
Elapsed time: 0.23423s