Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

live streaming from nginx does not work with latest version #1449

Closed
gbarzilay opened this issue Jun 13, 2016 · 13 comments
Closed

live streaming from nginx does not work with latest version #1449

gbarzilay opened this issue Jun 13, 2016 · 13 comments

Comments

@gbarzilay
Copy link

live streaming from the following mpd doesn't work with dash reference client version 2.1.1
there is no request for segments, just repeated requests for the mpd

the same mpd works with client version 2.0.0



















console log from reference player (no errors)

Debug.js:108[9] [dash.js 2.2.0] MediaPlayer has been initialized
Debug.js:108[24] EME detected on this user agent! (ProtectionModel_21Jan2015)
Debug.js:108[8983] Playback Initialized
Debug.js:108[9009] Parsing complete: ( xml2json: 2.08ms, objectiron: 1.40ms, total: 0.00348s)
Debug.js:108[9010] Manifest has been refreshed at Mon Jun 13 2016 16:33:21 GMT+0300 (Jerusalem Daylight Time)[1465824801.984]
Debug.js:108[9014] SegmentTimeline detected using calculated Live Edge Time
Debug.js:108[9018] MediaSource attached to element. Waiting on open...
Debug.js:108[9025] MediaSource is open!
Debug.js:108[9025] Duration successfully set to: 1.7976931348623157e+308
Debug.js:108[9026] Added 0 inline events
Debug.js:108[9026] No video data.
Debug.js:108[9027] audio codec: audio/mp4;codecs="mp4a.40.2"
Debug.js:108[9038] Schedule controller stopping for audio
Debug.js:108[9046] No text data.
Debug.js:108[9046] No fragmentedText data.
Debug.js:108[9046] No embeddedText data.
Debug.js:108[9046] No muxed data.
Debug.js:108[9048] Start Event Controller
Debug.js:108[9049] Native video element event: play
Debug.js:108[9050] Refresh manifest in 4.999 seconds.

@davemevans
Copy link
Contributor

Is availabilityStartTime the same each time the manifest is refreshed?

@gbarzilay
Copy link
Author

It is not the same every time

From: David Evans [mailto:notifications@github.com]
Sent: Monday, June 13, 2016 6:13 PM
To: Dash-Industry-Forum/dash.js dash.js@noreply.github.com
Cc: Barzilay, Galia Galia.Barzilay@verint.com; Author author@noreply.github.com
Subject: Re: [Dash-Industry-Forum/dash.js] live streaming from nginx does not work with latest version (#1449)

Is availabilityStartTime the same each time the manifest is refreshed?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com//issues/1449#issuecomment-225611220, or mute the threadhttps://github.com/notifications/unsubscribe/AS_MWJzhS4LGkNVS9_L1iHMfD99dGSepks5qLXNigaJpZM4I0bDA.

This electronic message may contain proprietary and confidential
information of Verint Systems Inc., its affiliates and/or subsidiaries.
The information is intended to be for the use of the individual(s) or
entity(ies) named above. If you are not the intended recipient (or
authorized to receive this e-mail for the intended recipient), you may not
use, copy, disclose or distribute to anyone this message or any information
contained in this message. If you have received this electronic message in
error, please notify us by replying to this e-mail.

@davemevans
Copy link
Contributor

I wonder if you are seeing the same as #1202.

@wilaw
Copy link
Member

wilaw commented Jun 13, 2016

Also the following two lines in your manifest are incompatible with one another

timeShiftBufferDepth="PT0H0M0.00S"
suggestedPresentationDelay="PT10S"

You are telling the player that it can only request segments right at the live edge, and at the same time saying it should play back 10s from live. This is impossible. A timeShiftBufferDepth of 0 is never a good idea. I suggest relaxing this to something reasonable like 30s.

Cheers

Will

From: gbarzilay notifications@github.com
Reply-To: "Dash-Industry-Forum/dash.js" reply@reply.github.com
Date: Monday, June 13, 2016 at 8:04 AM
To: "Dash-Industry-Forum/dash.js" dash.js@noreply.github.com
Subject: [Dash-Industry-Forum/dash.js] live streaming from nginx does not work with latest version (#1449)

live streaming from the following mpd doesn't work with dash reference client version 2.1.1
there is no request for segments, just repeated requests for the mpd

the same mpd works with client version 2.0.0

type="dynamic"
xmlns="urn:mpeg💨schema:mpd:2011"
availabilityStartTime="2016-06-13T16:28:48+03:00"
availabilityEndTime="2016-06-13T16:29:18+03:00"
minimumUpdatePeriod="PT5S"
minBufferTime="PT5S"
timeShiftBufferDepth="PT0H0M0.00S"
suggestedPresentationDelay="PT10S"
profiles="urn:hbbtv💨profile:isoff-live:2012,urn:mpeg💨profile:isoff-live:2011"
xmlns:xsi="http://www.w3.org/2011/XMLSchema-instance"
xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd">

id="2"
segmentAlignment="true">
schemeIdUri="urn:mpeg💨23003:3:audio_channel_configuration:2011"
value="1"/>
id="mystream_AAC"
mimeType="audio/mp4"
codecs="mp4a.40.2"
audioSamplingRate="44100"
startWithSAP="1"
bandwidth="93000">
presentationTimeOffset="0"
timescale="1000"
media="mystream-$Time$.m4a"
initialization="mystream-init.m4a">

console log from reference player (no errors)

Debug.js:108[9] [dash.js 2.2.0] MediaPlayer has been initialized
Debug.js:108[24] EME detected on this user agent! (ProtectionModel_21Jan2015)
Debug.js:108[8983] Playback Initialized
Debug.js:108[9009] Parsing complete: ( xml2json: 2.08ms, objectiron: 1.40ms, total: 0.00348s)
Debug.js:108[9010] Manifest has been refreshed at Mon Jun 13 2016 16:33:21 GMT+0300 (Jerusalem Daylight Time)[1465824801.984]

Debug.js:108[9014] SegmentTimeline detected using calculated Live Edge Time
Debug.js:108[9018] MediaSource attached to element. Waiting on open...
Debug.js:108[9025] MediaSource is open!
Debug.js:108[9025] Duration successfully set to: 1.7976931348623157e+308
Debug.js:108[9026] Added 0 inline events
Debug.js:108[9026] No video data.
Debug.js:108[9027] audio codec: audio/mp4;codecs="mp4a.40.2"
Debug.js:108[9038] Schedule controller stopping for audio
Debug.js:108[9046] No text data.
Debug.js:108[9046] No fragmentedText data.
Debug.js:108[9046] No embeddedText data.
Debug.js:108[9046] No muxed data.
Debug.js:108[9048] Start Event Controller
Debug.js:108[9049] Native video element event: play
Debug.js:108[9050] Refresh manifest in 4.999 seconds.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_Dash-2DIndustry-2DForum_dash.js_issues_1449&d=DQMFaQ&c=96ZbZZcaMF4w0F4jpN6LZg&r=KkevKJerDHRF9WRs8nW8Ew&m=edllh-LnMzec6Yri4YTLWkm3G8hT03l0pW9iqzJM3pI&s=7Z2usBXsJM0RvsSJQZDZ2A97P5_uDdbKUVV3J9XwoPU&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe_AComCq2ur-2DvWFFLI2ratwAJsk4lce0CWks5qLXGQgaJpZM4I0bDA&d=DQMFaQ&c=96ZbZZcaMF4w0F4jpN6LZg&r=KkevKJerDHRF9WRs8nW8Ew&m=edllh-LnMzec6Yri4YTLWkm3G8hT03l0pW9iqzJM3pI&s=F7fbK4V4SO3J90yrMmbFDi1Tt_ysrsNzcHMBnEnmBMo&e=.

@gbarzilay
Copy link
Author

I think it is a different problem because with my mpd there are no requests for segments at all. And in the linked cases it is looping on the first seconds.
Also, the same mpd worked in previous version

From: David Evans [mailto:notifications@github.com]
Sent: Monday, June 13, 2016 6:29 PM
To: Dash-Industry-Forum/dash.js dash.js@noreply.github.com
Cc: Barzilay, Galia Galia.Barzilay@verint.com; Author author@noreply.github.com
Subject: Re: [Dash-Industry-Forum/dash.js] live streaming from nginx does not work with latest version (#1449)

I wonder if you are seeing the same as #1202#1202.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com//issues/1449#issuecomment-225616450, or mute the threadhttps://github.com/notifications/unsubscribe/AS_MWDoMfDFbCM8LbhnG3LjWhM31HruKks5qLXdRgaJpZM4I0bDA.

This electronic message may contain proprietary and confidential
information of Verint Systems Inc., its affiliates and/or subsidiaries.
The information is intended to be for the use of the individual(s) or
entity(ies) named above. If you are not the intended recipient (or
authorized to receive this e-mail for the intended recipient), you may not
use, copy, disclose or distribute to anyone this message or any information
contained in this message. If you have received this electronic message in
error, please notify us by replying to this e-mail.

@davemevans
Copy link
Contributor

I think it is a different problem because with my mpd there are no requests for segments at all. And in the linked cases it is looping on the first seconds.
Also, the same mpd worked in previous version

Perhaps, but there's common illegal (according to the MPEG-DASH specification) behaviour between your issue and that. The player will not work properly while availabilityStartTime is changing. You should also follow @wilaw's advice, at least until you can get the stream working, at which point you may be able to tweak those values closer to what you intended.

@gbarzilay
Copy link
Author

Thanks for the quick responses!
I will try to make the changes you suggested, and will update if it helps

From: David Evans [mailto:notifications@github.com]
Sent: Monday, June 13, 2016 7:08 PM
To: Dash-Industry-Forum/dash.js dash.js@noreply.github.com
Cc: Barzilay, Galia Galia.Barzilay@verint.com; Author author@noreply.github.com
Subject: Re: [Dash-Industry-Forum/dash.js] live streaming from nginx does not work with latest version (#1449)

I think it is a different problem because with my mpd there are no requests for segments at all. And in the linked cases it is looping on the first seconds.
Also, the same mpd worked in previous version

Perhaps, but there's common illegal (according to the MPEG-DASH specification) behaviour between your issue and that. The player will not work properly while availabilityStartTime is changing. You should also follow @wilawhttps://github.com/wilaw's advice, at least until you can get the stream working, at which point you may be able to tweak those values closer to what you intended.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com//issues/1449#issuecomment-225628188, or mute the threadhttps://github.com/notifications/unsubscribe/AS_MWDmd3oV6MhGrOdLmkcPpC3L6SZrGks5qLYBDgaJpZM4I0bDA.

This electronic message may contain proprietary and confidential
information of Verint Systems Inc., its affiliates and/or subsidiaries.
The information is intended to be for the use of the individual(s) or
entity(ies) named above. If you are not the intended recipient (or
authorized to receive this e-mail for the intended recipient), you may not
use, copy, disclose or distribute to anyone this message or any information
contained in this message. If you have received this electronic message in
error, please notify us by replying to this e-mail.

@gbarzilay
Copy link
Author

Hi,
I made the changes you suggested (set timeShiftBufferDepth to 30 seconds and changed availabilityStartTime to be constant)
dash client of 2.1.1 is still not working - no request for segment
but the reference client of the nightly build does work
any thoughts why it doesn't work in 2.1.1? do you know of a related known issue that was fixed?
it did work even before my changes in version 2.0..
thanks again.
Galia.

@davemevans
Copy link
Contributor

Your manifest has been mangled when it was pasted into the comment. Please can you either attach it as a test file or use triple backquotes ``` around it when you paste the text.

@gbarzilay
Copy link
Author

<?xml version="1.0"?>
<MPD
    type="dynamic"
    xmlns="urn:mpeg:dash:schema:mpd:2011"
    availabilityStartTime="2016-06-15T12:58:05+03:00"
    availabilityEndTime="2016-06-15T13:54:05+03:00"
    minimumUpdatePeriod="PT5S"
    minBufferTime="PT5S"
    timeShiftBufferDepth="PT0H0M30.00S"
    suggestedPresentationDelay="PT10S"
    profiles="urn:hbbtv:dash:profile:isoff-live:2012,urn:mpeg:dash:profile:isoff-live:2011"
    xmlns:xsi="http://www.w3.org/2011/XMLSchema-instance"
    xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd">
  <Period start="PT0S" id="dash">
    <AdaptationSet
        id="2"
        segmentAlignment="true">
      <AudioChannelConfiguration
          schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011"
          value="1"/>
      <Representation
          id="mystream_AAC"
          mimeType="audio/mp4"
          codecs="mp4a.40.2"
          audioSamplingRate="44100"
          startWithSAP="1"
          bandwidth="93000">
        <SegmentTemplate
            presentationTimeOffset="0"
            timescale="1000"
            media="mystream-$Time$.m4a"
            initialization="mystream-init.m4a">
          <SegmentTimeline>
             <S t="3330298" d="5016"/>
             <S t="3335314" d="5015"/>
             <S t="3340329" d="5016"/>
             <S t="3345345" d="5015"/>
             <S t="3350360" d="5016"/>
             <S t="3355376" d="5015"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
    </AdaptationSet>
  </Period>
</MPD>

@LloydW93
Copy link
Member

I've managed to reproduce this issue with 2.1.1 and nightly. Whilst I do get some playback with 2.0.0, I would not that my test stream is playing one segment or so then looping.

nginx.conf:

rtmp {

    server {

        listen 1935;

        chunk_size 4000;

        application dash {
            live on;
            dash on;
            dash_path /tmp/dash;
            dash_nested on;
        }
    }
}

http {

    server {

        listen      80;

        location /dash {
            # Serve DASH fragments
            root /tmp;
            add_header Cache-Control no-cache;
            add_header 'Access-Control-Allow-Origin' '*';
        }
    }
}

ffmpeg:

ffmpeg -stream_loop -1 -i bbbpv13.mp4 -fflags +genpts -c:a aac -c:v libx264 -r 50 -keyint_min 125 -g 125 -bf 24 -f flv rtmp://host:1935/dash/1

Where the source file was transcoded as

ffmpeg -y -i bbb_sunflower_1080p_60fps_normal.mp4 -strict -2
    -c:a aac -b:a 96k -ac 2
    -c:v libx264 -b:v 2812k -maxrate 3656k -vf scale=960:540 -profile:v main -level 3.1 -refs 4 -bf 7 -bufsize 1024k -g 96 -keyint_min 96 -r 50 -pass 1 -passlogfile bbbpv13 -f mp4 NUL


ffmpeg -y -i bbb_sunflower_1080p_60fps_normal.mp4 -strict -2
    -c:a aac -b:a 96k -ac 2
    -c:v libx264 -b:v 2812k -maxrate 3656k -vf scale=960:540 -profile:v main -level 3.1 -refs 4 -bf 7 -bufsize 1024k -g 96 -keyint_min 96 -r 50 -pass 2 -passlogfile bbbpv13 bbbpv13.mp4

These aren't particularly optimal encodes for what I'm trying to do but I'd be interested in knowing exactly what you are running.

@LloydW93
Copy link
Member

LloydW93 commented Jul 4, 2016

sergey-dryabzhinsky/nginx-rtmp-module#138

It looks like the fork we recommend started varying its AST. I'll retry with this branch.

@LloydW93
Copy link
Member

LloydW93 commented Jul 4, 2016

So, works for me on Ubuntu with:

git clone git@github.com:sergey-dryabzhinsky/nginx-rtmp-module.git
cd nginx-rtmp-module
git checkout fix-121-dash-availabilityEndTime
git cherry-pick 965523f3970e449e3abbaa6c9b0db1ce251f2b68
cd ../nginx-1.11.1
./configure --add-module=/home/lpw/nginx-rtmp-module
make -j4
sudo make install
sudo /usr/local/nginx/sbin/nginx

I also added the dash_playlist_length 10m; as I think the default is a little short. Closing as this is not a dash.js bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants