我正在構建一個基于 HTTP (DASH) 服務的動態自適應流媒體。這是它發布的 .mpd 檔案:
<?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="dynamic" minBufferTime="PT0S">
<ProgramInformation>
<Title>My Stream</Title>
<Source>Music Inc</Source>
</ProgramInformation>
<Period>
<AdaptationSet id="3" mimeType="audio/mp4" segmentAlignment="true" audioSamplingRate="48000.0" codecs="mp4a.40.2" startWithSAP="1" lang="eng">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" id="2"/>
<BaseURL></BaseURL>
<SegmentTemplate initialization="mystream-$RepresentationID$-IS.mp4" media="mystream-$RepresentationID$-$Number$.m4s" startNumber="163428046" timescale="1" duration="10"/>
<Representation id="128kbps" bandwidth="128000"/>
</AdaptationSet>
</Period>
</MPD>
但是,當我打開此流(在 VLC 中)時,我在日志中看到 404 錯誤:
adaptive error: Failed reading https://************:443/mystream-128kbps-326856092.m4s: HTTP/1.1 404 Not Found
adaptive error: Failed reading https://************:443/mystream-128kbps-326856093.m4s: HTTP/1.1 404 Not Found
請注意,VLC 嘗試定位的第一個段模板編號326856092恰好是 MPD 中指定的預期編號的 2 倍startNumber="163428046"
uj5u.com熱心網友回復:
首先,您創建了一個dynamic清單,這意味著它用于直播。
播放實時流時,播放器不會從第一個片段開始,它會嘗試根據您在清單中提供的資訊確定實時邊緣。實時邊緣隨著掛鐘前進。
由于您沒有提供任何型別的資訊,如availabilityStartTime, Periodstart等,它只使用清單發布的時間 - 在您的情況下是 HTTP 回應的時間 - 和段持續時間。
例如:
publishTime = 1634310000
currentSegmentNumber = startNumber publishTime * timescale / duration
= 163428046 1634310000 * 1 / 10
= 326859046
如果出于某種原因,您startNumber在生成清單時對應于當前的 Epoch 時間,它將嘗試以 2x 開始。
static如果您想從內容的開頭開始,也許您需要一個VoD 播放串列。
在此處閱讀更多資訊:DASH-IF 時序模型
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/319264.html
標籤:xml 流媒体 媒体播放器 播放列表 mpeg 破折号
