Shivomkara Chaturvedi
Shivomkara Chaturvedi

Reputation: 1697

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

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.

Upvotes: 0

Views: 3148

Answers (2)

NIKHIL
NIKHIL

Reputation: 2719

Check the following Links

Regards, Let me know in case of queries.

Upvotes: 0

Johnykutty
Johnykutty

Reputation: 12839

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

Upvotes: 1

Related Questions