android-videotoimages's People
Forkers
xu-ligu mayi203 aj2014 vincenlee wikipedia2008 crablife kim-wang lian899 homelee utkozavr lcksk yunnanabel xinfushe zhan3080 zhan-sevenhome xiaole0310 mrmceduns xifengcoder haoyaogang codecreator2015 lejun rebornwolfman james6xie misback void-zyj shieryun githubwangjunqiang jingxiongdi ffmpeg1 msqljj dashewan11111 prnda qtyearlin jinkailong888 yorkeehuang glen9527 prosat trulliyang lhcteam iamzj ylcodelab 372163787 ltqin hyb1234hi trenail renzhe2015 qq297110281 mrkhantee linmulberry along-pc qqlizhn hughyieh yiflylian 275288698 chunhungtsai myzhengzheng a1198375223 drs0214 iamzhongjian juwuguo1988 13301338176 hpdx minimicall tochange killerdamon ouyangpeng luojianping168 selinallg cybernhl fishfire zombiu balgron rayhuangdev lilltezheng runsky android-zhao whiteants br4z4g4n tplinc zhaiysgithub prettyedandroid-videotoimages's Issues
解码出来的图片大小为0
手机是华为p8,视频是mp4格式,手机录制的本地视频
如何是渲染给surface的话,拿不到getOutputImage
MediaCodec.BufferInfo info = new MediaCodec.BufferInfo();
decoder.configure(mediaFormat, surface, null, 0);
这边如果给了Surface的话,就没办法,拿到图片数据,如果想对画面添加水印,在渲染给surface的要,有没有办法
getOutputImage(index); 报异常
感谢您的开源。
我现在是从rtsp流中解码了h264的数据出来,所以没有mediaextractor , 模仿您的写法,为什么getOutputImage一直是空的呢?
感谢
`
do {
if (frameInfo != null) {
byte[] pBuf = frameInfo.buffer;
index = mCodec.dequeueInputBuffer(10);
if (index >= 0) {
ByteBuffer buffer = mCodec.getInputBuffers()[index];
buffer.clear();
if (pBuf.length > buffer.remaining()) {
mCodec.queueInputBuffer(index, 0, 0, frameInfo.stamp, 0);
} else {
buffer.put(pBuf, frameInfo.offset, frameInfo.length);
mCodec.queueInputBuffer(index, 0, buffer.position(), frameInfo.stamp + differ, 0);
}
frameInfo = null;
}
}
index = mCodec.dequeueOutputBuffer(info, 10); //
//此处回调数据出去
if (index > 0) {
//这里的image一直是空的
Image image = mCodec.getOutputImage(index);
if (image != null) {
byte[] dataFromImage = getDataFromImage(image, COLOR_FormatNV21);
if (i420callback != null) {
i420callback.onI420Data(dataFromImage, frameInfo);
}
}
}
switch (index) {
case MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED:
Log.i(TAG, "INFO_OUTPUT_BUFFERS_CHANGED");
break;
case MediaCodec.INFO_OUTPUT_FORMAT_CHANGED:
MediaFormat mf = mCodec.getOutputFormat();
Log.i(TAG, "INFO_OUTPUT_FORMAT_CHANGED :" + mf);
break;
case MediaCodec.INFO_TRY_AGAIN_LATER:
// 输出为空
break;
default:
// 输出队列不为空
// -1表示为第一帧数据
long newSleepUs = -1;
boolean firstTime = previewStampUs == 0l;
if (!firstTime) {
long sleepUs = (info.presentationTimeUs - previewStampUs);
if (sleepUs > 50000) {
// 时间戳异常,可能服务器丢帧了。
Log.w(TAG, "sleep time.too long:" + sleepUs);
sleepUs = 50000;
}
{
long cache = mNewestStample - previewStampUs;
newSleepUs = fixSleepTime(sleepUs, cache, 0);
}
}
previewStampUs = info.presentationTimeUs;
if (false && Build.VERSION.SDK_INT >= 21) {
Log.d(TAG, String.format("releaseoutputbuffer:%d,stampUs:%d", index, previewStampUs));
mCodec.releaseOutputBuffer(index, previewStampUs);
} else {
if (newSleepUs < 0) {
newSleepUs = 0;
}
// Log.i(TAG,String.format("sleep:%d", newSleepUs/1000));
Thread.sleep(newSleepUs / 1000);
mCodec.releaseOutputBuffer(index, true);
}
if (firstTime) {
Log.i(TAG, String.format("POST VIDEO_DISPLAYED!!!"));
ResultReceiver rr = mRR;
if (rr != null) rr.send(RESULT_VIDEO_DISPLAYED, null);
}
}
} while (frameInfo != null || index < MediaCodec.INFO_TRY_AGAIN_LATER);
`
视频帧保存的图片方向不对
你好,我在用您的工程给视频解码的时候,得到的图片跟视频的方向不一致,有±90°的一个偏转,请问这个怎么解决
如何利用该项目实现h264视频流解码成i420视频流
能否实现h264视频流解码成i420视频流呢,谢谢!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.