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

CMAF LL-HLS Playlist correct LoadControl values for smooth playback #929

Closed
dnetcrawler opened this issue Dec 28, 2023 · 6 comments
Closed

Comments

@dnetcrawler
Copy link

dnetcrawler commented Dec 28, 2023

We are having problems determining the correct settings for our live feed to play smoothly. Our goal is to keep latency around 3 seconds. We are able to achieve this in HLS.JS, SHAKA, THEO player, etc, but have been unable to get the correct values to play smoothly in Media3.

These are the best values we have tested so far, but video still not 100% smooth:
minBufferMs: 3000,
maxBufferMs: 3000,
bufferForPlaybackMs: 500,
bufferForPlaybackAfterRebufferMs: 500

We have tried multiple variations, but were wondering if there was a more efficient formula we should be using instead for trial and error. Here is the manifest for our streams:

#EXTM3U
#EXT-X-VERSION:7
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:9681
#EXT-X-DISCONTINUITY-SEQUENCE:3
#EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES,PART-HOLD-BACK=3
#EXT-X-PART-INF:PART-TARGET=1
#EXT-X-KEY:METHOD=SAMPLE-AES,URI="skd://5OVYF3YxCPFAfWgczArSzg==",KEYFORMAT="com.apple.streamingkeydelivery",KEYFORMATVERSIONS="1"
#EXT-X-KEY:METHOD=SAMPLE-AES,KEYID=0xe4e55817-7631-08f1-407d-681ccc0ad2ce,URI="data:text/plain;base64,AAAAbHBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAEwIARIQ5OVYF3YxCPFAfWgczArSzhoMaW5rYWVudHdvcmtzIiQ2YTU1OTNmNi03OTNkLTExZWUtOGFjMi0wNDAxOTk5MjkwMDEqAkhE",KEYFORMAT="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",KEYFORMATVERSIONS="1",IV=0x7a6369346d7630307735766a39336368
#EXT-X-PROGRAM-DATE-TIME:2023-12-22T18:57:07.003Z
#EXT-X-MAP:URI="video_1.fmp4"
#EXTINF:6,
v_66_43356000_9681.fmp4
#EXT-X-PART:DURATION=1,URI="v_66_43362000_9682_0.fmp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=1,URI="v_66_43362000_9682_1.fmp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=1,URI="v_66_43362000_9682_2.fmp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=1,URI="v_66_43362000_9682_3.fmp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=1,URI="v_66_43362000_9682_4.fmp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=1,URI="v_66_43362000_9682_5.fmp4",INDEPENDENT=YES
#EXT-X-PROGRAM-DATE-TIME:2023-12-22T18:57:13.003Z
#EXTINF:6,
v_66_43362000_9682.fmp4
#EXT-X-PART:DURATION=1,URI="v_66_43368000_9683_0.fmp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=1,URI="v_66_43368000_9683_1.fmp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=1,URI="v_66_43368000_9683_2.fmp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=1,URI="v_66_43368000_9683_3.fmp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=1,URI="v_66_43368000_9683_4.fmp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=1,URI="v_66_43368000_9683_5.fmp4",INDEPENDENT=YES
#EXT-X-PROGRAM-DATE-TIME:2023-12-22T18:57:19.003Z
#EXTINF:6,
v_66_43368000_9683.fmp4
#EXT-X-PART:DURATION=1,URI="v_66_43374000_9684_0.fmp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=1,URI="v_66_43374000_9684_1.fmp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=1,URI="v_66_43374000_9684_2.fmp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=1,URI="v_66_43374000_9684_3.fmp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=1,URI="v_66_43374000_9684_4.fmp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=1,URI="v_66_43374000_9684_5.fmp4",INDEPENDENT=YES
#EXT-X-PROGRAM-DATE-TIME:2023-12-22T18:57:25.003Z
#EXTINF:6,
v_66_43374000_9684.fmp4
#EXT-X-PRELOAD-HINT:TYPE=PART,URI="v_66_43380000_9685_0.fmp4"
@marcbaechinger
Copy link
Contributor

I understand these values are from DefaultLoadControl. Looks like you are having a low-latency stream with preload parts, so I think this should be supported by ExoPlayer.

Have you looked at the Developer Guide page around configuring adaptive live streams? In case this is not helpful let me know so we can dive a bit deeper.

@dnetcrawler
Copy link
Author

Hi Team,

Thanks for sending the link to the documentation for adaptive live streams. It's not very clear which parameters the player is taking into consideration. These are the parameters being passed in the manifest, for the player to consider

EXT-X-DISCONTINUITY-SEQUENCE:3
EXT-X-PART-INF:PART-TARGET=1
EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES,PART-HOLD-BACK=3
EXT-X-PROGRAM-DATE-TIME:2023-12-22T18:57:07.003Z

Even though these are being passed correctly, we see 2 conditions. First condition is the player is not playing at 1x rate. This causes the player to drift dramatically from the time on these parts. Second, the issue of stalling explained on post.

We are developing in react-native-video, so the options we can pass are limited.

@marcbaechinger marcbaechinger changed the title CMAF LL-HLS Playlist correct LoadControl values for smooth streaming CMAF LL-HLS Playlist correct LoadControl values for smooth playback Jan 3, 2024
@marcbaechinger
Copy link
Contributor

You'd need to tell us in a bit more detail what you did after reading the docs.

is the player is not playing at 1x rate.

What happens if you start with keeping the playback rate to 1x as explained in the docs? Do you still see ExoPlayer change the playback speed?

the issue of stalling explained on post.

I've read the initial post again I don't really see that you have described what is going wrong. To make your report actionable for us, you should describe what APIs you call with what intention. Then describe what happens instead of what is expected, the best way is to provide a bug report or some logcat output after having EventLogger added to your player.

@google-oss-bot
Copy link
Collaborator

Hey @dnetcrawler. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@dnetcrawler
Copy link
Author

@ marcbaechinger

We were working on getting the requested output. This is what we see on logcat:

ExoPlayer Warning tv.fispy.media W Free memory reached 0, forcing garbage collection tv.fispy.media tv.fispy.media I Waiting for a blocking GC Explicit tv.fispy.media tv.fispy.media I WaitForGcToComplete blocked Explicit on Background for 28.309ms tv.fispy.media tv.fispy.media I Explicit concurrent copying GC freed 19237(1783KB) AllocSpace objects, 10(3280KB) LOS objects, 44% free, 30MB/54MB, paused 487us,131us total 255.161ms tv.fispy.media tv.fispy.media I Background concurrent copying GC freed 87830(10171KB) AllocSpace objects, 76(18MB) LOS objects, 43% free, 31MB/55MB, paused 250us,130us total 201.757ms BufferPoolAccessor2.0 tv.fispy.media D bufferpool2 0xb4000074a9279a28 : 5(36700160 size) total buffers - 1(7340032 size) used buffers - 1110/1116 (recycle/alloc) - 6/1138 (fetch/transfer)

This is running on a Galaxy A14 with 4Gig of memory. System states it has 1.2Gig of Memory available.

@dnetcrawler
Copy link
Author

This seem to be related to an open issue, not related to the player:
TheWidlarzGroup/react-native-video#2984

Will close issue.

@androidx androidx locked and limited conversation to collaborators Mar 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants