FastExoPlayerSeeker
Fast Seek for ExoPlayer
Install / Use
/learn @kibotu/FastExoPlayerSeekerREADME
FastExoPlayerSeeker

Introduction
Adds fast seeking for exoplayer. (Note: it also depends on the amount of video encoding, mainly IDR Frames)

How to install
repositories {
maven {
url "https://jitpack.io"
}
}
dependencies {
implementation 'com.github.kibotu:FastExoPlayerSeeker:-SNAPSHOT'
}
How to use
Create Emitter
val emitter = SeekPositionEmitter()
emitter.seekFast(newSeekPosition)
Create Observable
simpleExoPlayer.seekWhenReady(emitter)
.subscribe({
logv("seekTo=${it.first} isSeeking=${it.second}")
}, { loge("${it.message}") })
.addTo(subscriptions) // don't forget to dispose when you're done!
FFMpeg
I've had good results increasing the amount if IDR frames using the following script which in term will help exoplayer snap to those sync frames and improve scrubbing.
#!/usr/bin/env bash
# change iframe rate
# https://gist.github.com/kibotu/27c5d665d19b9f782e6b4f26eff878b1
#
# https://ffmpeg.org/ffmpeg-formats.html#mov_002c-mp4_002c-ismv
# -movflags faststart
# Run a second pass moving the index (moov atom) to the beginning of the file. This operation can take a while, and will not work in various situations such as fragmented output, thus it is not enabled by default.
#
# -movflags rtphint
# Add RTP hinting tracks to the output file.
#
# -c:v libx264
# -c codec codec name
#
# -profile profile set profile
# Another optional setting is -profile:v which will limit the output to a specific H.264 profile.
# Omit this unless your target device only supports a certain profile (see Compatibility).
# Current profiles include: baseline, main, high, high10, high422, high444. Note that usage of -profile:v is incompatible with lossless encoding.
# https://trac.ffmpeg.org/wiki/Encode/H.264
# https://trac.ffmpeg.org/wiki/Encode/H.264#Compatibility
#
# -keyint_min E..V…. minimum interval between IDR-frames (from INT_MIN to INT_MAX) (default 25)
ffmpeg -i inputvide.mp4 -c:v libx264 -profile:v baseline -level 3.0 -x264opts keyint=10:min-keyint=10 -g 10 -movflags +faststart+rtphint -maxrate:v 4000k -bufsize:v 4500k outputvideo.mp4
How to build
graldew clean build
CI
gradlew clean assembleRelease test javadoc
Build Requirements
- JDK8
- Android Build Tools 29.0.2
- Android SDK 29
Notes
Follow me on Twitter: @wolkenschauer
Let me know what you think: jan.rabe@kibotu.net
Contributions welcome!
License
<pre> Copyright 2019 Jan Rabe Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. </pre>Related Skills
node-connect
349.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.7kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
