Presumably the same also applies when importing other kinds of tracks, but I've only tested it with subtitles.

I have an .mp4 container with 1 video stream and 3 audio streams (info is taken via MediaInfo):

```
Video, StreamOrder:0, ID:1
Audio (eng), StreamOrder:1, ID:2
Audio (ita), StreamOrder:2, ID:3
Audio (fre), StreamOrder:3, ID:4
```

This is what happens when I add a subtitle via ffmpeg:

`ffmpeg -i in.mp4 -i subtitles.srt -map 0 -map 1 -c copy -c:s mov_text out.mp4`

```
Video, StreamOrder:0, ID:1
Audio (eng), StreamOrder:1, ID:2
Audio (ita), StreamOrder:2, ID:3
Audio (fre), StreamOrder:3, ID:4
Text, StreamOrder:4, ID:5
```

And this is the end result when importing the same subtitle to the same .mp4 with mp4box:

`mp4box -add subtitles.srt in.mp4`

```
Video, StreamOrder:3, ID:1
Audio (fre), StreamOrder:0, ID:4
Audio (ita), StreamOrder:1, ID:3
Audio (eng), StreamOrder:2, ID:2
Text, StreamOrder:4, ID:5
```

So all existing streams have changed positions while retaining their IDs, the last stream became first, the penultimate stream became second, and so on. Is this behavior wanted for some reason?
mp4box changes positions of existing streams upon importing subtitle track
This is a GitHub Issue
repo:gpac
owner:gpac
Title : mp4box changes positions of existing streams upon importing subtitle track
Issue date:

--- start body ---
Presumably the same also applies when importing other kinds of tracks, but I've only tested it with subtitles.

I have an .mp4 container with 1 video stream and 3 audio streams (info is taken via MediaInfo):

```
Video, StreamOrder:0, ID:1
Audio (eng), StreamOrder:1, ID:2
Audio (ita), StreamOrder:2, ID:3
Audio (fre), StreamOrder:3, ID:4
```

This is what happens when I add a subtitle via ffmpeg:

`ffmpeg -i in.mp4 -i subtitles.srt -map 0 -map 1 -c copy -c:s mov_text out.mp4`

```
Video, StreamOrder:0, ID:1
Audio (eng), StreamOrder:1, ID:2
Audio (ita), StreamOrder:2, ID:3
Audio (fre), StreamOrder:3, ID:4
Text, StreamOrder:4, ID:5
```

And this is the end result when importing the same subtitle to the same .mp4 with mp4box:

`mp4box -add subtitles.srt in.mp4`

```
Video, StreamOrder:3, ID:1
Audio (fre), StreamOrder:0, ID:4
Audio (ita), StreamOrder:1, ID:3
Audio (eng), StreamOrder:2, ID:2
Text, StreamOrder:4, ID:5
```

So all existing streams have changed positions while retaining their IDs, the last stream became first, the penultimate stream became second, and so on. Is this behavior wanted for some reason?
--- end body ---
