पर मीडियाआरकॉर्डर मुद्दा मैं libstreaming पर नए एंड्रॉइड लॉलीपॉप पर परीक्षण कर रहा हूं, और यह कोड जो पिछले रिलीज पर काम करता है, अपवाद लॉन्च करता है।एंड्रॉइड लॉलीपॉप
try {
mMediaRecorder = new MediaRecorder();
mMediaRecorder.setCamera(mCamera);
mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mMediaRecorder.setVideoEncoder(mVideoEncoder);
mMediaRecorder.setPreviewDisplay(mSurfaceView.getHolder().getSurface());
mMediaRecorder.setVideoSize(mRequestedQuality.resX,mRequestedQuality.resY);
mMediaRecorder.setVideoFrameRate(mRequestedQuality.framerate);
// The bandwidth actually consumed is often above what was requested
mMediaRecorder.setVideoEncodingBitRate((int)(mRequestedQuality.bitrate*0.8));
// We write the ouput of the camera in a local socket instead of a file !
// This one little trick makes streaming feasible quiet simply: data from the camera
// can then be manipulated at the other end of the socket
mMediaRecorder.setOutputFile(mSender.getFileDescriptor());
mMediaRecorder.prepare();
mMediaRecorder.start();
} catch (Exception e) {
throw new ConfNotSupportedException(e.getMessage());
}
शुरू अपवाद है:
MediaRecorder: शुरू में विफल रहा है -38
11-18 09:50:21.028: W/System.err(15783): net.majorkernelpanic.streaming.exceptions.ConfNotSupportedException
11-18 09:50:21.028: W/System.err(15783): at net.majorkernelpanic.streaming.video.VideoStream.encodeWithMediaRecorder(VideoStream.java:442)
11-18 09:50:21.028: W/System.err(15783): at net.majorkernelpanic.streaming.MediaStream.start(MediaStream.java:250)
मैं टिप्पणी करने की कोशिश की है:
mMediaRecorder.setOutputFile(mSender.getFileDescriptor());
कोई अपवाद नहीं शुरू किया, लेकिन जब मैं शुरू एक संवाद स्ट्रीमिंग मुझे बताओ कि आउटपुटफाइल की आवश्यकता है।
सहायता की सराहना की।
मुझे लगता है कि मुझे एक ही त्रुटि मिल रही है। मैं ऑडियो/वीडियो स्ट्रीम करने के लिए स्थानीय सॉकेट पर भी लिखने की कोशिश कर रहा हूं लेकिन -38 त्रुटि ई/स्टेजफ्राइट रिकॉर्डर के बाद हो रहा हूं: आउटपुट फ़ाइल डिस्क्रिप्टर अमान्य है। https://android.googlesource.com/platform/frameworks/av/+/master/media/libmediaplayerservice/StagefrightRecorder.cpp लाइन 752 पर त्रुटि आउटपुट के अनुसार। जब फ़ाइल डिस्क्रिप्टर 0 से कम है, अर्थ -1 डिफ़ॉल्ट प्रेषित मूल्य। सिवाय इसके कि मैं आउटपुट फ़ाइल सेट करने से पहले सत्यापित करता हूं कि मैंने वर्णनकर्ता को 136 के रूप में सेट किया है। – sbaar
आप किस एंड्रॉइड संस्करण का उपयोग कर रहे हैं? – andreasperelli
यह समस्या केवल लॉलीपॉप पर है। उसी नेक्सस 5 और उसी नेक्सस 7 डिवाइस पर एक ही कोड काम करता था जब वे किटकैट पर थे। अब मुझे यकीन है कि समस्या सॉकेट के साथ कुछ करने के लिए है, लेकिन मैं अभी भी यह बदलने की कोशिश कर रहा हूं कि क्या बदल सकता है। – sbaar