2016-12-12 1 views
1

나는 이렇게 생생한 대시 매니페스트를 가지고 있습니다.대시 세그먼트 목록의 세그먼트 재정렬

<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 솔루션을 완성했습니다.

내 문제는 하이라이트를 만들고 싶을 때 세그먼트를 재정렬하고 다운로드하고 재생할 세그먼트를 정확하게 지정하는 것입니다. SegmentationList를 사용하여이 작업을 시도했습니다. 나는이 같은 모습을 만든 것을 나의 새로운 매니페스트 :

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

강조 테스트

<Period start="PT0S" duration="PT0H2M24.000S"> 
    <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"> 
      <SegmentList duration="61440" timescale="15360"> 
       <Initialization sourceURL="video/480p/init.mp4"/> 
       <!--Highlight 1--> 
       <SegmentURL media="video/480p/segment_9399.m4s"/> 
       <SegmentURL media="video/480p/segment_9400.m4s"/> 
       <!--Highlight 2--> 
       <SegmentURL media="video/480p/segment_9351.m4s"/> 
       <SegmentURL media="video/480p/segment_9352.m4s"/> 
       <!--Highlight 3--> 
       <SegmentURL media="video/480p/segment_9449.m4s"/> 
       <SegmentURL media="video/480p/segment_9450.m4s"/> 
      </SegmentList> 
     </Representation> 
    </AdaptationSet> 
    <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"/> 
      <SegmentList duration="192000" timescale="48000"> 
       <Initialization sourceURL="audio/128kbps/init.mp4"/> 
       <!--Highlight 1--> 
       <SegmentURL media="audio/128kbps/segment_9399.m4s"/> 
       <SegmentURL media="audio/128kbps/segment_9400.m4s"/> 
       <!--Highlight 2--> 
       <SegmentURL media="audio/128kbps/segment_9351.m4s"/> 
       <SegmentURL media="audio/128kbps/segment_9352.m4s"/> 
       <SegmentURL media="audio/128kbps/segment_9357.m4s"/> 
       <!--Highlight 3--> 
       <SegmentURL media="audio/128kbps/segment_9449.m4s"/> 
       <SegmentURL media="audio/128kbps/segment_9450.m4s"/> 
      </SegmentList> 
     </Representation> 
    </AdaptationSet> 
</Period> 

나는이 솔루션으로 실행하는 문제는 타이머가 '아무튼 것이 우선이다 t는 0에서 시작하여 37596 (9399 * 4)부터 시작합니다. 두 번째 문제는 하이라이트 1이 끝나면 하이라이트 2가 재생되지 않는다는 것입니다. 대신 얼어 붙은 것처럼 비디오의 끝까지 도달했습니다.

세그먼트를 재생하는 방법을 지정하는 초기화 파일에 뭔가있는 것 같아요.

새 매니페스트 만 만들고 새 초기화 파일을 만들지 않아도이 작업을 수행 할 수 있습니까?

답변

1

새 초기화 파일이 필요하지 않습니다. 주요 문제는 미디어 세그먼트의 타임 스탬프입니다. 초기 시간의 문제를 해결하려면 presentationTimeOffset 속성을 재생하려는 첫 번째 세그먼트의 시작 시간과 함께 Manifest에 추가해야합니다.

번째 문제는 MPEG-DASH 표준 새로운 기간로 분할하여 처리한다 (케이스 두 하이라이트의 시간 변화) 불연속 권고이다 :

가 불연속 인 경우

그것이 @presentationTimeOffset의 값을 재설정 할 새 기간을 추가하는 것이 좋습니다.

아래 두 가지를 결합 할 수 있습니다 (간단히하기 위해 Audio AdaptationSets는 건너 뛰었습니다). 이 경우 SegmentTimeline을 사용했습니다.

<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> 

물론 플레이어는 presentationTimeOffset과 복수 기간을 모두 지원해야합니다. Bitmovin Player이 작동해야한다고 생각합니다. 다른 사람에 대해서는 확실하지 않습니다. dash.js.