How to upload .mp4 video on facebook using graph api in objective c

主宰稳场 提交于 2020-01-03 05:36:17

问题


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];

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];

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

Please help me.


回答1:


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




回答2:


Check the following Links

  • Upload Video on facebook
  • demo

Regards, Let me know in case of queries.



来源:https://stackoverflow.com/questions/10509984/how-to-upload-mp4-video-on-facebook-using-graph-api-in-objective-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!