试图录制视频时VerifiyAndSetParameter错误 [英] VerifiyAndSetParameter error when trying to record video

查看:263
本文介绍了试图录制视频时VerifiyAndSetParameter错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图创建一个应用程序,记录和上传视频到S3桶。 我一直在使用(一点点改变)href="http://developer.android.com/guide/topics/media/camera.html#intent-video" rel="nofollow">的Andr​​oid采集视频的。但是当记录结束后,我得到一个错误列表。 (我使用的Galaxy S2手机,所以它支持)。

$ C $下CameraActivity:

 意向意图=新的意图(MediaStore.ACTION_VIDEO_CAPTURE);
        =了fileURI SavingMedia
                .getOutputMediaFileUri(SavingMedia.MEDIA_TYPE_VIDEO);
        PATH = fileUri.toString();

        intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT,30);
        intent.putExtra(MediaStore.EXTRA_OUTPUT,了fileURI);
        intent.putExtra(MediaStore.EXTRA_SCREEN_ORIENTATION,
                ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY,0.2);

        startActivityForResult(意向,CAPTURE_VIDEO_REQUEST_ code);
 

LogCat中输出:

  10月五日至八日:46:31.875:E / CameraInput(2595):记录还没有准备好(iPeer 0xfbb3c即将状态置2 iWriteState 1 iClockState 0),帧丢弃
10月5号至八日:46:31.910:E / CameraInput(2595):记录还没有准备好(iPeer 0xfbb3c即将状态置2 iWriteState 1 iClockState 0),帧丢弃
10月5号至八日:46:31.945:E / CameraInput(2595):记录还没有准备好(iPeer 0xfbb3c即将状态置2 iWriteState 1 iClockState 0),帧丢弃
10月5号至八日:46:31.975:E / CameraInput(2595):记录还没有准备好(iPeer 0xfbb3c即将状态置2 iWriteState 1 iClockState 0),帧丢弃
10月5号至八日:46:33.455:E / YAMAHA ::媒体::参数(2595):销售code = PTR
10月5号至八日:46:33.705:E / CameraInput(2595):不支持该参数(X-PVMF /媒体输入节点/帽配置界面; valtype = key_specific_value)
10月5号至八日:46:33.705:E / CameraInput(2595):VerifiyAndSetParameter失败的参数#0
10月5号至八日:46:33.705:E / audio_input(2595):不支持的参数:X-PVMF /媒体输入节点/帽配置界面; valtype = key_specific_value
10月5号至八日:46:33.705:E / audio_input(2595):VerifyAndSetParameter失败
10月5号至八日:46:33.740:E / AndroidRuntime(29786):致命异常:主要
10月5号至八日:46:33.740:E / AndroidRuntime(29786):显示java.lang.NullPointerException
10月5号至八日:46:33.740:E / AndroidRuntime(29786):在java.io.File.fixSlashes(File.java:205)
10月5号至八日:46:33.740:E / AndroidRuntime(29786):在java.io.File.init(File.java:189)
。10月5号至8号:46:33.740:E / AndroidRuntime(29786):在java.io.File中的< INIT>(File.java:139)
10月5号至八日:46:33.740:E / AndroidRuntime(29786):在com.sec.android.app.camera.CamcorderEngine.renameTempFile(CamcorderEngine.java:1206)
10月5号至八日:46:33.740:E / AndroidRuntime(29786):在com.sec.android.app.camera.CamcorderEngine.doStopVideoRecordingSync(CamcorderEngine.java:812)
10月5号至八日:46:33.740:E / AndroidRuntime(29786):在com.sec.android.app.camera.CeStateRecording.handleRequest(CeStateRecording.java:69)
10月5号至八日:46:33.740:E / AndroidRuntime(29786):在com.sec.android.app.camera.CeRequestQueue.startFirstRequest(CeRequestQueue.java:123)
10月5号至八日:46:33.740:E / AndroidRuntime(29786):在com.sec.android.app.camera.CeRequestQueue.access $ 200(CeRequestQueue.java:32)
10月5号至八日:46:33.740:E / AndroidRuntime(29786):在com.sec.android.app.camera.CeRequestQueue $ MainHandler.handleMessage(CeRequestQueue.java:60)
10月5号至八日:46:33.740:E / AndroidRuntime(29786):在android.os.Handler.dispatchMessage(Handler.java:99)
10月5号至八日:46:33.740:E / AndroidRuntime(29786):在android.os.Looper.loop(Looper.java:123)
10月5号至八日:46:33.740:E / AndroidRuntime(29786):在android.app.ActivityThread.main(ActivityThread.java:3691)
10月5号至八日:46:33.740:E / AndroidRuntime(29786):在java.lang.reflect.Method.invokeNative(本机方法)
10月5号至八日:46:33.740:E / AndroidRuntime(29786):在java.lang.reflect.Method.invoke(Method.java:507)
10月5号至八日:46:33.740:E / AndroidRuntime(29786):在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:847)
10月5号至八日:46:33.740:E / AndroidRuntime(29786):在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
10月5号至八日:46:33.740:E / AndroidRuntime(29786):在dalvik.system.NativeStart.main(本机方法)
10月5号至八日:46:33.770:E /(2806):Dumpstate> /数据/日志/ dumpstate_app_error
 

解决方案

哥们你应该会看到以下问题的答案, 这是为我工作,并为你绝对工作。

安卓视频录像引发Error

注:我有同样的错误如下:

在com.sec.android.app.camera.CamcorderEngine.renameTempFile(CamcorderEngine.java:1206)

解决方案:工作在Android 2.2系统,2.3 ... 我做了以下过程拍摄的照片

  INT CAMERA_WITH_VIDEO_DATA = 2;
//启动照片拍摄活动...

 意向意图=新的意图(MediaStore.ACTION_VIDEO_CAPTURE,NULL);
 startActivityForResult(意向,CAMERA_WITH_VIDEO_DATA);

....
....

私人无效saveVideoFileOnActivityResult(意向videoIntent){
   的FileInputStream FIS = NULL;
   FileOutputStream中FOS = NULL;
   文件mCurrentVideoFile = NULL;
   尝试 {
         mCurrentVideoFile =新的文件(path_to_your_file);
         AssetFileDescriptor videoAsset = getContentResolver()openAssetFileDescriptor(videoIntent.getData(),R)。
         FIS = videoAsset.createInputStream();
         //文件videoFile =新的文件(Environment.getExternalStorageDirectory(),< VideoFileName> .MP4);
         FOS =新的FileOutputStream(mCurrentVideoFile);

         byte []的缓冲区=新的字节[1024];
         INT长;
         而((长度= fis.read(缓冲液))大于0){
               fos.write(缓冲液,0,长度);
          }
         //fis.close();
         //fos.close();
   }赶上(IOException异常E){
      // TODO:处理错误
     e.printStackTrace();
   }最后{
       尝试 {
           如果(FIS!= NULL)
              fis.close();
           如果(FOS!= NULL)
              fos.close();
       }赶上(例外E2){
        // TODO:处理异常
        e2.printStackTrace();
       }
   }
   }
....
....

 保护无效onActivityResult(INT申请code,INT结果code,意图数据){
开关(要求code){
案例CAMERA_WITH_VIDEO_DATA:
//将数据传递到上面的方法进行保存。
saveVideoFileOnActivityResult(数据);
打破;

默认:
打破;
}
}
 

I've been trying to create an app that records and uploads a video to a S3 bucket. I've been using (with a little altering) the Android capture video intent article. but when the recording is over, I get a list of errors. (I'm using a Galaxy S2 phone so it's supported).

Code for CameraActivity:

        Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
        fileUri = SavingMedia
                .getOutputMediaFileUri(SavingMedia.MEDIA_TYPE_VIDEO);
        path = fileUri.toString();

        intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 30);
        intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
        intent.putExtra(MediaStore.EXTRA_SCREEN_ORIENTATION,
                ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0.2);

        startActivityForResult(intent, CAPTURE_VIDEO_REQUEST_CODE);

LogCat output:

05-08 10:46:31.875: E/CameraInput(2595): Recording is not ready (iPeer 0xfbb3c iState 2 iWriteState 1 iClockState 0), frame dropped
05-08 10:46:31.910: E/CameraInput(2595): Recording is not ready (iPeer 0xfbb3c iState 2 iWriteState 1 iClockState 0), frame dropped
05-08 10:46:31.945: E/CameraInput(2595): Recording is not ready (iPeer 0xfbb3c iState 2 iWriteState 1 iClockState 0), frame dropped
05-08 10:46:31.975: E/CameraInput(2595): Recording is not ready (iPeer 0xfbb3c iState 2 iWriteState 1 iClockState 0), frame dropped
05-08 10:46:33.455: E/yamaha::media::Parameters(2595): SalesCode = PTR
05-08 10:46:33.705: E/CameraInput(2595): Unsupported parameter(x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value)
05-08 10:46:33.705: E/CameraInput(2595): VerifiyAndSetParameter failed on parameter #0
05-08 10:46:33.705: E/audio_input(2595): unsupported parameter: x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value
05-08 10:46:33.705: E/audio_input(2595): VerifyAndSetParameter failed
05-08 10:46:33.740: E/AndroidRuntime(29786): FATAL EXCEPTION: main
05-08 10:46:33.740: E/AndroidRuntime(29786): java.lang.NullPointerException
05-08 10:46:33.740: E/AndroidRuntime(29786):    at java.io.File.fixSlashes(File.java:205)
05-08 10:46:33.740: E/AndroidRuntime(29786):    at java.io.File.init(File.java:189)
05-08 10:46:33.740: E/AndroidRuntime(29786):    at java.io.File.<init>(File.java:139)
05-08 10:46:33.740: E/AndroidRuntime(29786):    at com.sec.android.app.camera.CamcorderEngine.renameTempFile(CamcorderEngine.java:1206)
05-08 10:46:33.740: E/AndroidRuntime(29786):    at com.sec.android.app.camera.CamcorderEngine.doStopVideoRecordingSync(CamcorderEngine.java:812)
05-08 10:46:33.740: E/AndroidRuntime(29786):    at com.sec.android.app.camera.CeStateRecording.handleRequest(CeStateRecording.java:69)
05-08 10:46:33.740: E/AndroidRuntime(29786):    at com.sec.android.app.camera.CeRequestQueue.startFirstRequest(CeRequestQueue.java:123)
05-08 10:46:33.740: E/AndroidRuntime(29786):    at com.sec.android.app.camera.CeRequestQueue.access$200(CeRequestQueue.java:32)
05-08 10:46:33.740: E/AndroidRuntime(29786):    at com.sec.android.app.camera.CeRequestQueue$MainHandler.handleMessage(CeRequestQueue.java:60)
05-08 10:46:33.740: E/AndroidRuntime(29786):    at android.os.Handler.dispatchMessage(Handler.java:99)
05-08 10:46:33.740: E/AndroidRuntime(29786):    at android.os.Looper.loop(Looper.java:123)
05-08 10:46:33.740: E/AndroidRuntime(29786):    at android.app.ActivityThread.main(ActivityThread.java:3691)
05-08 10:46:33.740: E/AndroidRuntime(29786):    at java.lang.reflect.Method.invokeNative(Native Method)
05-08 10:46:33.740: E/AndroidRuntime(29786):    at java.lang.reflect.Method.invoke(Method.java:507)
05-08 10:46:33.740: E/AndroidRuntime(29786):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
05-08 10:46:33.740: E/AndroidRuntime(29786):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
05-08 10:46:33.740: E/AndroidRuntime(29786):    at dalvik.system.NativeStart.main(Native Method)
05-08 10:46:33.770: E/(2806): Dumpstate > /data/log/dumpstate_app_error

解决方案

Buddy you should see answer of following Question, It is working for me and definitely work for you.

Android: Video Recording Throws Error

NOTE : I have same error as follows

at com.sec.android.app.camera.CamcorderEngine.renameTempFile(CamcorderEngine.java:1206)

Solution : Working in Android 2.2, 2.3 ... I have done following process to capture photo

int CAMERA_WITH_VIDEO_DATA = 2;
//start photo capture activity...

 Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE, null);
 startActivityForResult(intent, CAMERA_WITH_VIDEO_DATA);

....
....

private void saveVideoFileOnActivityResult(Intent videoIntent){
   FileInputStream fis = null;
   FileOutputStream fos = null;
   File mCurrentVideoFile = null;
   try {
         mCurrentVideoFile = new File("path_to_your_file");
         AssetFileDescriptor videoAsset = getContentResolver().openAssetFileDescriptor(videoIntent.getData(), "r");
         fis = videoAsset.createInputStream();
         //File videoFile = new File(Environment.getExternalStorageDirectory(),"<VideoFileName>.mp4"); 
         fos = new FileOutputStream(mCurrentVideoFile);

         byte[] buffer = new byte[1024];
         int length;
         while ((length = fis.read(buffer)) > 0) {
               fos.write(buffer, 0, length);
          }       
         //fis.close();
         //fos.close();
   } catch (IOException e) {
      // TODO: handle error
     e.printStackTrace();
   }finally{
       try {
           if(fis!=null)
              fis.close();
           if(fos!=null)
              fos.close();
       } catch (Exception e2) {
        // TODO: handle exception
        e2.printStackTrace();
       }
   } 
   }
....
....

 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case CAMERA_WITH_VIDEO_DATA:
//pass data to above method to save it.
saveVideoFileOnActivityResult(data);
break;

default:
break;
}
}

这篇关于试图录制视频时VerifiyAndSetParameter错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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