Difference between revisions of "SHIP:Port:Media"

From Serious Documentation
Jump to: navigation, search
Line 25: Line 25:
 
|{{:SHIP:Port:Media:width}}
 
|{{:SHIP:Port:Media:width}}
 
|}
 
|}
Media files can be raw media files or "containered" media.  Raw media files, such as .mp3 files, contain only one thing -- in the case of .mp3, an mp3 audio clip.  Containers, on the other hand, are wrappers that enclose audio and/or video tracks and more.  The benefit of these containers is the structure and elements inside the container are well described in the container data; with raw clips the system has to guess (by filename extension often) as to the type of media encoded in the file.
 
  
All video files are wrapped in containers, commonly either .mp4 or .webm containers, since they contain audio and video information and the container guides the decoders on the location, size, and nature of the different pieces within the container.</onlyinclude>
+
In general, media files are "containers" that contain audio and/or video. For example, an mp3 audio clip on your PC is actually an MPEG-ES container encapsulating a mp3 encoded audio stream. MPEG movies, often in .mp4 files, are actually containers encapsulating video and audio tracks encoded in various different ways.
 +
 
 +
The distinction between the ''container type'' and the ''encoding of the content'' is important, since for [[SHIPEngine]] on the platform to be able to play the media, both the container as well as the content must be recognizable and playable.</onlyinclude>
  
 
{{†}}see [[SHIP:GRMs|GRM]]
 
{{†}}see [[SHIP:GRMs|GRM]]

Revision as of 10:42, 15 November 2018

MEDIAx ports refer to output of audio and video on the module, and are referred to in the format "platform.MEDIA0", "platform.DRIVE.MEDIA1", etc.

MEDIAx ports have various attributes to determine/control their state:

Portvar Data Type Permissions Description
error Byte Read The error condition of the media clip.
height Dimension Read The height, in pixels, of the current media clip playing if it has video content (else it will be 0).
layer Byte Read/Write The current layer the video is being played in (default 1 is overlay, 0 is behind the GUI).
length Integer Read The total length of the mediaclip being played, in miliseconds.
location Node Read/Write The source DRIVE (e.g. platform.DRIVE.BULK0) of the source audio or video file.
play Boolean Read/Write Plays (if true) or pauses (if false) the media clip. This automatically turns false at the end of playing a clip.
position Integer Read/Write The current position being played in this media clip, in miliseconds.
source String Read/Write The filename of the source audio or video file.
state Byte Read The state of the media clip.
volume Byte Read/Write The volume of the current media clip playing from 0 to 100%.
width Dimension Read The width, in pixels, of the current media clip playing if it has video content (else it will be 0).

In general, media files are "containers" that contain audio and/or video. For example, an mp3 audio clip on your PC is actually an MPEG-ES container encapsulating a mp3 encoded audio stream. MPEG movies, often in .mp4 files, are actually containers encapsulating video and audio tracks encoded in various different ways.

The distinction between the container type and the encoding of the content is important, since for SHIPEngine on the platform to be able to play the media, both the container as well as the content must be recognizable and playable.

see GRM