jadynai / medialearn Goto Github PK
View Code? Open in Web Editor NEW基于Android平台的音视频编解码项目,使用MediaCodeC、OpenGL高效解决音视频编解码问题
基于Android平台的音视频编解码项目,使用MediaCodeC、OpenGL高效解决音视频编解码问题
您好,能精确到ms吗
你好 读了你的一篇文章感觉写的不错。 kotlin code 也写的很干净
最近需要在android 上面实现 video scrubbing的功能, 就是用户可以通过时间轴来实时定位视频帧 (跟iphone的 视频编辑时浏览的功能差不多)。现在大多数的video seek 都是拉到一个时间点 然后视频图像才更新。
不知道你有没有什么想法或者好方法来实现这个功能?
多谢~
if (!inputDone) {
decoder.dequeueValidInputBuffer(DEF_TIME_OUT) { inputBufferId, inputBuffer ->
val sampleSize = videoAnalyze.mediaExtractor.readSampleData(inputBuffer, 0)
if (sampleSize < 0)
decoder.queueInputBuffer(inputBufferId, 0, 0, 0L,
MediaCodec.BUFFER_FLAG_END_OF_STREAM)
inputDone = true
} else {
{//这里是不是可以改进 他是不是取出了所有的帧,其实我们仅仅需要少部分
val presentationTimeUs = videoAnalyze.mediaExtractor.sampleTime
Log.d(TAG, "${if (emitter != null) "main time" else "fuck time"} dequeue time is $presentationTimeUs ")
decoder.queueInputBuffer(inputBufferId, 0,
sampleSize, presentationTimeUs, 0)
videoAnalyze.mediaExtractor.advance()
}
}
}
本身项目是java ,貌似不太好调用,不熟悉kotalin
代码
class FrameCache(dataSource: String) {
private val TAG = "FrameCache"
private val mainKey = md5(dataSource)
private val lruCache by lazy {
val maxMemory = (Runtime.getRuntime().maxMemory()).toInt()
// Use 1/8th of the available memory for this memory cache.
val cacheSize = maxMemory / 12
object : LruCache<String, Bitmap>(cacheSize) {
override fun sizeOf(key: String?, value: Bitmap?): Int {
value?.apply {
return byteCount
}
return super.sizeOf(key, value)
}
}
}
报错:
e: MediaLearn/mediakit/src/main/java/com/jadyn/mediakit/video/decode/FrameCache.kt: (26, 13): 'sizeOf' overrides nothing
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.