java视频横向变竖向_如何检测视频文件是以纵向方式录制还是以横向方式录制在iOS中...

苹果开发论坛上有人建议进行视频轨道的转换,这样就可以了 . 您可以从下面的日志中看到,对于这些方向,结果是有意义的,我们的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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值