Author Topic: basshls only play 30second  (Read 145 times)

terry_zhou82

  • Posts: 64
basshls only play 30second
« on: 8 Jan '21 - 15:40 »
Dear sir
I use the basshls component to play some m3u8,but it can only play 30second and show buffering,
What can I DO?
code:
 Chan:= BASS_HLS_StreamCreateURL(PWideChar(url), BASS_STREAM_BLOCK  or BASS_STREAM_STATUS or BASS_STREAM_AUTOFREE, nil, nil)
 
eg:http://ls.qingting.fm/live/274.m3u8

Ian @ un4seen

  • Administrator
  • Posts: 23288
Re: basshls only play 30second
« Reply #1 on: 8 Jan '21 - 16:28 »
It looks like the requests to the server are sometimes timing-out (HLS streams involve many requests), so the stream ends. The default timeout is 5 seconds. You could try raising that via the BASS_CONFIG_NET_TIMEOUT option.

terry_zhou82

  • Posts: 64
Re: basshls only play 30second
« Reply #2 on: 9 Jan '21 - 04:50 »
Tks,un4seen.
But I means after buffering.....
It's over and never play again,if I put the url into the google chrome(with add-on),it can play and not buffering.
What's the problem ???

terry_zhou82

  • Posts: 64
Re: basshls only play 30second
« Reply #3 on: 9 Jan '21 - 09:51 »
I set the code, but It's only stop.
 BASS_SetConfig(BASS_CONFIG_NET_TIMEOUT,1000000);
  Chan:= BASS_HLS_StreamCreateURL(PWideChar(url), BASS_STREAM_BLOCK  or BASS_STREAM_STATUS or BASS_STREAM_AUTOFREE, nil, nil);

//or the value 100000 is too short?

terry_zhou82

  • Posts: 64
Re: basshls only play 30second
« Reply #4 on: 9 Jan '21 - 12:13 »
I look for the basshls help file and find this code
BASS_SetConfig(BASS_CONFIG_HLS_DELAY, 60000);

I add it before the play code,but it doesn't work either...

terry_zhou82

  • Posts: 64
Re: basshls only play 30second
« Reply #5 on: 11 Jan '21 - 12:36 »
I Found the strange question.In win7,it's working ok.But in win10,it doesn't work.

Ian @ un4seen

  • Administrator
  • Posts: 23288
Re: basshls only play 30second
« Reply #6 on: 11 Jan '21 - 13:39 »
But I means after buffering.....
It's over and never play again,

Yes, the status will be BASS_ACTIVE_STALLED while BASSHLS is waiting for the server to respond, and it will change to BASS_ACTIVE_STOPPED when that fails/times-out.

if I put the url into the google chrome(with add-on),it can play and not buffering.
What's the problem ???

Perhaps Chrome is reconnecting? You can do that with BASS by calling BASS_StreamCreateURL again, eg. after a BASS_SYNC_END sync is triggered.

I tried playing the same URL with VLC and that's ending suddenly too. Looking at the traffic with Wireshark reveals that it seems to be an origin server problem:

Quote
GET /live/274.m3u8 HTTP/1.1
Cookie: __cfduid=ddc92c2ffcf0c75bcc9bd7a9fc4428ae41610371652
User-Agent: BASS/2.4
Host: ls.qingting.fm
Cache-Control: no-cache

HTTP/1.1 520 Origin Error
Date: Mon, 11 Jan 2021 13:29:03 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Cache-Control: no-store, no-cache
CF-Cache-Status: MISS
cf-request-id: 07933bc14b0000078e5fbec000000001
Server: cloudflare
CF-RAY: 60fefbe21e2b078e-LHR

b3
<html>
<head><title>520 Origin Error</title></head>
<body bgcolor="white">
<center><h1>520 Origin Error</h1></center>
<hr><center>cloudflare-nginx</center>
</body>
</html>

Quote
GET /live/274/64k/20210111/21/2509-261-6096.aac HTTP/1.1
Host: ls-jd.qingting.fm
Cookie: __cfduid=d275087ca02e86a43253b061dfba1c91c1610371418
Cache-Control: no-cache
User-Agent: VLC/3.0.6 LibVLC/3.0.6

HTTP/1.1 522 Origin Connection Time-out
Date: Mon, 11 Jan 2021 13:25:51 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Cache-Control: no-store, no-cache
CF-Cache-Status: MISS
cf-request-id: 079338aadd0000bc24a7a7e000000001
Server: cloudflare
CF-RAY: 60fef6f16c92bc24-LHR

cf
<html>
<head><title>522 Origin Connection Time-out</title></head>
<body bgcolor="white">
<center><h1>522 Origin Connection Time-out</h1></center>
<hr><center>cloudflare-nginx</center>
</body>
</html>

terry_zhou82

  • Posts: 64
Re: basshls only play 30second
« Reply #7 on: 12 Jan '21 - 04:09 »
But I means after buffering.....
It's over and never play again,

Yes, the status will be BASS_ACTIVE_STALLED while BASSHLS is waiting for the server to respond, and it will change to BASS_ACTIVE_STOPPED when that fails/times-out.


//Dear,how can I setting and where to the BASS_ACTIVE_STALLED ?

Ian @ un4seen

  • Administrator
  • Posts: 23288
Re: basshls only play 30second
« Reply #8 on: 12 Jan '21 - 14:40 »
BASS_ChannelIsActive will return BASS_ACTIVE_STALLED when playback in stalled. You can also set a BASS_SYNC_STALL sync (via BASS_ChannelSetSync) to be informed when playback stalls/resumes.