[英]how to decode the byte array (.h264 format) in to video in android?
在“我的應用程序”中,我必須將字節數組(.h264格式)解碼為視頻,然后將字節數組從實時流傳輸中解碼出來。 代碼如下:
static final int VIDEO_BUF_SIZE = 100000;
static final int FRAME_INFO_SIZE = 16;
byte[] frameInfo = new byte[FRAME_INFO_SIZE];
byte[] videoBuffer = new byte[VIDEO_BUF_SIZE];
File SDFile = android.os.Environment.getExternalStorageDirectory();
File destDir = new File(SDFile.getAbsolutePath() + "/test.h264");
//avRecvFrameData returns the length of the frame and stores it in ret.
int ret = av.avRecvFrameData(avIndex, videoBuffer,
VIDEO_BUF_SIZE, frameInfo, FRAME_INFO_SIZE,
frameNumber);
fos=new FileOutputStream(destDir,true);
fos.write(videoBuffer, 0, ret);
fos.close();
那我現在該怎么辦?
謝謝大家。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.