我用的是https://github.com/fyhertz/spydroid-ipcamera的spydroid。根据需要,需要在设备中发送和接收流媒体。从本地网络我们应该能够显示rtsp流。例如。VLC媒体播放器。
我面临的问题是,当我改变解决方案时。640*480。它应该给黑屏与流媒体直播。默认demo支持320*240,工作正常。我还根据640*480的分辨率改变了比特率和帧率。但是没有得到结果。
任何帮助都将不胜感激。
发布于 2018-04-12 14:42:17
您可能正在使用演示SpyDroid正在使用的旧库。
我用下面的方式尝试的代码也有同样的问题:
步骤:-
1.)包括库LibStreaming。
2.)查找H263Stream 类更改以下方法:-
来自的
@SuppressLint("NewApi")
private MP4Config testMediaCodecAPI() throws RuntimeException, IOException {
createCamera();
updateCamera();
try {
if (mQuality.resX>=640) {
// Using the MediaCodec API with the buffer method for high resolutions is too slow
mMode = MODE_MEDIARECORDER_API;
}
EncoderDebugger debugger = EncoderDebugger.debug(mSettings, mQuality.resX, mQuality.resY);
return new MP4Config(debugger.getB64SPS(), debugger.getB64PPS());
} catch (Exception e) {
// Fallback on the old streaming method using the MediaRecorder API
Log.e(TAG,"Resolution not supported with the MediaCodec API, we fallback on the old streamign method.");
mMode = MODE_MEDIARECORDER_API;
return testH264();
}}
到
@SuppressLint("NewApi")
private MP4Config testMediaCodecAPI() throws RuntimeException, IOException {
createCamera();
updateCamera();
try {
if (mQuality.resX>=1080) {
// Using the MediaCodec API with the buffer method for high resolutions is too slow
mMode = MODE_MEDIARECORDER_API;
}
EncoderDebugger debugger = EncoderDebugger.debug(mSettings, mQuality.resX, mQuality.resY);
return new MP4Config(debugger.getB64SPS(), debugger.getB64PPS());
} catch (Exception e) {
// Fallback on the old streaming method using the MediaRecorder API
Log.e(TAG,"Resolution not supported with the MediaCodec API, we fallback on the old streamign method.");
mMode = MODE_MEDIARECORDER_API;
return testH264();
}
}-You可以找到从"640“到"1080”的分辨率差异
-不知道确切的原因是什么,但上面的解决方案对我有效。
如果有任何循环失败,就给我回-Revert。
https://stackoverflow.com/questions/49407803
复制相似问题