Thanks for reporting your issue. Please make sure these boxes are checked before submitting your issue - thank you!

- [x] I looked for a similar issue and couldn't find any.
- [x] I tried with the latest version of GPAC. Installers available at http://gpac.io/downloads/gpac-nightly-builds/
- [x] I give enough information for contributors to reproduce my issue (meaningful title, github labels, platform and compiler, command-line ...). I can share files anonymously with this dropbox: https://www.mediafire.com/filedrop/filedrop_hosted.php?drop=eec9e058a9486fe4e99c33021481d9e1826ca9dbc242a6cfaab0fe95da5e5d95

Detailed guidelines: http://gpac.io/2013/07/16/how-to-file-a-bug-properly/

When using MP4box to segment MP4 files using inband parameter sets for bitstream switching the generated manifest references non-existent initialization segments. Only one initialization-segment is produced, which is fine, but the MPD-file references it like this: `initialization="ib_$RepresentationID$_.mp4"`. The template string contains the `$RepresentationID`, which probably shouldn't be the case, when only a single init segment is generated.

Invocation:
```
./bin/gcc/MP4Box -dash 4000 -rap -bs-switching inband -segment-name 'ib_$RepresentationID$_$Number%03d$' -out ./inband.mpd foreman_qp30.266 foreman_qp40.266
```
Output files:
```
ib_1_001.m4s
ib_1_002.m4s
ib_1_.mp4
ib_2_001.m4s
ib_2_002.m4s
inband.mpd
```

MPD-file:
```xml
<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 2.1-DEV-rev48-gf6d6225a9-master at 2022-03-15T12:40:30.266Z -->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H0M6.000S" maxSegmentDuration="PT0H0M5.120S" profiles="urn:mpeg:dash:profile:full:2011">
 <ProgramInformation moreInformationURL="http://gpac.io">
  <Title>inband.mpd generated by GPAC</Title>
 </ProgramInformation>

 <Period duration="PT0H0M6.000S">
  <AdaptationSet segmentAlignment="true" maxWidth="352" maxHeight="288" maxFrameRate="50" par="11:9" lang="und" bitstreamSwitching="true" startWithSAP="1">
   <SegmentTemplate media="ib_$RepresentationID$_$Number%03d$.m4s" initialization="ib_$RepresentationID$_.mp4" timescale="50" startNumber="1" duration="200"/>
   <Representation id="1" mimeType="video/mp4" codecs="vvi1.1.L35.CQA" width="352" height="288" frameRate="50" sar="1:1" bandwidth="330000">
   </Representation>
   <Representation id="2" mimeType="video/mp4" codecs="vvi1.1.L35.CQA" width="352" height="288" frameRate="50" sar="1:1" bandwidth="87281">
   </Representation>
  </AdaptationSet>
 </Period>
</MPD>
```

I have not yet tested if this is a general problem or specific to working with VVC bitstreams.
MPD references non-existent initialization segment
This is a GitHub Issue
repo:gpac
owner:gpac
Title : MPD references non-existent initialization segment
Issue date:

--- start body ---
Thanks for reporting your issue. Please make sure these boxes are checked before submitting your issue - thank you!

- [x] I looked for a similar issue and couldn't find any.
- [x] I tried with the latest version of GPAC. Installers available at http://gpac.io/downloads/gpac-nightly-builds/
- [x] I give enough information for contributors to reproduce my issue (meaningful title, github labels, platform and compiler, command-line ...). I can share files anonymously with this dropbox: https://www.mediafire.com/filedrop/filedrop_hosted.php?drop=eec9e058a9486fe4e99c33021481d9e1826ca9dbc242a6cfaab0fe95da5e5d95

Detailed guidelines: http://gpac.io/2013/07/16/how-to-file-a-bug-properly/

When using MP4box to segment MP4 files using inband parameter sets for bitstream switching the generated manifest references non-existent initialization segments. Only one initialization-segment is produced, which is fine, but the MPD-file references it like this: `initialization="ib_$RepresentationID$_.mp4"`. The template string contains the `$RepresentationID`, which probably shouldn't be the case, when only a single init segment is generated.

Invocation:
```
./bin/gcc/MP4Box -dash 4000 -rap -bs-switching inband -segment-name 'ib_$RepresentationID$_$Number%03d$' -out ./inband.mpd foreman_qp30.266 foreman_qp40.266
```
Output files:
```
ib_1_001.m4s
ib_1_002.m4s
ib_1_.mp4
ib_2_001.m4s
ib_2_002.m4s
inband.mpd
```

MPD-file:
```xml
<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 2.1-DEV-rev48-gf6d6225a9-master at 2022-03-15T12:40:30.266Z -->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H0M6.000S" maxSegmentDuration="PT0H0M5.120S" profiles="urn:mpeg:dash:profile:full:2011">
 <ProgramInformation moreInformationURL="http://gpac.io">
  <Title>inband.mpd generated by GPAC</Title>
 </ProgramInformation>

 <Period duration="PT0H0M6.000S">
  <AdaptationSet segmentAlignment="true" maxWidth="352" maxHeight="288" maxFrameRate="50" par="11:9" lang="und" bitstreamSwitching="true" startWithSAP="1">
   <SegmentTemplate media="ib_$RepresentationID$_$Number%03d$.m4s" initialization="ib_$RepresentationID$_.mp4" timescale="50" startNumber="1" duration="200"/>
   <Representation id="1" mimeType="video/mp4" codecs="vvi1.1.L35.CQA" width="352" height="288" frameRate="50" sar="1:1" bandwidth="330000">
   </Representation>
   <Representation id="2" mimeType="video/mp4" codecs="vvi1.1.L35.CQA" width="352" height="288" frameRate="50" sar="1:1" bandwidth="87281">
   </Representation>
  </AdaptationSet>
 </Period>
</MPD>
```

I have not yet tested if this is a general problem or specific to working with VVC bitstreams.
--- end body ---
