苹果开发论坛上有人建议进行视频轨道的转换,这样就可以了 . 您可以从下面的日志中看到,对于这些方向,结果是有意义的,我们的Web开发人员现在能够旋转各种视频,以便它们全部匹配并将它们合成为一个视频 .
AVAssetTrack* videoTrack = [[avAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0];
CGSize size = [videoTrack naturalSize];
NSLog(@"size.width = %f size.height = %f", size.width, size.height);
CGAffineTransform txf = [videoTrack preferredTransform];
NSLog(@"txf.a = %f txf.b = %f txf.c = %f txf.d = %f txf.tx = %f txf.ty = %f", txf.a, txf.b, txf.c, txf.d, txf.tx, txf.ty);
使用普通凸轮使用4个iPhone 4视频记录:(1)右侧的横向凸轮(左侧的主页按钮)(2)横向左侧(3)纵向上下颠倒(4)纵向右侧(主页按钮位于底部)
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 2011-01-07 20:07:45.052 MySecretApp [1442:307] size.width = 1280.000000 size.height = 720.000000 2011-01-07 20:07:45.056 MySecretApp [1442:307] txf.a = 1.000000 txf.b = 0.000000 txf.c = 0.000000 txf.d = 1.000000 txf.tx = 0.000000 txf.ty = 0.000000 2011-01 -07 20:07:53.763 MySecretApp [1442:307] size.width = 1280.000000 size.height = 720.000000 2011-01-07 20:07:53.766 MySecretApp [1442:307] txf.a = 0.000000 txf.b = -1.000000 txf.c = 1.000000 txf.d = 0.000000 txf.tx = 0.000000 txf.ty = 1280.000000 2011-01-07 20:08:03.490 MySecretApp [1442:307] size.width = 1280.000000 size.height = 720.000000 2011-01- 07 20:08:03.493 MySecretApp [1442:307] txf.a = 0.000000 txf.b = 1.000000 txf.c = -1.000000 txf.d = 0.000000 txf.tx = 720.000000 txf.ty = 0.000000