Video streaming 重新排列虚线段列表中的段

Video streaming 重新排列虚线段列表中的段,video-streaming,streaming,mpeg-dash,Video Streaming,Streaming,Mpeg Dash,我有一个实时的破折号清单,看起来像这样 <MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="" maxSegmentDuration="PT4S" minimumUpdatePeriod="PT595H" minBufferTime="PT2S" type="dynamic" availabilityStartTime="2016-11-20

我有一个实时的破折号清单,看起来像这样

<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="" maxSegmentDuration="PT4S" minimumUpdatePeriod="PT595H" minBufferTime="PT2S" type="dynamic" availabilityStartTime="2016-11-20T17:00:54Z" publishTime="2016-11-20T17:00:54Z" profiles="urn:hbbtv:dash:profile:isoff-live:2012,urn:mpeg:dash:profile:isoff-live:2011" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" timeShiftBufferDepth="PT120S">
<ProgramInformation>
    <Title>Title</Title>
</ProgramInformation>
<Period start="PT0S" id="p1">
    <AdaptationSet mimeType="audio/mp4" lang="en" startWithSAP="1" contentType="audio" segmentAlignment="true">
        <Representation audioSamplingRate="48000" bandwidth="128000" id="128kb" codecs="mp4a.40.2">
            <AudioChannelConfiguration value="2" schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011"/>
            <SegmentTemplate duration="4" media="audio/128kbps/segment_$Number$.m4s" initialization="audio/128kbps/init.mp4" startNumber="0"/>
        </Representation>
    </AdaptationSet>
    <AdaptationSet mimeType="video/mp4" minWidth="426" contentType="video" maxWidth="1920" minHeight="240" segmentAlignment="true" startWithSAP="1" maxHeight="1080">
        <Representation frameRate="60000/1000" height="480" width="858" bandwidth="1200000" codecs="avc1.42c00d" id="1200kb">
            <SegmentTemplate duration="4" media="video/480p/segment_$Number$.m4s" initialization="video/480p/init.mp4" startNumber="0"/>
        </Representation>
        <!-- Some more representations -->
    </AdaptationSet>
</Period>

标题

流媒体播放时,所有片段都会保存到磁盘,以便在视频点播中使用,并从流媒体会话中突出显示。我通过将实时清单重新制作成静态清单来实现VOD解决方案

我的问题是,当我想创建高光时,我想对片段进行重新排序,并指定应该下载和播放的片段。我试着用分段列表来做这件事。我的新舱单 我创建了如下外观:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

突出显示测试


这个解决方案遇到的问题首先是计时器不是从0开始,而是从37596(9399*4)开始。我的第二个问题是,当高光1结束时,它不会播放高光2。相反,如果冻结,就好像已经到了视频的结尾

我猜init文件中有一些东西指定了如何播放这些片段


有没有办法只创建一个新的清单而不创建一个新的init文件呢?

您不需要一个新的init文件。主要问题是媒体段的时间戳。要解决初始时间的问题,您应该将
presentationTimeOffset
属性添加到清单中,其中包含要播放的第一段的开始时间

第二个问题是,如MPEG-DASH标准所建议的,不连续性(在您的情况下,两个高光之间的时间变化)应通过将其拆分为新的时段来处理:

如果不连续,建议添加一个新的句点以重置@presentationTimeOffset的值

这两件事可以结合在一起,如下所示(为了简单起见,我跳过了音频适配集)。我在这个案例中使用了时间线

<MPD type="static" mediaPresentationDuration="PT0H2M24.000S" minBufferTime="PT4S" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" 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,urn:com:dashif:dash264">
    <Period start="PT0S" duration="PT8S">
        <!--Highlight 1-->
        <AdaptationSet mimeType="video/mp4" minWidth="426" contentType="video" maxWidth="1920" minHeight="240" segmentAlignment="true" startWithSAP="1" maxHeight="1080">
            <SegmentTemplate timescale="1" presentationTimeOffset="37596" startNumber="9399" initialization="video/480p/init.mp4" media="video/$RepresentationID$/segment_$Number$.m4s">
                <SegmentTimeline>
                    <S t="37596" d="4" r="1"/>
                </SegmentTimeline>
            </SegmentTemplate>
            <Representation frameRate="60000/1000" height="480" width="858" bandwidth="1200000" codecs="avc1.42c00d" id="480p" />
        </AdaptationSet>
    </Period>
    <Period duration="PT8S">
        <!--Highlight 2-->
        <AdaptationSet mimeType="video/mp4" minWidth="426" contentType="video" maxWidth="1920" minHeight="240" segmentAlignment="true" startWithSAP="1" maxHeight="1080">
            <SegmentTemplate timescale="1" presentationTimeOffset="37404" startNumber="9351" initialization="video/480p/init.mp4" media="video/$RepresentationID$/segment_$Number$.m4s">
                <SegmentTimeline>
                    <S t="37404" d="61440" r="1"/>
                </SegmentTimeline>
            </SegmentTemplate>
            <Representation frameRate="60000/1000" height="480" width="858" bandwidth="1200000" codecs="avc1.42c00d" id="480p" />
        </AdaptationSet>
    </Period>
    <Period duration="PT8S">
        <!--Highlight 3-->
        <AdaptationSet mimeType="video/mp4" minWidth="426" contentType="video" maxWidth="1920" minHeight="240" segmentAlignment="true" startWithSAP="1" maxHeight="1080">
            <SegmentTemplate timescale="1" presentationTimeOffset="37796" startNumber="9449" initialization="video/480p/init.mp4" media="video/$RepresentationID$/segment_$Number$.m4s">
                <SegmentTimeline>
                    <S t="37796" d="61440" r="1"/>
                </SegmentTimeline>
            </SegmentTemplate>
            <Representation frameRate="60000/1000" height="480" width="858" bandwidth="1200000" codecs="avc1.42c00d" id="480p" />
        </AdaptationSet>
    </Period>
</MPD>

应该工作,不确定别人喜欢什么

<MPD type="static" mediaPresentationDuration="PT0H2M24.000S" minBufferTime="PT4S" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" 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,urn:com:dashif:dash264">
    <Period start="PT0S" duration="PT8S">
        <!--Highlight 1-->
        <AdaptationSet mimeType="video/mp4" minWidth="426" contentType="video" maxWidth="1920" minHeight="240" segmentAlignment="true" startWithSAP="1" maxHeight="1080">
            <SegmentTemplate timescale="1" presentationTimeOffset="37596" startNumber="9399" initialization="video/480p/init.mp4" media="video/$RepresentationID$/segment_$Number$.m4s">
                <SegmentTimeline>
                    <S t="37596" d="4" r="1"/>
                </SegmentTimeline>
            </SegmentTemplate>
            <Representation frameRate="60000/1000" height="480" width="858" bandwidth="1200000" codecs="avc1.42c00d" id="480p" />
        </AdaptationSet>
    </Period>
    <Period duration="PT8S">
        <!--Highlight 2-->
        <AdaptationSet mimeType="video/mp4" minWidth="426" contentType="video" maxWidth="1920" minHeight="240" segmentAlignment="true" startWithSAP="1" maxHeight="1080">
            <SegmentTemplate timescale="1" presentationTimeOffset="37404" startNumber="9351" initialization="video/480p/init.mp4" media="video/$RepresentationID$/segment_$Number$.m4s">
                <SegmentTimeline>
                    <S t="37404" d="61440" r="1"/>
                </SegmentTimeline>
            </SegmentTemplate>
            <Representation frameRate="60000/1000" height="480" width="858" bandwidth="1200000" codecs="avc1.42c00d" id="480p" />
        </AdaptationSet>
    </Period>
    <Period duration="PT8S">
        <!--Highlight 3-->
        <AdaptationSet mimeType="video/mp4" minWidth="426" contentType="video" maxWidth="1920" minHeight="240" segmentAlignment="true" startWithSAP="1" maxHeight="1080">
            <SegmentTemplate timescale="1" presentationTimeOffset="37796" startNumber="9449" initialization="video/480p/init.mp4" media="video/$RepresentationID$/segment_$Number$.m4s">
                <SegmentTimeline>
                    <S t="37796" d="61440" r="1"/>
                </SegmentTimeline>
            </SegmentTemplate>
            <Representation frameRate="60000/1000" height="480" width="858" bandwidth="1200000" codecs="avc1.42c00d" id="480p" />
        </AdaptationSet>
    </Period>
</MPD>