doggycoder / audiovideo Goto Github PK
View Code? Open in Web Editor NEWAndroid音视频相关的Demo
Android音视频相关的Demo
`package edu.wuwang.codec.utils;
import android.app.Activity;
import android.content.pm.PackageManager;
import android.os.Build;
import android.support.v4.app.ActivityCompat;
/**
Description:
*/
public class PermissionUtils {
public static void askPermission(Activity context, String[] permissions, int req, Runnable
runnable) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
boolean isGetPermission = true;
for (String permission : permissions) {
int result = ActivityCompat.checkSelfPermission(context, permission);
if (result != PackageManager.PERMISSION_GRANTED) {
isGetPermission = false;
break;
}
}
if (isGetPermission) {
runnable.run();
} else {
ActivityCompat.requestPermissions(context, permissions, req);
}
} else {
runnable.run();
}
}
public static void onRequestPermissionsResult(boolean isReq, int[] grantResults, Runnable
okRun, Runnable deniRun) {
if (isReq) {
boolean isGetPermission = true;
for (int grantResult : grantResults) {
if (grantResult != PackageManager.PERMISSION_GRANTED) {
isGetPermission = false;
break;
}
}
if (isGetPermission) {
okRun.run();
} else {
deniRun.run();
}
}
}
}
`
codec这个项目,测了几款手机,发现nexus6/6p android 7.0,前置摄像头是倒过来的,请问怎么解决
Gradle 'media_recorder_api_18' project refresh failed
Error:Cause: unable to find valid certification path to requested target
int width = mpeg.get(FFMpeg.KEY_WIDTH);
int height = mpeg.get(FFMpeg.KEY_HEIGHT);
data = new byte[widthheight3/2];
mpeg.output(data);
ByteArrayOutputStream out = new ByteArrayOutputStream();
YuvImage yuv = new YuvImage(data, ImageFormat.NV21, width, height, null);
yuv.compressToJpeg(new Rect(0, 0, width, height), 50, out);
byte[] bytes = out.toByteArray();
Bitmap bitmap= BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
mImageView.setImageBitmap(bitmap);
调用output方法所得到的数据是不是就是yuv数据?
@doggycoder
处理完黑屏视频是黑的- -
java.lang.NullPointerException: Attempt to invoke virtual method 'void edu.wuwang.codec.coder.CameraRecorder.feedData(byte[], long)' on a null object reference
at edu.wuwang.codec.camera.CameraActivity.onFrame(CameraActivity.java:241)
at edu.wuwang.codec.camera.CameraDrawer.frameCallback(CameraDrawer.java:251)
at edu.wuwang.codec.camera.CameraDrawer.callbackIfNeeded(CameraDrawer.java:240)
at edu.wuwang.codec.camera.CameraDrawer.onDrawFrame(CameraDrawer.java:169)
at edu.wuwang.codec.camera.CameraView.onDrawFrame(CameraView.java:124)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1553)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1253)
Application terminated.
Hello,sir.a fatal error occurred.
Process: edu.wuwang.codec, PID: 4708
java.lang.NullPointerException: Attempt to invoke virtual method 'void edu.wuwang.codec.coder.CameraRecorder.feedData(byte[], long)' on a null object reference
at edu.wuwang.codec.camera.CameraActivity.onFrame(CameraActivity.java:241)
at edu.wuwang.codec.camera.CameraDrawer.frameCallback(CameraDrawer.java:251)
at edu.wuwang.codec.camera.CameraDrawer.callbackIfNeeded(CameraDrawer.java:240)
at edu.wuwang.codec.camera.CameraDrawer.onDrawFrame(CameraDrawer.java:169)
at edu.wuwang.codec.camera.CameraView.onDrawFrame(CameraView.java:124)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1548)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1259)
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.