Dash-Industry-Forum / dash.js

A reference client implementation for the playback of MPEG DASH via Javascript and compliant browsers.
http://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html
Other
5.09k stars 1.67k forks source link

Repeating chunk requests when using SegmentTimeline #1351

Closed aletorrado closed 7 years ago

aletorrado commented 8 years ago

I'm trying to use SegmentTemplate with SegmentTimeline as well.

With the configuration (I use FFMPEG to encode with the standard dash muxer), at some point, dash.js start to request the same chunk number, again and again all the time, and playback stops.

Any idea?

dsparacio commented 8 years ago

You did not post an MPD so this is a guess. Is there a segment timeline with duratio info as well as seg tem with number or time template?

If you remove the segTimeline nodes and add a duration value (largest one from timeline info) to the proper parent node like adaptation set it may work. We noticed this with other content produced with Akamai using FFmpeg. I think there is an issue in Dash.js as it should play with the segtimeline in it but not resolved yet.

aletorrado commented 8 years ago

This is the MPD, notice it's a live streaming:

<?xml version="1.0" encoding="utf-8"?>
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="urn:mpeg:dash:schema:mpd:2011"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    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"
    minimumUpdatePeriod="PT8S"
    suggestedPresentationDelay="PT8S"
    availabilityStartTime="2016-04-25T21:45:37"
    publishTime="2016-04-25T21:46:08"
    minBufferTime="PT8.3S">
    <ProgramInformation>
    </ProgramInformation>
    <Period start="PT0.0S">
        <AdaptationSet contentType="video" segmentAlignment="true" bitstreamSwitching="true" frameRate="60/2">
            <Representation id="0" mimeType="video/mp4" codecs="avc1.64001e" bandwidth="600000" width="640" height="360" frameRate="60/2">
                <SegmentTemplate timescale="15360" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
                    <SegmentTimeline>
                        <S t="0" d="128000" />
                        <S d="29696" />
                        <S d="152064" />
                        <S d="128000" r="1" />
                        <S d="69632" />
                        <S d="128000" />
                    </SegmentTimeline>
                </SegmentTemplate>
            </Representation>
            <Representation id="1" mimeType="video/mp4" codecs="avc1.64001f" bandwidth="1800000" width="1280" height="720" frameRate="60/2">
                <SegmentTemplate timescale="15360" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
                    <SegmentTimeline>
                        <S t="0" d="128000" />
                        <S d="29696" />
                        <S d="152064" />
                        <S d="128000" r="1" />
                        <S d="69632" />
                    </SegmentTimeline>
                </SegmentTemplate>
            </Representation>
        </AdaptationSet>
        <AdaptationSet contentType="audio" segmentAlignment="true" bitstreamSwitching="true">
            <Representation id="2" mimeType="audio/mp4" codecs="mp4a.40.2" bandwidth="128000" audioSamplingRate="44100">
                <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2" />
                <SegmentTemplate timescale="44100" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
                    <SegmentTimeline>
                        <S t="0" d="365568" />
                        <S d="999424" />
                        <S d="257024" />
                        <S d="584704" />
                        <S d="15360" />
                    </SegmentTimeline>
                </SegmentTemplate>
            </Representation>
        </AdaptationSet>
    </Period>
</MPD>
dsparacio commented 8 years ago

ah so you can do my test. Sorry should of asked if static or not. Can I ask what are you using, to push the live stream dashcast?

aletorrado commented 8 years ago

I'm streaming with FFMPEG DASH MUXER (you will need version >= 2.8, preferably >= 3). You can use this command:

ffmpeg -i <some input> -async 1 -vsync 1 -f dash <manifest output>.mpd

FFMPEG will convert the manifest to type=static when that input is closed, so make sure you test it while FFMPEG is encoding.

I like to use -async 1 and -vasync 1 because Google Chrome seem to have some playback issues without it.

davemevans commented 8 years ago

Is the availabilityStartTime static between updates?

P-e-n commented 8 years ago

I have the same problem with live streaming, using segment template with segment timeline. I suspect this happens to every live streams with timeline segment templates.

This is a sample online mpd. http://vm2.dashif.org/livesim-dev/segtimeline_1/testpic_2s/Manifest.mpd

The stream was played on http://dashif.org/reference/players/javascript/v2.1.0/samples/dash-if-reference-player/index.html

Repeated requests for the same segments happen for video/audio/subtitles.

capture2

However, this does not happen for release 2.0.

Could you please take a look at this?

davemevans commented 8 years ago

@P-e-n's problem is different to the OP and appears only to occur at startup. Can you open a new issue?

P-e-n commented 8 years ago

Hi @bbcrddave , I have created #1366 for tracing my problem.

However, I don't think it only happens at startup, and it occurs for more than one segment. Actually, I suspect that, after the loading of new manifest, the player requests the same segment which has been downloaded. (I will also add this to the new issue.)

davemevans commented 8 years ago

Sorry, you're right - it's when the manifest updates.