【发布时间】:2018-06-20 04:49:29
【问题描述】:
我正在尝试使用 mp4box 进行伪直播,并使用 apache 或 mamp 中的 dash.js 将其可视化,我的操作系统是 sierra。 对于我的测试,我使用了一个已经编码的辛普森一家视频http://www.h264info.com/clips.html, 因为我知道ffmpeg的编码仅用于多比特率目的,目前我不需要它。 Osmo 工作正常,可以快速良好地读取清单 Dash.js 示例适用于 html 中的清单链接,但不适用于我的清单。所以我知道 Dash.js 可以工作。
命令行: sudo MP4Box -dash-live 1000 -frag 1000 -profile live -subdur 1000 -mpd-refresh 1000 -time-shift 16 -bs-switching no -segment-name output-seg -out manifest.mpd video_test.mp4
我使用 sudo 因为我使用的是 osx,但我相信这不会造成任何问题。 我尝试不同的浏览器,dashifk 一致性页面。 我不明白为什么在 Mamp 或 Apache 上,页面无法可视化我为伪实时使用而生成的清单。 我哪里错了? 你可以帮帮我吗? 谢谢! 马西莫
清单:
<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 0.7.2-DEV-rev358-g433fbcc3-master at 2018-01-10T19:37:33.515Z-->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="dynamic" publishTime="2018-01-10T19:37:33Z" availabilityStartTime="2018-01-10T19:28:35.335Z" timeShiftBufferDepth="PT0H1M4.000S" mediaPresentationDuration="PT0H0M16.227S" maxSegmentDuration="PT0H0M1.333S" profiles="urn:mpeg:dash:profile:isoff-live:2011">
<ProgramInformation moreInformationURL="http://gpac.io">
<Title>manifest.mpd generated by GPAC</Title>
</ProgramInformation>
<Period id="DID1" start="PT0H0M0.000S">
<AdaptationSet segmentAlignment="true" maxWidth="320" maxHeight="240" maxFrameRate="15" par="4:3" lang="eng">
<ContentComponent id="1" contentType="audio" />
<ContentComponent id="2" contentType="video" />
<SegmentTemplate media="output-seg$Number$.m4s" timescale="1000" startNumber="1" duration="1000" initialization="output-seginit.mp4"/>
<Representation id="1" mimeType="video/mp4" codecs="mp4a.40.2,mp4v.20.2" width="320" height="240" frameRate="15" sar="1:1" startWithSAP="1" bandwidth="108411">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="1"/>
</Representation>
</AdaptationSet>
</Period>
</MPD>
用于测试的基本 HTML
THE BASIC HTML FOR TEST
`<script src="https://cdn.dashjs.org/latest/dash.all.min.js"></script>
...
<style>
video {
width: 640px;
height: 360px;
}
</style>
...
<body>
<div>
<video data-dashjs-player autoplay src="manifest.mpd" controls></video>
</div>
</body>
【问题讨论】: