本文介绍了如何在Facebook上使用图形API在.c4上传.mp4视频c的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Graph API在Facebook上上传视频。我可以上传.wmv格式的视频,但不能.mp4。我的代码如下

I am using Graph API to upload video on facebook. I am able to upload .wmv format video but not .mp4. My code is as below

strVidUrl=@"http://myshow.com.au/Videos/mp4s/20111216044530271247467.mp4";
    //strVidUrl=@"http://www.myshow.com.au/Videos/BossAlarm.wmv";
    NSURL *url = [NSURL URLWithString:strVidUrl];
    NSData *data = [NSData dataWithContentsOfURL:url];
    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   data, @"video.mov",
                                   @"video/mp4", @"contentType",
                                   [dicVideoDetails valueForKey:@"fld_display_name"], @"title",
                                   [dicVideoDetails valueForKey:@"fld_video_description"], @"description",
                                   nil];

如果我使用.wmv,那么代码在下面,它正在运行。

if I use .wmv then code is below and it is running.

NSURL *url = [NSURL URLWithString:@"http://www.myshow.com.au/Videos/BossAlarm.wmv"];
NSData *data = [NSData dataWithContentsOfURL:url];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               data, @"video.mov",
                               @"video/quicktime", @"contentType",
                               @"Video Test Title", @"title",
                               @"Video Test Description", @"description",
                                   nil];

两种情况下,结果相同,但是.mp4视频没有在脸书上显示。而.wmv显示在那里。

Result is comming same in both cases but .mp4 video is not showing on facebook. while .wmv is showing there.

请帮助我。

推荐答案

这可能是由于您的源视频和fb的视频格式的编解码器和压缩率的错配

That may be due to the missmatch of codecs and compression rates of your source video and fb's recomented video format

这篇关于如何在Facebook上使用图形API在.c4上传.mp4视频c的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 00:44