我正在开发一个应用程序,通过RTSP通过library库从android设备上播放实时视频。
我试图通过使用以下代码来更改视频质量:
private void initRtspClient() {
mSession = SessionBuilder.getInstance()
.setContext(getApplicationContext())
.setAudioEncoder(SessionBuilder.AUDIO_NONE)
.setVideoEncoder(SessionBuilder.VIDEO_H264)
.setVideoQuality(new VideoQuality(480, 360, 30, 500))
.setSurfaceView(mSurfaceView).setPreviewOrientation(0)
.setCallback(this).build();但是,当应用程序在设备上运行时,我在日志中得到以下错误:
12-16 12:03:32.601 4596-4609/com.example.GlassApp E/EncoderDebugger﹕ No usable encoder were found on the phone for resolution 480x360
12-16 12:03:32.601 4596-4609/com.example.GlassApp E/H264Stream﹕ Resolution not supported with the MediaCodec API, we fallback on the old streamign method.但这是Suppored Media Format doc (H.264中的enoding) http://developer.android.com/guide/appendix/media-formats.html中所述的决议。
有什么问题吗?
编辑:应该添加的安卓平台是谷歌眼镜(XE22)
发布于 2015-03-05 10:38:55
我似乎只能将决议更改为以下两个值:
.setVideoQuality(new VideoQuality(640, 480, 20, 500000))或
.setVideoQuality(new VideoQuality(960, 720, 20, 500000))如果框架是通过20 fps引发的,那么代码似乎也不起作用。
https://stackoverflow.com/questions/27504235
复制相似问题