首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >LibStreaming在更改分辨率时显示黑屏

LibStreaming在更改分辨率时显示黑屏
EN

Stack Overflow用户
提问于 2018-03-21 21:35:37
回答 1查看 261关注 0票数 0

我用的是https://github.com/fyhertz/spydroid-ipcamera的spydroid。根据需要,需要在设备中发送和接收流媒体。从本地网络我们应该能够显示rtsp流。例如。VLC媒体播放器。

我面临的问题是,当我改变解决方案时。640*480。它应该给黑屏与流媒体直播。默认demo支持320*240,工作正常。我还根据640*480的分辨率改变了比特率和帧率。但是没有得到结果。

任何帮助都将不胜感激。

EN

回答 1

Stack Overflow用户

发布于 2018-04-12 14:42:17

您可能正在使用演示SpyDroid正在使用的旧库。

我用下面的方式尝试的代码也有同样的问题:

步骤:-

1.)包括库LibStreaming

  • ,因为它是最新的库,支持棒棒糖的更高版本。

2.)查找H263Stream 更改以下方法:-

来自的

代码语言:javascript
复制
@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();
    }

}

代码语言:javascript
复制
@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。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49407803

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档