而上传视频的视频无法处理错误通知 [英] Video cannot be processed error notification while uploading a video

查看:128
本文介绍了而上传视频的视频无法处理错误通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试上传不同格式(包括.MP4和.3 gp的文件),以Facebook上的视频从我的Andr​​oid应用程序,我得到一个通知我的Facebook帐户说'您的视频无法processed.visit视频帮助页面,了解常见问题。请帮我在这。 postToWall功能发布视频到Facebook。

 私人无效postToWall(字符串accessToken){
         字符串数据路径=/mnt/sdcard/DCIM/Camera/video-2013-04-11-04-30-05.mp4;
         InputStream的是= NULL;
         byte []的数据= NULL;
         尝试 {
            是=新的FileInputStream(数据路径);
            数据=的ReadBytes(是);
        }赶上(FileNotFoundException异常E1){
            // TODO自动生成的catch块
            e1.printStackTrace();
        }赶上(IOException异常E){
            // TODO自动生成的catch块
            e.printStackTrace();
        }
        捆绑PARAMS =新包();
        params.putString(Facebook.TOKEN,mFacebook.getAccessToken());
        params.putString(文件名,Video_02.mp4);
        params.putByteArray(视频,数据);
        params.putString(的contentType,视频/ QuickTime的);
       params.putString(信息,视频信息);
        mAsyncRunner.request(ME /视频,则params,POST,新PostRequestListener(),NULL);
    }


               公众的byte []的ReadBytes(InputStream中的InputStream)抛出IOException异常{
        //这个动态延伸带你看个字节。
        ByteArrayOutputStream的ByteBuffer =新ByteArrayOutputStream();

        //这是存储重写在每次迭代与字节。
        INT缓冲区大小= 1024;
        byte []的缓冲区=新的字节[BUFFERSIZE]

        //我们需要知道如何可能字节被读取并写入到ByteBuffer的。
        INT的len = 0;
        而((LEN = inputStream.read(缓冲液))!=  -  1){
            byteBuffer.write(缓冲液,0,LEN);
        }

        //然后我们就可以回到你的字节数组。
        返回byteBuffer.toByteArray();
    }
 

解决方案

这似乎是Facebook的API或SDK(今首份报告)。

一个新的已知的bug

您可以在这里备份错误报告: http://developers.facebook.com/bugs/543903808965945

when i try to upload a video of different formats(including .mp4 and .3gp files) to facebook from my android application, i get a notification in my facebook account saying 'Your video could not be processed.visit the video help page to learn about the common problems'. Please help me on this. postToWall function post the video to facebook.

    private void postToWall(String accessToken) {        
         String dataPath = "/mnt/sdcard/DCIM/Camera/video-2013-04-11-04-30-05.mp4";
         InputStream is = null;
         byte[] data = null;
         try {
            is = new FileInputStream(dataPath);
            data = readBytes(is);
        } catch (FileNotFoundException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } 
        Bundle params = new Bundle();   
        params.putString(Facebook.TOKEN, mFacebook.getAccessToken());              
        params.putString("filename", "Video_02.mp4");
        params.putByteArray("video", data);
        params.putString("contentType", "video/quicktime");
       params.putString("message", "video message");         
        mAsyncRunner.request("me/videos", params, "POST", new PostRequestListener(), null);
    }


               public byte[] readBytes(InputStream inputStream) throws IOException {
        // This dynamically extends to take the bytes you read.
        ByteArrayOutputStream byteBuffer = new ByteArrayOutputStream();

        // This is storage overwritten on each iteration with bytes.
        int bufferSize = 1024;
        byte[] buffer = new byte[bufferSize];

        // We need to know how may bytes were read to write them to the byteBuffer.
        int len = 0;
        while ((len = inputStream.read(buffer)) != -1) {
            byteBuffer.write(buffer, 0, len);
        }

        // And then we can return your byte array.
        return byteBuffer.toByteArray();
    }

解决方案

This seems to be a new known bug of the Facebook API or SDK (first report today).

You can back the bug report here: http://developers.facebook.com/bugs/543903808965945

这篇关于而上传视频的视频无法处理错误通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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