iPad:裁剪视频并仅播放裁剪的部分 [英] iPad: Crop the video and play cropped portion only

查看:122
本文介绍了iPad:裁剪视频并仅播放裁剪的部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以按尺寸裁剪视频并以编程方式仅播放裁剪的部分?例如,我有100x100的完整视频,但我只想播放此视频的(0,0)至(25,25)部分。我该怎么办?

Is it possible to crop the video by dimension and play only cropped portion programmatically? For an example, I have 100x100 full video but I want to play only (0,0) to (25,25) portion of this video. How could I do it?

基本上,我正在尝试实现类似于iPad视频矩阵的方法此处

Basically I am trying to implement something similar to matrix of iPads video available here.

推荐答案

此处的选项数量-自您以来通常在视图中播放视频,您可以尝试使用标准的 UIView 内容缩放模式以及对 MPMoviePlayerController的特定电影缩放模式的添加尝试正确屏蔽。您可以想象如何将电影设置为 MPMovieScalingModeFill ,将视图的帧设置为视频尺寸的两倍,然后相应地调整原点位置。

Number of options here - since you generally play video back in a view, you can attempt to use the standard UIView content scaling modes along with the specific movie scaling mode additions to MPMoviePlayerController to try and mask correctly. You can imagine how you could set the movie to MPMovieScalingModeFill, set the view's frame to double that of your video's dimensions, and then adjust the origin position accordingly.

或者您可以使用其他视图将其掩盖,甚至降低到较低水平并尝试更复杂的操作(我上面的方法谈论的是 MPMoviePlayerController ,因为这是播放视频的最高级别和最简单的方法。但是还有其他选项可以让您更好地控制。)

Or you could mask it using other views, or even go quite low level and try something a little more complex (my approach above talks about MPMoviePlayerController, because it's the highest level and easiest way to play a video back. But there are other options that give you more control).

这篇关于iPad:裁剪视频并仅播放裁剪的部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆