Yeni Android Lollipop üzerinde libstreaming test ediyorum ve önceki sürümde çalışan bu kod, istisna başlatıyor gibi görünüyor.MediaRecorder issue on Android Lollipop
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());
}
başlatılan istisnadır: Ben başladıklarında bir istisna başlattı
mMediaRecorder.setOutputFile(mSender.getFileDescriptor());
ama:
MediaRecorder: Ben yorum yapmak denedim
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)
-38 başlatılamadı Bir iletişim akışı bana bir outputfile gerek olduğunu söyle.
Yardım edin.
Sanırım benzer bir hata alıyorum. Ben de ses/video akışı için yerel bir soket yazmaya çalışıyorum ama -38 hata E/StagefrightRecorder ﹕ Çıktı dosya tanımlayıcısı geçersiz sonra alıyorum. https://android.googlesource.com/platform/frameworks/av/+/master/media/libmediaplayerservice/StagefrightRecorder.cpp satırındaki hata çıktıları, dosya tanımlayıcısı 0'dan küçük olduğunda, anlam -1'den küçüktür. varsayılan sentinel değeri. Bunun dışında, çıktı dosyasını ayarlamadan önce tanımlayıcıyı 136 olarak ayarladığımı doğrularım. – sbaar
hangi Android sürümünü kullanıyorsunuz? – andreasperelli
Bu sorun sadece Lollipop üzerindedir. Aynı nexus 5 ve aynı nexus 7 cihazındaki aynı kod, kitkattayken çalıştı. Sorun şu ki, sorunun soketlerle bir ilgisi var, ama hala neyin değişebileceğini araştırmaya çalışıyorum. – sbaar