Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改分辨率之后抛异常 #12

Open
shunanlove opened this issue May 16, 2017 · 4 comments
Open

修改分辨率之后抛异常 #12

shunanlove opened this issue May 16, 2017 · 4 comments

Comments

@shunanlove
Copy link

           // 这里是重点,分辨率和比特率
            // 分辨率越大视频大小越大,比特率越大视频越清晰
            // 清晰度由比特率决定,视频尺寸和像素量由分辨率决定
            // 比特率越高越清晰(前提是分辨率保持不变),分辨率越大视频尺寸越大。
            profile.videoFrameWidth = 720;          //修改了这里
            profile.videoFrameHeight = 1080;       //修改了这里
            // 这样设置 1080p的视频 大小在5M , 可根据自己需求调节
            profile.videoBitRate = 2 * optimalSize.width * optimalSize.height;

异常:
05-16 18:00:36.996 18961-18961/com.werb.mediautilsdemo W/System.err: java.lang.RuntimeException: unlock failed
05-16 18:00:36.997 18961-18961/com.werb.mediautilsdemo W/System.err: at android.hardware.Camera.unlock(Native Method)
05-16 18:00:36.997 18961-18961/com.werb.mediautilsdemo W/System.err: at com.werb.mediautilsdemo.MediaUtils.prepareRecord(MediaUtils.java:141)
05-16 18:00:36.997 18961-18961/com.werb.mediautilsdemo W/System.err: at com.werb.mediautilsdemo.MediaUtils.startRecordThread(MediaUtils.java:299)
05-16 18:00:36.997 18961-18961/com.werb.mediautilsdemo W/System.err: at com.werb.mediautilsdemo.MediaUtils.record(MediaUtils.java:132)
05-16 18:00:36.997 18961-18961/com.werb.mediautilsdemo W/System.err: at com.werb.mediautilsdemo.activity.VideoRecorderActivity$2.onTouch(VideoRecorderActivity.java:92)

@shunanlove
Copy link
Author

拍摄完成之后 没有微信那种浏览功能

@werbhelius
Copy link
Owner

分辨率每一个设备支持的参数是不一样的,异常应该是不支持你设置的参数

@keyescgm
Copy link

keyescgm commented Jun 9, 2017

录制完之后,视频很大,如何压缩?

@freefly2016
Copy link

对啊 怎么压缩呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants