AVComponent class

AVComponent represents a component within a complete media stream – a single stream of video, audio or data that can be played or manipulated. This is not necessary for basic playback, record or EPG services. However, it provides a mechanism to get at extended streams for enhanced services.

For an MPEG-2 transport stream not delivered via adaptive streaming, the set of components will be the audio, video and subtitle components listed in the PMT of the service. For content in the MP4 file format not delivered via adaptive streaming, the set of components will be the audio, video and subtitle tracks listed in the “moov” box. For content delivered via adaptive streaming, A/V Component objects will correspond to adaptation sets in the MPD.

For forward compatibility the application should check the value of the type property to ensure that it is accessing an AVComponent object of the correct type.

Constants

The following constants are defined as properties on AVComponent objects:

NameValueUse
COMPONENT_TYPE_VIDEO0Represents a video component. This constant is used for all video components regardless of encoding.
COMPONENT_TYPE_AUDIO1Represents an audio component. This constant is used for all audio components regardless of encoding.
COMPONENT_TYPE_SUBTITLE2Represents a subtitle component. This constant is used for all subtitle components regardless of subtitle format. NOTE: A subtitle component may also be related to closed captioning as part of a video stream.

Properties

This section details the properties of a AVComponent object.

readonly Integer componentTag
The component tag identifies a component. The component tag identifier corresponds to the component_tag in the component descriptor in the ES loop of the stream in the PMT [EN 300 468], or undefined if the component is not carried in an MPEG-2 TS.
readonly Integer pid
Note: This property is deprecated in instances returned from an A/V control object.

The MPEG Program ID (PID) of the component in the MPEG2-TS in which it is carried, or undefined if the component is not carried in an MPEG-2 TS.
readonly Integer type
Type of the component stream. Valid values for this field are given by the constants listed in constants section above.
readonly String encoding
Note: This property is deprecated in instances returned from an A/V control object.

The encoding of the component stream.

The value of video format or audio format defined in section 3 of Open IPTV Forum, “Release 2 Specification, Volume 2 – Media Formats” are used. For subtitle components, the following values are used:
ValueDescription
DVB-SUBTDVB subtitles
EBU-SUBTEBU Teletext based subtitles
CEA-SUBTCEA-708C Closed Captions
3GPP-TT3GPP Timed Text
readonly Boolean encrypted
Note: This property is deprecated in instances returned from an A/V control object.

Flag indicating whether the component is encrypted or not.

Methods

An AVComponent object has no methods defined.

Additional Notes

Property

Name and Type
MPEG-2 TS

With DVB-SI component_descriptor in SDT and/or EIT
MPEG-2 TS

Without DVB-SI SDT and EIT
MP4 FFMPEG DASH
Name: componentTag
Type: Integer
The contents of the component_tag field in the stream_identifier_descriptor in PMTNot definedThe value of the id attribute in the AdaptationSet (if provided)
Name: pid
Type: Integer
The PID of the stream in the PMTtrackIDNot defined
Name: type
Type: One of the following constants COMPONENT_TYPE_VIDEO / COMPONENT_TYPE_AUDIO / COMPONENT_TYPE_SUBTITLE
May be derived as follows:

A value of 0x02 or 0x1B in the stream_type field in the PMT → VIDEO.

A value of 0x03 or 0x11 in the stream_type field in the PMT → AUDIO.

A value of 0x06 in the stream_type field in the PMT and the presence of a DTS_audio_stream_descriptor in the ES loop in the PMT → AUDIO.

A value of 0x06 in the stream_type field in the PMT and the presence of an AC3_descriptor or an Enhanced_AC3_descriptor in the ES loop in the PMT → AUDIO.

A value of 0x06 in the stream_type field in the PMT and the presence of a subtitling_descriptor in the ES loop in the PMT → SUBTITLES.A value of 0x06 in the stream_type field in the PMT and the presence of a teletext_descriptor in the ES loop in the PMT and an entry in that descriptor with Teletext_type set to 0x02 or 0x05 → SUBTITLES.
Track has a VisualSampleEntry (handler_type =”vide”) → COMPONENT_TYPE_VIDEO

Track has an AudioSampleEntry (handler_type = “soun”) → COMPONENT_TYPE_AUDIO
Defined by the value of the ‘@contentType’ attribute
Name: encoding
Type: A string identifying the video or audio format as defined in section 3 of [OIPF_MEDIA2] or the subtitle format as defined in section 7.16.5.2.1
Property type is COMPONENT_TYPE_VIDEODefined by the ‘@codecs’ attribute
→ “video/mpeg” or “video/mp2t”. Track has a sample description type “avc1” → “video/mp4”.
“hvc1” → “video/mp4”
“hev1” → “video/mp4”
Property type is COMPONENT_TYPE_AUDIO
A value of 0x03 in the stream_type field in the PMT → “audio/mpeg”.

A value of 0x11 in the stream_type field in the PMT and the profile_and_level field in that descriptor indicates MPEG-4 AAC or MPEG-4 HE AAC → “audio/mp4”.

A value of 0x11 in the stream_type field in the PMT and the profile_and_level field in that descriptor indicates MPEG-4 HE AAC v2 → “audio/aacp”.

A value of 0x06 in the stream_type field in the PMT and the presence of a DTS_audio_stream_descriptor in the ES loop in the PMT → “audio/vnd.dts”.

A value of 0x06 in the stream_type field in the PMT and the presence of an AC3_descriptor in the ES loop in the PMT → “audio/ac3”.
Track has a sample description type “mp4a” → “audio/mp4”
Property type is COMPONENT_TYPE_SUBTITLE
A value of 0x01 in subtitling_type field of the subtitling_descriptor in the ES loop of the PMT → “EBU-SUBT”.

A value of 0x10 or 0x11 or 0x12 or 0x14 in the subtitling_type field of the subtitling_descriptor in the ES loop of the PMT → “DVB-SUBT”.

A value of 0x20 or 0x21 or 0x22 or 0x24 in the subtitling_type field of the subtitling_descriptor in the ES loop of the PMT → “DVB_SUBT” (the hearingImpaired property in the derived AVSubtitleComponent would be set to true).

The PMT contains a caption_service_descriptor with a digital_cc flag having the value of 1 for at least one of the represented caption services → “CEA-SUBT”.
Track has a handler-type “text” → “3GPP-TT”.
Name: encrypted
Type: Boolean
May be derived from any of the following:

Presence of a CA_descriptor in the PMT in the program information loop.

Presence of a CA_descriptor in the PMT in the elementary stream information loop describing the stream.
Not defined
Name: aspectRatio
Type: Number containing width divided by height as a decimal

Only defined for video components.
Derived from the stream_content and component_type fields in the component_descriptor.UndefinedNot definedDefined by the value of the ‘@par’ attribute
Name: language
Type: String containing an ISO 639-2 language code as defined in [ISO639-2]

Only defined for audio and subtitle components.
Property type is COMPONENT_TYPE_AUDIODefined by the value of the ‘@lang’ attribute in the MPD, whether set explicitly or inherited. The contents of the language field in the ‘mdhd” of the track shall be ignored.
For audio components, the contents of the ISO_639_language_code field in the ISO_639_language_descriptor In the ES loop of the PMT unless overridden by the ISO_639_language_code field in the supplementary_audio_descriptor.The contents of the language field in the media header “mdhd” of the track.
Property type is COMPONENT_TYPE_SUBTITLE
For subtitles, the contents of the ISO_639_language_code field in the subtitling_descriptor or teletext_descriptor, as appropriate.The contents of the language field in the media header “mdhd” of the track.
Name: audioDescription
Type: Boolean – True if is component is an audio description

Only defined for audio components.
True if any of the following is true:

There is an audio component with an ISO_639_language_descriptor in the PMT with the audio_type field set to 0x03

There is a supplementary_audio_descriptor with the editorial_classification field set to 0x01

There is an ac-3_descriptor or an enhanced_ac-3_descriptor with a component_type field with the service_type flags set to Visually Impaired.

Otherwise false.
Not defined
Name: audioChannels
Type: Number indicating 5 for 5.1, 7 for 7.1, 2 for stereo

Only defined for audio components.
Not definedDerived from the contents of the Audio Channel Configuration element
Name: hearingImpaired
Type: Boolean – Has value true if the stream is intended for the hearing-impaired (e.g. contains a written description of the sound effects), false otherwise.

Only defined for subtitle components
True if one of the following is true:

There is a subtitling_descriptor with the subtitling_type field set to 0x20, 0x21, 0x22, 0x23 or 0x24.

There is a teletext_descriptor with a teletext_type field with a value of 0x05.
Not definedNot defined