安卓:录制的视频似乎*失真* [英] Android: recorded video seems *distorted*

查看:111
本文介绍了安卓:录制的视频似乎*失真*的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从使用MediaRecorder摄像头录制视频。这里有一个code段

I'm trying to record video from the Camera using the MediaRecorder. Here's a code snippet

剪断..


  mr.setAudioSource( MediaRecorder.AudioSource.MIC );
  mr.setVideoSource( MediaRecorder.VideoSource.CAMERA);
  mr.setOutputFormat( MediaRecorder.OutputFormat.THREE_GPP );
  mr.setAudioEncoder( MediaRecorder.AudioEncoder.AMR_NB );
  mr.setVideoEncoder( MediaRecorder.VideoEncoder.MPEG_4_SP );
  mr.setVideoSize( 200, 200 );
  mr.setVideoFrameRate( 15 );

..snap

..snap

code上的一个里程碑/ Droid的,非空的输出文件的执行将被创建。但是,当我尝试查看视频,它看起来是这样的:

Code executes on a MileStone/Droid, non-empty output file will be created. But when I try to view the video, it looks like this:

我的第一个想法是关于某种编码错误的,所以我尝试了一切可能的OUTPUTFORMAT / VIDEOEN codeR结合,对结果没有effetcs。

My first thoughts were about some sort of encoding error, so I tried every possible OutputFormat/VideoEncoder combination, with no effetcs on the result.

LogCat中显示了以下错误    CameraInput:不支持的参数(X-PVMF /媒体输入节点/帽配置界面; valtype = key_specific_value)

LogCat shows the following error CameraInput: Unsupported parameter(x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value)

但我想不通,我可能会设置错误。我用camera.getParameters(),设置preVIEW尺寸返回PARAMS然后推回用camera.setParameters()...

But I can't figure out, what I may have set wrong. I used camera.getParameters(), set the preview size with the returned params and then pushed them back using camera.setParameters()...

曾通的每一件样品code我能找到,但还是没有找到解决办法。

Worked thru every piece of sample code I could find, but still found no solution.

有没有人有什么想法?

推荐答案

您必须设置正确的setVideoSize(X,Y)的功能。 你必须调用功能,让您的大小选择,并从该列表中选择

you must set the correct setVideoSize( x, y) function. you must call the function which give you the size options , and choose from that list

这篇关于安卓:录制的视频似乎*失真*的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆