PID assignment and configuration

To assign PIDs into periods and adaptation sets and configure the session, the segmenter looks for the following properties on each input PID:  

- `Representation`: assigns representation ID to input PID. If not set, the default behavior is to have each media component in different adaptation sets. Setting the `Representation` allows explicit multiplexing of the source(s)  
- `Period`: assigns period ID to input PID. If not set, the default behavior is to have all media in the same period with the same start time  
- `PStart`: assigns period start. If not set, 0 is assumed, and periods appear in the Period ID declaration order. If negative, this gives the period order (-1 first, then -2 ...). If positive, this gives the true start time and will abort DASHing at period end  

_Note: When both positive and negative values are found, the by-order periods (negative) will be inserted AFTER the timed period (positive)_  

- `ASID`: assigns parent adaptation set ID. If not 0, only sources with same AS ID will be in the same adaptation set  

_Note: If multiple streams in source, only the first stream will have an AS ID assigned_  

- `xlink`: for remote periods, only checked for null PID  
- `Role`, `PDesc`, `ASDesc`, `ASCDesc`, `RDesc`: various descriptors to set for period, AS or representation  
- `BUrl`: overrides segmenter [-base] with a set of BaseURLs to use for the PID (per representation)  
- `Template`: overrides segmenter [template](#template) for this PID  
- `DashDur`: overrides segmenter segment duration for this PID  
- `StartNumber`: sets the start number for the first segment in the PID, default is 1  
- `IntraOnly`: indicates input PID follows HLS EXT-X-I-FRAMES-ONLY guidelines  
- `CropOrigin`: indicates x and y coordinates of video for SRD (size is video size)  
- `SRD`: indicates SRD position and size of video for SRD, ignored if `CropOrigin` is set  
- `SRDRef`: indicates global width and height of SRD, ignored if `CropOrigin` is set  
- `HLSPL`: name of variant playlist, can use templates  
- `HLSMExt`: list of extensions to add to master playlist entries, ['foo','bar=val'] added as `,foo,bar=val`  
- `HLSVExt`: list of extensions to add to variant playlist, ['#foo','#bar=val'] added as `#foo \n #bar=val`  
- Non-dash properties: `Bitrate`, `SAR`, `Language`, `Width`, `Height`, `SampleRate`, `NumChannels`, `Language`, `ID`, `DependencyID`, `FPS`, `Interlaced`, `Codec`. These properties are used to setup each representation and can be overridden on input PIDs using the general PID property settings (cf global help).  

    
Example
```
gpac -i test.mp4:#Bitrate=1M -o test.mpd
```
  
This will force declaring a bitrate of 1M for the representation, regardless of actual input bitrate.  
Example
```
gpac -i muxav.mp4 -o test.mpd
```
  
This will create un-multiplexed DASH segments.  
Example
```
gpac -i muxav.mp4:#Representation=1 -o test.mpd
```
  
This will create multiplexed DASH segments.  
Example
```
gpac -i m1.mp4 -i m2.mp4:#Period=Yep -o test.mpd
```
  
This will put src `m1.mp4` in first period, `m2.mp4` in second period.  
Example
```
gpac -i m1.mp4:#BUrl=http://foo/bar -o test.mpd
```
  
This will assign a baseURL to src `m1.mp4`.  
Example
```
gpac -i m1.mp4:#ASCDesc=&lt;ElemName val="attval"&gt;text&lt;/ElemName&gt; -o test.mpd
```
  
This will assign the specified XML descriptor to the adaptation set.  
_Note:  this can be used to inject most DASH descriptors not natively handled by the segmenter._  
The segmenter handles the XML descriptor as a string and does not attempt to validate it. Descriptors, as well as some segmenter filter arguments, are string lists (comma-separated by default), so that multiple descriptors can be added:  
Example
```
gpac -i m1.mp4:#RDesc=&lt;Elem attribute="1"/&gt;,&lt;Elem2&gt;text&lt;/Elem2&gt; -o test.mpd
```
  
This will insert two descriptors in the representation(s) of `m1.mp4`.  
Example
```
gpac -i video.mp4:#Template=foo$Number$ -i audio.mp4:#Template=bar$Number$ -o test.mpd
```
  
This will assign different templates to the audio and video sources.  
Example
```
gpac -i null:#xlink=http://foo/bar.xml:#PDur=4 -i m.mp4:#PStart=-1 -o test.mpd
```
  
This will insert an create an MPD with first a remote period then a regular one.  
Example
```
gpac -i null:#xlink=http://foo/bar.xml:#PStart=6 -i m.mp4 -o test.mpd
```
  
This will create an MPD with first a regular period, dashing only 6s of content, then a remote one.  
Example
```
gpac -i v1:#SRD=0x0x1280x360:#SRDRef=1280x720 -i v2:#SRD=0x360x1280x360 -o test.mpd
```
  
This will layout the `v2` below `v1` using a global SRD size of 1280x720.  
  
The segmenter will create multiplexing filter chains for each representation and will reassign PID IDs so that each media component (video, audio, ...) in an adaptation set has the same ID.  
  
For HLS, the output manifest PID will deliver the master playlist __and__ the variant playlists.  
The default variant playlist are $NAME_$N.m3u8, where $NAME is the radical of the output file name and $N is the 1-based index of the variant.  
  
When HLS mode is enabled, the segment [template](#template) is relative to the variant playlist file, which can also be templated.  
Example
```
gpac -i av.mp4:#HLSPL=$Type$/index.m3u8 -o dash/live.m3u8:dual:template='$Number$'
```
  
This will put video segments and playlist in `dash/video/` and audio segments and playlist in `dash/audio/`