I have encountered an issue with MP4Box where it fails to generate initialization segments for all audio profiles when multiple audio tracks with the same sample rate but different bit rates are used.

Steps to Reproduce:

Created video and audio MP4 files with required resolutions and sample rates using the following FFmpeg commands:

For video
`ffmpeg -y -i video30.mp4 -c:v libx264 -r 24 -x264opts 'keyint=48:min-keyint=48:no-scenecut' -vf scale=-2:1080 -b:v 5000000 -maxrate 5000000 -movflags faststart -bufsize 5000000 -profile:v main -preset fast -an "1080.mp4"`
`ffmpeg -y -i video30.mp4 -c:v libx264 -r 24 -x264opts 'keyint=48:min-keyint=48:no-scenecut' -vf scale=-2:720 -b:v 3000000 -maxrate 3000000 -movflags faststart -bufsize 3000000 -profile:v main -preset fast -an "720.mp4"`
`ffmpeg -y -i video30.mp4 -c:v libx264 -r 24 -x264opts 'keyint=48:min-keyint=48:no-scenecut' -vf scale=-2:540 -b:v 1499968 -maxrate 1499968 -movflags faststart -bufsize 1499968 -profile:v main -preset fast -an "540.mp4"`
`ffmpeg -y -i video30.mp4 -c:v libx264 -r 24 -x264opts 'keyint=48:min-keyint=48:no-scenecut' -vf scale=-2:360 -b:v 699968 -maxrate 699968 -movflags faststart -bufsize 699968 -profile:v main -preset fast -an "360.mp4"`


For audio
`ffmpeg -y -i video30.mp4 -map 0:1 -vn -c:a aac -b:a 130828 -ar 48000 -ac 2 audio0.m4a
``ffmpeg -y -i video30.mp4 -map 0:1 -vn -c:a aac -b:a 137500 -ar 48000 -ac 2 audio1.m4a
``ffmpeg -y -i video30.mp4 -map 0:1 -vn -c:a aac -b:a 135812 -ar 48000 -ac 2 audio2.m4a
``ffmpeg -y -i video30.mp4 -map 0:1 -vn -c:a aac -b:a 130911 -ar 48000 -ac 2 audio3.m4a
`

Used MP4Box with the following command to create a DASH manifest:
`MP4Box -dash 4000 -frag 4000 -rap -segment-name 'segment_$RepresentationID$_' -fps 24  1080.mp4#video:id=1080p 720.mp4#video:id=720p 540.mp4#video:id=540p 360.mp4#video:id=360p audio0.m4a#audio:id=0:role=main audio1.m4a#audio:id=1:role=main audio2.m4a#audio:id=2:role=main audio3.m4a#audio:id=3:role=main -out master.mpd
`

After executing the above commands, only the initialization segment for the first audio profile (audio0.m4a) is generated as segment_0_.mp4, but no initialization files are created for the other audio profiles (audio1.m4a, audio2.m4a, audio3.m4a). However, segment files are present for all audio profiles; only the initialization files are missing.

Additional Information:

1. The issue seems to occur specifically when multiple audio tracks with the same sample rate but different bit rates are used.
2. This problem does not occur with the video streams; they are generated correctly as expected.


MP4Box Not Generating Initialization Segments for All Audio Profiles with Same Sample Rate but Different Bit Rates
This is a GitHub Issue
repo:gpac
owner:gpac
Title : MP4Box Not Generating Initialization Segments for All Audio Profiles with Same Sample Rate but Different Bit Rates
Issue date:

--- start body ---
I have encountered an issue with MP4Box where it fails to generate initialization segments for all audio profiles when multiple audio tracks with the same sample rate but different bit rates are used.

Steps to Reproduce:

Created video and audio MP4 files with required resolutions and sample rates using the following FFmpeg commands:

For video
`ffmpeg -y -i video30.mp4 -c:v libx264 -r 24 -x264opts 'keyint=48:min-keyint=48:no-scenecut' -vf scale=-2:1080 -b:v 5000000 -maxrate 5000000 -movflags faststart -bufsize 5000000 -profile:v main -preset fast -an "1080.mp4"`
`ffmpeg -y -i video30.mp4 -c:v libx264 -r 24 -x264opts 'keyint=48:min-keyint=48:no-scenecut' -vf scale=-2:720 -b:v 3000000 -maxrate 3000000 -movflags faststart -bufsize 3000000 -profile:v main -preset fast -an "720.mp4"`
`ffmpeg -y -i video30.mp4 -c:v libx264 -r 24 -x264opts 'keyint=48:min-keyint=48:no-scenecut' -vf scale=-2:540 -b:v 1499968 -maxrate 1499968 -movflags faststart -bufsize 1499968 -profile:v main -preset fast -an "540.mp4"`
`ffmpeg -y -i video30.mp4 -c:v libx264 -r 24 -x264opts 'keyint=48:min-keyint=48:no-scenecut' -vf scale=-2:360 -b:v 699968 -maxrate 699968 -movflags faststart -bufsize 699968 -profile:v main -preset fast -an "360.mp4"`


For audio
`ffmpeg -y -i video30.mp4 -map 0:1 -vn -c:a aac -b:a 130828 -ar 48000 -ac 2 audio0.m4a
``ffmpeg -y -i video30.mp4 -map 0:1 -vn -c:a aac -b:a 137500 -ar 48000 -ac 2 audio1.m4a
``ffmpeg -y -i video30.mp4 -map 0:1 -vn -c:a aac -b:a 135812 -ar 48000 -ac 2 audio2.m4a
``ffmpeg -y -i video30.mp4 -map 0:1 -vn -c:a aac -b:a 130911 -ar 48000 -ac 2 audio3.m4a
`

Used MP4Box with the following command to create a DASH manifest:
`MP4Box -dash 4000 -frag 4000 -rap -segment-name 'segment_$RepresentationID$_' -fps 24  1080.mp4#video:id=1080p 720.mp4#video:id=720p 540.mp4#video:id=540p 360.mp4#video:id=360p audio0.m4a#audio:id=0:role=main audio1.m4a#audio:id=1:role=main audio2.m4a#audio:id=2:role=main audio3.m4a#audio:id=3:role=main -out master.mpd
`

After executing the above commands, only the initialization segment for the first audio profile (audio0.m4a) is generated as segment_0_.mp4, but no initialization files are created for the other audio profiles (audio1.m4a, audio2.m4a, audio3.m4a). However, segment files are present for all audio profiles; only the initialization files are missing.

Additional Information:

1. The issue seems to occur specifically when multiple audio tracks with the same sample rate but different bit rates are used.
2. This problem does not occur with the video streams; they are generated correctly as expected.


--- end body ---
