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
誰已經越過類似的問題來了任何人都可以給我一些建議嗎?