3
最近我遇到了这个问题,但没有任何线索。我想用“mediarecorder”录制720P视频流并实时发送给服务器。这里是我的代码:IMediaDeathNotifier:媒体服务器死亡
try{
soc = new Socket(InetAddress.getByName(hostname), port);
} catch (UnknownHostException e){
e.printStackTrace();
} catch (IOException e){
e.printStackTrace();
}
CamcorderProfile pProfile = CamcorderProfile.get(CamcorderProfile.QUALITY_720P);
//pProfile.videoFrameWidth = 1280;
//pProfile.videoFrameWidth = 720;
recorder.setProfile(pProfile);
//recorder.setOutputFile(myRecAudioFile.getAbsolutePath());//保存路径
pfd = ParcelFileDescriptor.fromSocket(soc);
recorder.setOutputFile(pfd.getFileDescriptor());
recorder.prepare();
recorder.start();
Android的API级别是17,当我开始媒体记录器,该程序会死只是一两秒钟。错误日志是这样的:
IMediaDeathNotifier- media server died
Camera - Camera server died
谁已经越过类似的问题来了任何人都可以给我一些建议吗?