6

I am using google's GData API in order to upload a video to youtube from my app. The upload works fine however the quality of the video uploaded is only 360p whereas the quality of the original video is 720p.

Is this working as intended? If so is there any way around this video compression that will allow my app to upload HQ movies?

Here's the code I'm using to achieve the video upload if that's any help.

GDataYouTubeMediaGroup *mediaGroup = [GDataYouTubeMediaGroup mediaGroup];
[mediaGroup setMediaTitle:title];
[mediaGroup setMediaDescription:desc];
[mediaGroup addMediaCategory:category]; 
[mediaGroup setMediaKeywords:keywords];
[mediaGroup setIsPrivate:NO];

NSString *mimeType = [GDataUtilities MIMETypeForFileAtPath:outputURL.relativePath defaultMIMEType:@"video/quicktime"];

GDataEntryYouTubeUpload *entry;
entry = [GDataEntryYouTubeUpload uploadEntryWithMediaGroup:mediaGroup data:data MIMEType:mimeType slug:filename];

SEL progressSel = @selector(ticket:hasDeliveredByteCount:ofTotalByteCount:);
[service setServiceUploadProgressSelector:progressSel];

GDataServiceTicket *ticket;
ticket = [service fetchEntryByInsertingEntry:entry forFeedURL:url delegate:self didFinishSelector:@selector(uploadTicket:finishedWithEntry:error:)];

Brenton

Matthias Bauch
  • 89,811
  • 20
  • 225
  • 247
Brenton Morse
  • 2,567
  • 4
  • 21
  • 16
  • I have similarly uploaded 480p videos, but have not tried 720p. Its a long shot, but the biggest difference in my code is that I was using the `@"video/mp4"` mime type. – Peter DeWeese Jun 30 '11 at 02:20

1 Answers1

1

The YouTube transcoding pipeline only looks at the video file itself to determine whether HQ/HD versions of a video should be generated. It doesn't matter what you pass along with it in the gdata API call.

Things that the transcoding pipeline looks for include the video size as well as the average bit rate. A 720p video with a very low bit rate, for example, may not qualify for an HD or even an HQ encode. Sometimes an incorrectly encoded video may cause the wrong video size or bit rate to be interpreted by their transcoder, so make sure that your video encoder isn't doing anything strange.

Ziconic
  • 794
  • 6
  • 6
  • I'm having the same problem currently. Can you expand upon this a bit? Is there a way to ensure a video taken with UIImagePickerController is uploaded in 720p? – zakdances Jul 30 '12 at 21:10
  • I haven't played with the YouTube APIs in a long time but I would think that as long as you are setting up your UIImagePickerController to use the highest video quality, and the source video was taken on a 720p/1080p-capable iPhone (iPhone 4 and later), YouTube should be able to play back the uploaded video at 720p (or higher). Just make sure you are setting `imagePicker.videoQuality = UIImagePickerControllerQualityTypeHigh;`. – Ziconic Aug 11 '12 at 18:46