Looking into AWS elastic transcoder, and have a few questions:
Is there significant value using the transcoder in the first place, for my use case? I'm making an ios app that allows users to select a video. When they do this I'm uploading it to an S3 bucket. As I understand it, I should use elastic transcoder to then transcode those videos and drop them in a second bucket in hls format. Does this make sense, or would I be just as well off eliminating the transcoding step since I'm only creating content on ios devices and then streaming it on ios devices?
Assuming there is some value to doing the pipeline jobs, I have an implementation question: if I'm using the ios SDK is there a way to get around the manual creation of the http authorization header specified in the elastic transcoder request docs? I don't see any methods specific to the transcoder when I'm working in xcode, but I'm just wondering if there is some way to use something like AWSRequest (as opposed to NSMutableURLRequest) that would save me the trouble of making the authorization key. I looked through a whole bunch of documentation, including the ios SDK sample projects, but did not see anything like AWSRequest being used. Please help point me in the right direction!
Code: I've already built the json structure for the body of the request based on the documentation here: http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/making-http-requests.html#http-request-header Here is as far as I got before I ran into the complexity of the authorization header:
println("my json: \(jsonRequestString)")
var dateFormatter:NSDateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "yyyyMMdd'T'HHmmss'Z'"
var dateString = dateFormatter.stringFromDate(date)
println("dateString: \(dateString)")
var elasticTranscoderURLString:String = "elastictranscoder.us-west-1.amazonaws.com"
var elasticTranscoderRequest:NSMutableURLRequest = NSMutableURLRequest(URL: NSURL(string: elasticTranscoderURLString)!)
elasticTranscoderRequest.HTTPMethod = "POST"
elasticTranscoderRequest.addValue("elastictranscoder.us-west-1.amazonaws.com", forHTTPHeaderField: "Host")
elasticTranscoderRequest.addValue("application/x-amz-json-1.0", forHTTPHeaderField: "Content-Type")
elasticTranscoderRequest.addValue(dateString, forHTTPHeaderField: "x-amz-date")
//placeholder - need to add authorization header field
//placeholder - need to add content-length header field
var requestData: NSData = jsonRequestString.dataUsingEncoding(NSUTF8StringEncoding)!
elasticTranscoderRequest.HTTPBody = requestData
var elasticTranscoderSession = NSURLSession.sharedSession()
var elasticTranscoderTask = elasticTranscoderSession.dataTaskWithRequest(elasticTranscoderRequest, completionHandler: {(elasticTranscoderData, response, error) in
println("here's the error: \(error)")
println("here's the response: \(response)")
println("I'm in the completion handler of elasticTranscoderTask")
})//end elasticTranscoderTask completion handler
elasticTranscoderTask.resume()
Obviously I get an error when I run this.
this is the closest thing to my question, but it does not have an answer: Rest call with amazon ios sdk to amazon elastic transcoder