HydrogenAudio

Hydrogenaudio Forum => General Audio => Topic started by: stigc on 2018-07-11 20:38:01

Title: MPEG transport stream
Post by: stigc on 2018-07-11 20:38:01
I am trying to download MPEG transport stream audio-only with AAC(adtc) from Java. But when I start reading the stream it ends after 106 KB. This also happens if i paste the URL in a browser, why is that? VLC plays it fine.

I have attached what gets downloaded when loading this Danish radio station

http://drradio2-lh.akamaihd.net/i/p2_9@143504/index_64_a-p.m3u8?sd=10&rebase=on

It seems like it contains a lot of segments, but it would be very cumbersome to stream them one by one.
Title: Re: MPEG transport stream
Post by: stigc on 2018-07-11 21:34:47
Wow this apparently how VLC reads it, this it from the VLC log :

adaptive debug: Updated playlist ID http://drradio1-lh.akamaihd.net/i/p1_9@143503/index_256_a-p.m3u8?sd=10&rebase=on, next update in 19s
adaptive debug: Representation http://drradio1-lh.akamaihd.net/i/p1_9@143503/index_256_a-p.m3u8?sd=10&rebase=on
adaptive debug: Segment #153134095 url=http://drradio1-lh.akamaihd.net/i/p1_9@143503/segment153134094_256_a-p.ts?sd=10&rebase=on stime 197000 duration 1000
adaptive debug: Segment #153134096 url=http://drradio1-lh.akamaihd.net/i/p1_9@143503/segment153134095_256_a-p.ts?sd=10&rebase=on stime 198000 duration 1000
adaptive debug: Segment #153134097 url=http://drradio1-lh.akamaihd.net/i/p1_9@143503/segment153134096_256_a-p.ts?sd=10&rebase=on stime 199000 duration 1000
adaptive debug: Segment #153134098 url=http://drradio1-lh.akamaihd.net/i/p1_9@143503/segment153134097_256_a-p.ts?sd=10&rebase=on stime 200000 duration 1000
adaptive debug: Retrieving http://drradio1-lh.akamaihd.net:80/i/p1_9@143503/segment153134095_256_a-p.ts?sd=10&rebase=on @0
adaptive debug: Retrieving http://drradio1-lh.akamaihd.net:80/i/p1_9@143503/segment153134096_256_a-p.ts?sd=10&rebase=on @0
adaptive debug: Retrieving http://drradio1-lh.akamaihd.net:80/i/p1_9@143503/index_256_a-p.m3u8?sd=10&rebase=on @0
adaptive debug: Updated playlist ID http://drradio1-lh.akamaihd.net/i/p1_9@143503/index_256_a-p.m3u8?sd=10&rebase=on, next update in 19s
adaptive debug: Representation http://drradio1-lh.akamaihd.net/i/p1_9@143503/index_256_a-p.m3u8?sd=10&rebase=on
adaptive debug: Segment #153134097 url=http://drradio1-lh.akamaihd.net/i/p1_9@143503/segment153134096_256_a-p.ts?sd=10&rebase=on stime 199000 duration 1000
adaptive debug: Segment #153134098 url=http://drradio1-lh.akamaihd.net/i/p1_9@143503/segment153134097_256_a-p.ts?sd=10&rebase=on stime 200000 duration 1000
adaptive debug: Segment #153134099 url=http://drradio1-lh.akamaihd.net/i/p1_9@143503/segment153134098_256_a-p.ts?sd=10&rebase=on stime 201000 duration 1000
adaptive debug: Segment #153134100 url=http://drradio1-lh.akamaihd.net/i/p1_9@143503/segment153134099_256_a-p.ts?sd=10&rebase=on stime 202000 duration 1000

It loads the m3u8 file and then load each segments one by one. When the end is reached it reload the m3u8 file again.

What protocol is this? I guess this has nothing to do with the MPEG transport stream protocol?
Title: Re: MPEG transport stream
Post by: LithosZA on 2018-07-12 10:31:28
https://en.wikipedia.org/wiki/HTTP_Live_Streaming
Title: Re: MPEG transport stream
Post by: magicgoose on 2018-07-12 10:43:17
whenever you see .m3u8, it's HLS — the link above, that is.

> It seems like it contains a lot of segments, but it would be very cumbersome to stream them one by one.

IIRC, you can just concatenate them and put straight into a decoder.
Title: Re: MPEG transport stream
Post by: stigc on 2018-07-16 13:08:14
Thanks HLS it is.