2

I'm uploading videos to a web server after choosing the video using the UIImagePickerController. However, videos shot with the camera in landscapeRight orientation are inverted on the server. I want to use AVFoundation to rotate the video before uploading. I've figured out how to get the size and preferredRotation of the video using AVAsset. Now I need to apply an affine transform to the video before uploading.

Here's an example of the size and transform from a landscapeRight video:

2011-01-07 20:07:30.024 MySecretApp[1442:307] size.width = 1280.000000 size.height = 720.000000 2011-01-07 20:07:30.027 MySecretApp[1442:307] txf.a = -1.000000 txf.b = 0.000000 txf.c = 0.000000 txf.d = -1.000000 txf.tx = 1280.000000 txf.ty = 720.000000

How would I transform the video to undo the inversion? I assume that I'd have to export the results to a new file and upload that to the webserver. I'll also have to do a similar conversion to videos shot in portrait to rotate them from landscape so that they are orientated correctly on the server.

Thanks

Alpinista
  • 3,751
  • 5
  • 35
  • 46

1 Answers1

0

How about using ffmpeg, which can be included as a library linked into your iPhone app?

Here's a duplicate question with the ffmpeg solution detailed.

Community
  • 1
  • 1
Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
  • 1
    Rather not use FFMpeg, as it requires licensing, and seems a bit difficult to get linked up, as I see a lot of people having problems. – Alpinista Oct 26 '11 at 19:26