Video cannot be processed error notification while

2019-04-02 13:33发布

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();
    }

1条回答
我只想做你的唯一
2楼-- · 2019-04-02 14:27

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

查看更多
登录 后发表回答