Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

@takusemba https://github.com/TakuSemba

Slide 3

Slide 3 text

Media Streaming

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

Streaming Protocol

Slide 10

Slide 10 text

Streaming Protocol

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

...

Slide 22

Slide 22 text

Adaptive Bitrate

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

10s ~

Slide 33

Slide 33 text

~ 25s

Slide 34

Slide 34 text

val trackSelectionFactory = AdaptiveTrackSelection.Factory( MIN_DURATION_FOR_QUALITY_INCREASE_MS, MAX_DURATION_FOR_QUALITY_DECREASE_MS, ... )

Slide 35

Slide 35 text

val trackSelectionFactory = AdaptiveTrackSelection.Factory( MIN_DURATION_FOR_QUALITY_INCREASE_MS, MAX_DURATION_FOR_QUALITY_DECREASE_MS, ... ) AdaptiveTrackSelection.Factory( MIN_DURATION_FOR_QUALITY_INCREASE_MS, )

Slide 36

Slide 36 text

val trackSelectionFactory = AdaptiveTrackSelection.Factory( MIN_DURATION_FOR_QUALITY_INCREASE_MS, MAX_DURATION_FOR_QUALITY_DECREASE_MS, ... ) AdaptiveTrackSelection.Factory( MAX_DURATION_FOR_QUALITY_DECREASE_MS, )

Slide 37

Slide 37 text

val trackSelectionFactory = AdaptiveTrackSelection.Factory( MIN_DURATION_FOR_QUALITY_INCREASE_MS, MAX_DURATION_FOR_QUALITY_DECREASE_MS, BUFFERED_FRACTION_TO_LIVE_EDGE_FOR_QUALITY_INCREASE, ... ) AdaptiveTrackSelection.Factory( BUFFERED_FRACTION_TO_LIVE_EDGE_FOR_QUALITY_INCREASE,

Slide 38

Slide 38 text

val trackSelectionFactory = AdaptiveTrackSelection.Factory( MIN_DURATION_FOR_QUALITY_INCREASE_MS, MAX_DURATION_FOR_QUALITY_DECREASE_MS, BUFFERED_FRACTION_TO_LIVE_EDGE_FOR_QUALITY_INCREASE, ... ) AdaptiveTrackSelection.Factory( BUFFERED_FRACTION_TO_LIVE_EDGE_FOR_QUALITY_INCREASE, Edge Current Position Buffered Position 0.75

Slide 39

Slide 39 text

val bandwidthMeter = DefaultBandwidthMeter.Builder(context).build()

Slide 40

Slide 40 text

Bandwidth Time 10Mbps

Slide 41

Slide 41 text

Bandwidth Time 10Mbps

Slide 42

Slide 42 text

Bandwidth Time 10Mbps

Slide 43

Slide 43 text

Bandwidth Time 10Mbps

Slide 44

Slide 44 text

Bandwidth Time 10Mbps

Slide 45

Slide 45 text

Bandwidth Time 10Mbps

Slide 46

Slide 46 text

Bandwidth Time 10Mbps

Slide 47

Slide 47 text

Bandwidth Time 10Mbps

Slide 48

Slide 48 text

Bandwidth Time 10Mbps

Slide 49

Slide 49 text

Bandwidth Time 10Mbps

Slide 50

Slide 50 text

Bandwidth Time 10Mbps 6Mbps

Slide 51

Slide 51 text

Bandwidth Time 10Mbps 6Mbps SlidingWindowMaxWeight

Slide 52

Slide 52 text

Time 6Mbps SlidingWindowMaxWeight

Slide 53

Slide 53 text

Time SlidingWindowMaxWeight 6Mbps * 0.75 = 4.5Mbps

Slide 54

Slide 54 text

Time 6Mbps * 0.75 = 4.5Mbps SlidingWindowMaxWeight BandwidthFraction

Slide 55

Slide 55 text

val trackSelectionFactory = AdaptiveTrackSelection.Factory( MIN_DURATION_FOR_QUALITY_INCREASE_MS, MAX_DURATION_FOR_QUALITY_DECREASE_MS, BANDWIDTH_FRACTION ... ) val bandwidthMeter = DefaultBandwidthMeter.Builder(context) .setSlidingWindowMaxWeight(SLIDING_WINDOW_MAX_WEIGHT) .build()

Slide 56

Slide 56 text

val trackSelectionFactory = AdaptiveTrackSelection.Factory( MIN_DURATION_FOR_QUALITY_INCREASE_MS, MAX_DURATION_FOR_QUALITY_DECREASE_MS, BANDWIDTH_FRACTION ... ) AdaptiveTrackSelection.Factory( BANDWIDTH_FRACTION val bandwidthMeter = DefaultBandwidthMeter.Builder(context) .setSlidingWindowMaxWeight(SLIDING_WINDOW_MAX_WEIGHT) .build()

Slide 57

Slide 57 text

val trackSelectionFactory = AdaptiveTrackSelection.Factory( MIN_DURATION_FOR_QUALITY_INCREASE_MS, MAX_DURATION_FOR_QUALITY_DECREASE_MS, BANDWIDTH_FRACTION ... ) val bandwidthMeter = DefaultBandwidthMeter.Builder(context) .setSlidingWindowMaxWeight(SLIDING_WINDOW_MAX_WEIGHT) .build() .setSlidingWindowMaxWeight(SLIDING_WINDOW_MAX_WEIGHT)

Slide 58

Slide 58 text

Initial Bitrate

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

???

Slide 61

Slide 61 text

5.7Mbps Wifi

Slide 62

Slide 62 text

5.7Mbps Wifi

Slide 63

Slide 63 text

2.2Mbps 3G

Slide 64

Slide 64 text

2.2Mbps 3G

Slide 65

Slide 65 text

2.0Mbps Wifi

Slide 66

Slide 66 text

2.0Mbps Wifi

Slide 67

Slide 67 text

5.7Mbps Wifi

Slide 68

Slide 68 text

5.7Mbps Wifi

Slide 69

Slide 69 text

val bandwidthMeter = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(INITIAL_BITRATE_ESTIMATE) .build()

Slide 70

Slide 70 text

val bandwidthMeter = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(INITIAL_BITRATE_ESTIMATE) .build() .setInitialBitrateEstimate(INITIAL_BITRATE_ESTIMATE)

Slide 71

Slide 71 text

val bandwidthMeter = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(LOWEST_RESOLUTION_BITRATE) .build() 180p 360p 720p Session Scope

Slide 72

Slide 72 text

Session Scope 720p val bandwidthMeter = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(LOWEST_RESOLUTION_BITRATE) .build()

Slide 73

Slide 73 text

Session Scope 180p 360p 720p val bandwidthMeter = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(LOWEST_RESOLUTION_BITRATE) .build() 720p

Slide 74

Slide 74 text

Session Scope val bandwidthMeter = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(LOWEST_RESOLUTION_BITRATE) .build() 180p 360p 720p

Slide 75

Slide 75 text

Session Scope val bandwidthMeter = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(LOWEST_RESOLUTION_BITRATE) .build() 720p

Slide 76

Slide 76 text

Session Scope val bandwidthMeter = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(LOWEST_RESOLUTION_BITRATE) .build() 180p 360p 720p 720p

Slide 77

Slide 77 text

fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(LOWEST_RESOLUTION_BITRATE) .build() } return singletonInstance } Application Scope 180p 360p 720p

Slide 78

Slide 78 text

Application Scope 720p fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(LOWEST_RESOLUTION_BITRATE) .build() } return singletonInstance }

Slide 79

Slide 79 text

Application Scope 720p 720p 720p fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(LOWEST_RESOLUTION_BITRATE) .build() } return singletonInstance } 720p

Slide 80

Slide 80 text

Application Scope fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(LOWEST_RESOLUTION_BITRATE) .build() } return singletonInstance } 720p 720p 720p

Slide 81

Slide 81 text

Application Scope fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(LOWEST_RESOLUTION_BITRATE) .build() } return singletonInstance } 720p Launch App

Slide 82

Slide 82 text

Application Scope Launch App fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(LOWEST_RESOLUTION_BITRATE) .build() } return singletonInstance } 720p 180p 360p 720p

Slide 83

Slide 83 text

Application Scope fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(LOWEST_RESOLUTION_BITRATE) .build() } return singletonInstance } 180p 360p 720p

Slide 84

Slide 84 text

Application Scope fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(LOWEST_RESOLUTION_BITRATE) .build() } return singletonInstance } 720p

Slide 85

Slide 85 text

Application Scope Wifi -> 4G fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(LOWEST_RESOLUTION_BITRATE) .build() } return singletonInstance } 720p 720p

Slide 86

Slide 86 text

Application Scope fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(LOWEST_RESOLUTION_BITRATE) .setResetOnNetworkTypeChange(true) .build() } return singletonInstance } 720p 720p Wifi -> 4G

Slide 87

Slide 87 text

Application Scope fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(LOWEST_RESOLUTION_BITRATE) .setResetOnNetworkTypeChange(true) .build() } return singletonInstance } 720p Wifi -> 4G .setResetOnNetworkTypeChange(true) 720p

Slide 88

Slide 88 text

Application Scope Wifi -> 4G 720p 180p 360p fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(LOWEST_RESOLUTION_BITRATE) .setResetOnNetworkTypeChange(true) .build() } return singletonInstance } 720p

Slide 89

Slide 89 text

Lifetime Scope 180p 360p 720p fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(prefs.getLastEstimatedBitrate()) .setResetOnNetworkTypeChange(true) .build() } return singletonInstance }

Slide 90

Slide 90 text

Lifetime Scope fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(prefs.getLastEstimatedBitrate()) .setResetOnNetworkTypeChange(true) .build() } return singletonInstance } .setInitialBitrateEstimate(prefs.getLastEstimatedBitrate()) 180p 360p 720p

Slide 91

Slide 91 text

Lifetime Scope fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(prefs.getLastEstimatedBitrate()) .setResetOnNetworkTypeChange(true) .build() } return singletonInstance } .setResetOnNetworkTypeChange(true) 180p 360p 720p

Slide 92

Slide 92 text

Lifetime Scope fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(prefs.getLastEstimatedBitrate()) .setResetOnNetworkTypeChange(true) .build() } return singletonInstance } 180p 360p 720p

Slide 93

Slide 93 text

Lifetime Scope fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(prefs.getLastEstimatedBitrate()) .setResetOnNetworkTypeChange(true) .build() } return singletonInstance } 720p

Slide 94

Slide 94 text

720p 720p 720p Lifetime Scope fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(prefs.getLastEstimatedBitrate()) .setResetOnNetworkTypeChange(true) .build() } return singletonInstance } 720p

Slide 95

Slide 95 text

Lifetime Scope fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(prefs.getLastEstimatedBitrate()) .setResetOnNetworkTypeChange(true) .build() } return singletonInstance } 720p 720p 720p

Slide 96

Slide 96 text

Lifetime Scope fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(prefs.getLastEstimatedBitrate()) .setResetOnNetworkTypeChange(true) .build() } return singletonInstance } 720p Launch App

Slide 97

Slide 97 text

Launch App Lifetime Scope fun getSingletonBandwidthMeter(context: Context): DefaultBandwidthMeter { if (singletonInstance == null) { singletonInstance = DefaultBandwidthMeter.Builder(context) .setInitialBitrateEstimate(prefs.getLastEstimatedBitrate()) .setResetOnNetworkTypeChange(true) .build() } return singletonInstance } 720p 720p 720p 720p

Slide 98

Slide 98 text

Limit Bitrate

Slide 99

Slide 99 text

No content

Slide 100

Slide 100 text

No content

Slide 101

Slide 101 text

val trackSelectionFactory = AdaptiveTrackSelection.Factory(...) val parameter = DefaultTrackSelector.ParametersBuilder(context) .setMaxVideoBitrate(MAX_VIDEO_BITRARE) .build() val trackSelector = DefaultTrackSelector(parameter, trackSelectionFactory)

Slide 102

Slide 102 text

val trackSelectionFactory = AdaptiveTrackSelection.Factory(...) val parameter = DefaultTrackSelector.ParametersBuilder(context) .setMaxVideoBitrate(MAX_VIDEO_BITRARE) .build() val trackSelector = DefaultTrackSelector(parameter, trackSelectionFactory) .setMaxVideoBitrate(MAX_VIDEO_BITRARE)

Slide 103

Slide 103 text

val trackSelectionFactory = AdaptiveTrackSelection.Factory(...) val parameter = DefaultTrackSelector.ParametersBuilder(context) .setMaxVideoSize(640, 360) .build() val trackSelector = DefaultTrackSelector(parameter, trackSelectionFactory)

Slide 104

Slide 104 text

val trackSelectionFactory = AdaptiveTrackSelection.Factory(...) val parameter = DefaultTrackSelector.ParametersBuilder(context) .setMaxVideoSize(640, 360) .build() val trackSelector = DefaultTrackSelector(parameter, trackSelectionFactory) .setMaxVideoSize(640, 360)

Slide 105

Slide 105 text

No content

Slide 106

Slide 106 text

val newParameter = DefaultTrackSelector.ParametersBuilder(context) .setMaxVideoBitrate(NEW_MAX_VIDEO_BITRARE) .build() trackSelector.parameters = newParameter

Slide 107

Slide 107 text

val newParameter = DefaultTrackSelector.ParametersBuilder(context) .setMaxVideoBitrate(NEW_MAX_VIDEO_BITRARE) .build() trackSelector.parameters = newParameter trackSelector.parameters = newParameter

Slide 108

Slide 108 text

No content

Slide 109

Slide 109 text

No content

Slide 110

Slide 110 text

No content

Slide 111

Slide 111 text

No content

Slide 112

Slide 112 text

No content

Slide 113

Slide 113 text

class LimitTrackSelection(...) : AdaptiveTrackSelection(...) { private var maxVideoBitrate = Int.MAX_VALUE fun setMaxVideoBitrate(maxVideoBitrate: Int) { this.maxVideoBitrate = maxVideoBitrate } override fun canSelectFormat( format: Format, trackBitrate: Int, playbackSpeed: Float, effectiveBitrate: Long ): Boolean { return trackBitrate <= maxVideoBitrate && super.canSelectFormat(...) } }

Slide 114

Slide 114 text

class LimitTrackSelection(...) : AdaptiveTrackSelection(...) { private var maxVideoBitrate = Int.MAX_VALUE fun setMaxVideoBitrate(maxVideoBitrate: Int) { this.maxVideoBitrate = maxVideoBitrate } override fun canSelectFormat( format: Format, trackBitrate: Int, playbackSpeed: Float, effectiveBitrate: Long ): Boolean { return trackBitrate <= maxVideoBitrate && super.canSelectFormat(...) } } AdaptiveTrackSelection(...) { override fun canSelectFormat( format: Format, trackBitrate: Int, playbackSpeed: Float, effectiveBitrate: Long ): Boolean }

Slide 115

Slide 115 text

class LimitTrackSelection(...) : AdaptiveTrackSelection(...) { private var maxVideoBitrate = Int.MAX_VALUE fun setMaxVideoBitrate(maxVideoBitrate: Int) { this.maxVideoBitrate = maxVideoBitrate } override fun canSelectFormat( format: Format, trackBitrate: Int, playbackSpeed: Float, effectiveBitrate: Long ): Boolean { return trackBitrate <= maxVideoBitrate && super.canSelectFormat(...) } } private var maxVideoBitrate = Int.MAX_VALUE fun setMaxVideoBitrate(maxVideoBitrate: Int) { this.maxVideoBitrate = maxVideoBitrate } override fun canSelectFormat( { return trackBitrate <= maxVideoBitrate } }

Slide 116

Slide 116 text

class LimitTrackSelection(...) : AdaptiveTrackSelection(...) { private var maxVideoBitrate = Int.MAX_VALUE fun setMaxVideoBitrate(maxVideoBitrate: Int) { this.maxVideoBitrate = maxVideoBitrate } override fun canSelectFormat( format: Format, trackBitrate: Int, playbackSpeed: Float, effectiveBitrate: Long ): Boolean { return trackBitrate <= maxVideoBitrate && super.canSelectFormat(...) } } https://github.com/google/ExoPlayer/issues/2250

Slide 117

Slide 117 text

Chunkless Preparation

Slide 118

Slide 118 text

m3u8 Playlist

Slide 119

Slide 119 text

ts First Chunk Playlist

Slide 120

Slide 120 text

First Chunk Playlist Prepare Decoder

Slide 121

Slide 121 text

First Chunk Playlist Prepare Decoder Start Decodeing

Slide 122

Slide 122 text

#EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=200000,CODECS="mp4a.40.2, avc1.4d4015" index1.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=600000,CODECS=“mp4a.40.2, avc1.4d401e" index2.m3u8 …

Slide 123

Slide 123 text

#EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=200000,CODECS="mp4a.40.2, avc1.4d4015" index1.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=600000,CODECS=“mp4a.40.2, avc1.4d401e" index2.m3u8 … CODECS="mp4a.40.2, avc1.4d4015" CODECS=“mp4a.40.2, avc1.4d401e"

Slide 124

Slide 124 text

#EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=200000,CODECS="mp4a.40.2, avc1.4d4015" index1.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=600000,CODECS=“mp4a.40.2, avc1.4d401e" index2.m3u8 … CODECS="mp4a.40.2, avc1.4d4015" CODECS=“mp4a.40.2, avc1.4d401e" val hlsMediaSource = HlsMediaSource.Factory(dataSourceFactory) .setAllowChunklessPreparation(true) .createMediaSource(uri)

Slide 125

Slide 125 text

#EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=200000,CODECS="mp4a.40.2, avc1.4d4015" index1.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=600000,CODECS=“mp4a.40.2, avc1.4d401e" index2.m3u8 … CODECS="mp4a.40.2, avc1.4d4015" CODECS=“mp4a.40.2, avc1.4d401e" val hlsMediaSource = HlsMediaSource.Factory(dataSourceFactory) .setAllowChunklessPreparation(true) .createMediaSource(uri) .setAllowChunklessPreparation(true)

Slide 126

Slide 126 text

m3u8 Playlist

Slide 127

Slide 127 text

ts First Chunk Playlist Prepare Decoder

Slide 128

Slide 128 text

First Chunk Playlist Prepare Decoder Start Decodeing

Slide 129

Slide 129 text

Reuse Decoder

Slide 130

Slide 130 text

Renderer

Slide 131

Slide 131 text

No content

Slide 132

Slide 132 text

Disabled Enabled Started

Slide 133

Slide 133 text

Disabled Enabled Started No Streams No Decoders Have Streams Might Have Decoders Decoding

Slide 134

Slide 134 text

Disabled Enabled Started No Streams No Decoders Have Streams Might Have Decoders Decoding Prepare Player

Slide 135

Slide 135 text

Disabled Enabled Started ~ v2.10.0 No Streams No Decoders Have Streams Might Have Decoders Decoding Prepare Player

Slide 136

Slide 136 text

Disabled Enabled Started ~ v2.10.0 No Streams No Decoders Have Streams Might Have Decoders Decoding Prepare Player

Slide 137

Slide 137 text

Disabled Enabled Started ~ v2.10.0

Slide 138

Slide 138 text

Disabled Enabled Started ~ v2.10.0 v2.10.0 ~ Disabled Enabled Started

Slide 139

Slide 139 text

v2.10.0 ~ Disabled Enabled Started

Slide 140

Slide 140 text

v2.10.0 ~ Disabled Enabled Started

Slide 141

Slide 141 text

v2.10.0 ~ Disabled Enabled Started Prepare Decoder Content A Content B Content C

Slide 142

Slide 142 text

Tunneled Video Playback

Slide 143

Slide 143 text

Media Source Renderer (Video) Renderer (Audio) Media Codec (Video) Media Codec (Audio) Audio Track Surface A/V Sync

Slide 144

Slide 144 text

Media Source Renderer (Video) Renderer (Audio) Media Codec (Video) Media Codec (Audio) Audio Track Surface A/V Sync

Slide 145

Slide 145 text

Media Source Renderer (Video) Renderer (Audio) Media Codec (Video) Media Codec (Audio) Audio Track Surface A/V Sync

Slide 146

Slide 146 text

Media Source Renderer (Video) Renderer (Audio) Media Codec (Video) Media Codec (Audio) Audio Track Surface A/V Sync

Slide 147

Slide 147 text

Media Source Renderer (Video) Renderer (Audio) Media Codec (Video) Media Codec (Audio) Audio Track Surface A/V Sync

Slide 148

Slide 148 text

Media Source Renderer (Video) Renderer (Audio) Media Codec (Video) Media Codec (Audio) Audio Track Surface A/V Sync

Slide 149

Slide 149 text

val parameter = DefaultTrackSelector.ParametersBuilder() .setTunnelingAudioSessionId(C.generateAudioSessionIdV21(this)) .build()

Slide 150

Slide 150 text

val parameter = DefaultTrackSelector.ParametersBuilder() .setTunnelingAudioSessionId(C.generateAudioSessionIdV21(this)) .build() .setTunnelingAudioSessionId(C.generateAudioSessionIdV21(this))

Slide 151

Slide 151 text

Systrace

Slide 152

Slide 152 text

thread(name = "example-thread") { Trace.beginSection("do something") // do something Trace.endSection() }

Slide 153

Slide 153 text

thread(name = "example-thread") { Trace.beginSection("do something") // do something Trace.endSection() } python systrace.py --app package-name --time=10 -o ~/Downloads/example.html

Slide 154

Slide 154 text

No content

Slide 155

Slide 155 text

python systrace.py --app "com.google.android.exoplayer2.demo" --time=10 -o ~/Downloads/trace.html

Slide 156

Slide 156 text

Load Master Playlist

Slide 157

Slide 157 text

Load Media Playlist

Slide 158

Slide 158 text

Load First Chunk

Slide 159

Slide 159 text

Prepare Decoder

Slide 160

Slide 160 text

No content

Slide 161

Slide 161 text

Initialize Video Decoder

Slide 162

Slide 162 text

Initialize Audio Decoder

Slide 163

Slide 163 text

No content

Slide 164

Slide 164 text

Render Video Output Buffer

Slide 165

Slide 165 text

Traditional Preparation Chunkless Preparation

Slide 166

Slide 166 text

Traditional Preparation Chunkless Preparation

Slide 167

Slide 167 text

Video Decoder Audio Decoder Decoder Initialization (150ms)

Slide 168

Slide 168 text

~ v2.10.0 (reuse decoder) v2.10.0 ~ (create recoders)

Slide 169

Slide 169 text

~ v2.10.0 (reuse decoder) v2.10.0 ~ (create recoders)

Slide 170

Slide 170 text

with tunneling without tunneling

Slide 171

Slide 171 text

Reference https://medium.com/google-exoplayer/faster-hls-preparation-f6611aa15ea6 https://medium.com/google-exoplayer/tunneled-video-playback-in-exoplayer-84f084a8094d https://medium.com/google-exoplayer/improved-decoder-reuse-in-exoplayer-ef4c6d99591d https://exoplayer.dev