gpt4 book ai didi

ios - AVAsset 维度 : track's naturalSize is not the size off the exported video

转载 作者:行者123 更新时间:2023-11-28 10:11:25 35 4
gpt4 key购买 nike

我正在使用 AVFoundation,从用户的库中导入视频。

我需要真实视频的尺寸。在我的 iPhone 7 上进行屏幕录制后,视频大小应该是 (750.0, 1334.0)。使用 AVAsset track 的 naturalSize 时,我总是得到 (720.0, 1280.0)

如何获得真实视频维度?

这是我使用的代码:

guard let track = tracks(withMediaType: AVMediaType.video).first else { return .zero }
return track.naturalSize.applying(track.preferredTransform)

最佳答案

使用 iOS 设备录制的视频将根据您在 Settings > Camera > Record Video 中设置的设置调整大小,并忽略设备的屏幕分辨率。

关于ios - AVAsset 维度 : track's naturalSize is not the size off the exported video,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47929233/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com