Track selection and concepts - devrath/MediaAlchemySuite GitHub Wiki

What is track selection ?

  • A media contains multiple tracks. Each track is considered as group. Thus there are multiple groups.
  • Track selection is a process of selecting a perticular track or group.
  • The selection process is determined by track-selection-parameters.

Visual Representation

Here is a diagram that shows how Media3 organizes this information for a hypothetical video file.

Media File (e.g., "movie.mkv")
β”‚
└── Tracks Object (The complete manifest of all available tracks)
    β”‚
    β”œβ”€β”€β”€ TrackGroup 1 (Type: VIDEO)
    β”‚    β”‚   Description: Contains different quality levels of the same video stream.
    β”‚    β”‚
    β”‚    β”œβ”€β”€ Track 1.1 (Format: {resolution: 1920x1080, bitrate: 5Mbps, ...})
    β”‚    └── Track 1.2 (Format: {resolution: 1280x720, bitrate: 2Mbps, ...})
    β”‚
    β”œβ”€β”€β”€ TrackGroup 2 (Type: AUDIO)
    β”‚    β”‚   Description: Contains all the different audio languages or commentaries.
    β”‚    β”‚
    β”‚    β”œβ”€β”€ Track 2.1 (Format: {language: "en", channels: 6, codec: "AC3", ...})
    β”‚    └── Track 2.2 (Format: {language: "es", channels: 2, codec: "AAC", ...})
    β”‚
    └─── TrackGroup 3 (Type: TEXT)
         β”‚   Description: Contains all the available subtitle languages.
         β”‚
         β”œβ”€β”€ Track 3.1 (Format: {language: "en", type: "Subtitles", ...})
         β”œβ”€β”€ Track 3.2 (Format: {language: "es", type: "Subtitles", ...})
         └── Track 3.3 (Format: {language: "fr", type: "Subtitles", ...})

  • Imagine a modern DVD or Blu-ray disc for a movie. The disc itself is the media file.
  • When you put the disc to the player you get a list of menu for playback options.
  • The menu on the DVD is organized into sections:
    • "Audio Setup": This is a TrackGroup of type AUDIO.
      • Here you will have a list English, FranΓ§ais.
      • Here you can select one at a time.
    • "Subtitles": This is a TrackGroup of type TEXT.
      • Here also you will have a list English, FranΓ§ais.
      • Here also you can select one at a time.
    • (Implicitly) The Movie Itself: This is a TrackGroup of type VIDEO.
      • Here also you will have video resolution of list 1920x1080 , 1280x720 etc
      • Here also you can select one at a time.
  • Now out of all the groupings we can select one of the selection thus 3 selections from 3 groups, Finally the final output.
  • Tracks Object:---> This is the top-level container that the player gives you.
  • TrackGroup : ----> It's a collection of one or more individual tracks that are of the same kind.All tracks in a group are mutually exclusive. You can't select two tracks from the same group at once (e.g., you can't play 1080p and 720p video simultaneously).
  • TrackObject: ----> This is the most granular level. Each track represents a single, playable stream of data. For Video Resolution, framerate, bitrate. For Audio: The language code ("en", "es"). For Text: The language code ("fr").