gpac
gpac copied to clipboard
Question. I did two bitrates. How I can set them in "Bitrate" section instead of "Tracks" in dash.js
- [x] I looked for a similar issue and couldn't find any.
- [x] I tried with the latest version of GPAC. Installers available at https://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 ...).
Hello. I made my stream with two different resolutions. First is 1920x1080, second is 320x240
MP4Box -dash 10000 -dash-ctx context.txt -profile dashavc264:live \
--utcs="https://time.akamai.com/?iso&ms" \
-mpd-refresh 2 -dynamic -bs-switching multi -segment-timeline -url-template \
-insert-utc -min-buffer 15 -mpd-title "Test" --force_flush -time-shift 30 \
input.mp4#video:#Bitrate=5M:#Representation=norm:dur=10 \
input.mp4#video:#Bitrate=1M:dur=10:@ffsws:osize=320x240@enc:c=avc:b=200k:#Representation=shit \
input.mp4#audio
input.mp4#trackID=3:id=eng:#Bitrate=48k:#Role=subtitle:#Language=eng \
-out /dev/shm/broadcast/b4PB34n1Ym/manifest.mpd
It works, but by some reason, I can not switch bitrates through "Bitrates" control of dash.js (reference dash.js) But I can do it through "Tracks" control.
Still 1 bitrate
But 2 tracks. I can change the quality here.
What I have to change in MP4Box command, to switch bitrates via "Bitrate" control instead of "Tracks"?
Sample manifest:
<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 2.5-DEV-rev351-g0b6b7b46e-master at 2024-07-01T13:45:43.298Z -->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="dynamic" availabilityStartTime="2024-07-01T12:38:13.074Z" publishTime="2024-07-01T13:45:43.298Z" minimumUpdatePeriod="PT0H0M2.000S" timeShiftBufferDepth="PT0H0M30.000S" maxSegmentDuration="PT0H0M12.160S" profiles="urn:mpeg:dash:profile:isoff-live:2011,http://dashif.org/guidelines/dash264">
<ProgramInformation moreInformationURL="https://gpac.io">
<Title>Test</Title>
</ProgramInformation>
<Location>...manifest.mpd?nimblesessionid=7366</Location><Period id="DID1" start="PT0H0M0.000S">
<AdaptationSet segmentAlignment="true" maxWidth="1920" maxHeight="1080" maxFrameRate="25" par="168:95" mimeType="video/mp4" startWithSAP="1">
<SegmentTemplate media="input_dash_track1_$Time$.m4s?nimblesessionid=7366" initialization="input_dash_track1_init.mp4?nimblesessionid=7366" timescale="12800" startNumber="1">
<SegmentTimeline>
<S t="51553894" d="128000"/>
<S t="51683328" d="128000" r="1"/>
</SegmentTimeline>
</SegmentTemplate>
<Representation id="norm" mimeType="video/mp4" codecs="avc1.640028" width="1920" height="1080" frameRate="25" sar="189:190" bandwidth="5000000">
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true" mimeType="audio/mp4" startWithSAP="1">
<SegmentTemplate media="input_dash_track2_$Time$.m4s?nimblesessionid=7366" initialization="input_dash_track2_init.mp4?nimblesessionid=7366" timescale="8000" startNumber="1">
<SegmentTimeline>
<S t="32220544" d="80896"/>
<S t="32302080" d="79872"/>
<S t="32382080" d="79872"/>
</SegmentTimeline>
</SegmentTemplate>
<Representation id="2" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="8000" bandwidth="27278">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="1"/>
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true" lang="en" mimeType="application/mp4" startWithSAP="1">
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="subtitle"/>
<SegmentTemplate media="input_dash_track3_$Time$.m4s?nimblesessionid=7366" initialization="input_dash_track3_init.mp4?nimblesessionid=7366" timescale="1000" startNumber="1">
<SegmentTimeline>
<S t="4027648" d="10000"/>
<S t="4037760" d="10000" r="1"/>
</SegmentTimeline>
</SegmentTemplate>
<Representation id="3" mimeType="application/mp4" codecs="wvtt" bandwidth="48000">
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true" maxWidth="320" maxHeight="240" maxFrameRate="25" par="126:95" mimeType="video/mp4" startWithSAP="1">
<SegmentTemplate media="input_dash_track4_$Time$.m4s?nimblesessionid=7366" initialization="input_dash_track4_init.mp4?nimblesessionid=7366" timescale="12800" startNumber="1">
<SegmentTimeline>
<S t="51553894" d="128000"/>
<S t="51683328" d="128000" r="1"/>
</SegmentTimeline>
</SegmentTemplate>
<Representation id="shit" mimeType="video/mp4" codecs="avc1.64000D" width="320" height="240" frameRate="25" sar="189:190" bandwidth="200000">
</Representation>
</AdaptationSet>
</Period>
<UTCTiming schemeIdUri="urn:mpeg:dash:utc:http-iso:2014" value="https://time.akamai.com/?iso&ms"/>
</MPD>