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

gpac convert ll-hls latency is big in safari #2049

Open
fastfading opened this issue Jan 17, 2022 · 10 comments
Open

gpac convert ll-hls latency is big in safari #2049

fastfading opened this issue Jan 17, 2022 · 10 comments

Comments

@fastfading
Copy link

Thanks for reporting your issue. Please make sure these boxes are checked before submitting your issue - thank you!

Detailed guidelines: http:https://gpac.io/2013/07/16/how-to-file-a-bug-properly/

I convert a rtmp stream to ll-hls . then stream it with apache httpd .
./gpac -i 'rtmp:https://:1935/live/abc:gpac:rtmp_listen=1' -o live.m3u8:gpac:segdur=6:cdur=1:profile=live:dmode=dynamic:rdirs=outdir:llhls=sf:hlsc=true
GOP is 150 , fps is 25, generate segment each 6s. and generate small segment each 1s
it plays well in https://www.theoplayer.com/ll-hls-test-page and https://hls-js.netlify.app/demo/ latency is about 5s
but when it plays in safari , its latency is very big. more than 18s.

I wonder why is that, is something missing?

@jeanlf
Copy link
Member

jeanlf commented Jan 17, 2022

It looks as if safari ignores the LL setup in this case (latency > 18sec which is 3 full segments in your setup)

No clue why, could you have a look at the http server logs to check requests: does safari tunes on edge, are the request delayed , ...

@fastfading
Copy link
Author

fastfading commented Jan 18, 2022

no, the request is not delayed
the PART-HOLD-BACK is 3s , but it does not work on safari.
safari start playback from the first ts in the m3u8 file.
I tested the apple official tool, https://developer.apple.com/documentation/http_live_streaming/about_apple_s_http_live_streaming_tools
http/2 server, the same result.
Is there something missing?

@fastfading
Copy link
Author

https://ll-hls-test.apple.com/llhls1/multi.m3u8
the apple official test url work well.
But this link did not work from yesterday.

@jeanlf
Copy link
Member

jeanlf commented Jan 21, 2022

I added EXT-X-PRELOAD-HINT and EXT-X-RENDITION-REPORT, can you check if that helps ?

Also did you try with mp4 instead of ts ?

@fastfading
Copy link
Author

fastfading commented Jan 24, 2022 via email

@fastfading
Copy link
Author

image
gpac - GPAC command line filter engine - version 1.1.0-DEV-rev1659-g7d3281e88-master
this new version did not work as LL hls in safari.

my cmd is :
./gpac -i 'rtmp:https://:1935/live/abc:gpac:rtmp_listen=1' -o live.m3u8:gpac:segdur=6:cdur=1:profile=live:dmode=dynamic:rdirs=outdir:llhls=sf:hlsc=true

I use golang fileserver to stream the m4s and m3u8

package main

import (
	"fmt"
	"net/http"
)

func cors(fs http.Handler) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		// do your cors stuff
		// return if you do not want the FileServer handle a specific request
		header := w.Header()
		header.Set("Access-Control-Allow-Origin", "*")
		header.Set("Access-Control-Allow-Methods", "*")
		header.Set("Access-Control-Allow-Headers", "*")

		fs.ServeHTTP(w, r)
	}
}

func main() {
	fs := http.FileServer(http.Dir("./"))
	http.Handle("/", cors(fs))
	// err := http.ListenAndServe(":9091",nil)
	err := http.ListenAndServeTLS(":9443", "./server.pem", "./server.pem", nil)
	if err != nil {
		fmt.Println("Failed to start server", err)
		return
	}
}

@JuanMorenoS
Copy link

JuanMorenoS commented Jul 4, 2023

@jeanlf Any update?
We have the same issue with the latest version of gpac 2.3-DEV

@rbouqueau
Copy link
Member

Is this issue still relevant?

@jeanlf
Copy link
Member

jeanlf commented Dec 13, 2023

I've tried pretty much everything (using h/2, injecting program-date-time, gzip support for playlist) but on my machine the result is always the same: safari loads 30s of content then accesses the live edge through LL parts, as expected.

If any of you has a test source of LL-HLS with working PART-HOLD-BACK working, let us know - I begin to suspect this is not properly handled in safari

@rbouqueau
Copy link
Member

Does anyone has access to a LL-HLS stream with PART-HOLD-BACK that works properly with Safari?

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