Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVVideoScalingModeKey doesn't work as expected #33

Open
gontovnik opened this issue Mar 4, 2021 · 1 comment
Open

AVVideoScalingModeKey doesn't work as expected #33

gontovnik opened this issue Mar 4, 2021 · 1 comment

Comments

@gontovnik
Copy link

Hello,

First of all, thank you for building and supporting this library. It saved me a significant amount of time.

Unfortunately, lately, I discovered the following issue – when I try to export the landscape video as a portrait video with the AVVideoScalingModeResizeAspectFill, it correctly crops the video horizontally, but doesn't scale it vertically. Please see the images attached below.

Original video (portrait):
Simulator Screen Shot - iPhone 11 - 2021-03-04 at 12 31

Original video (landscape):
Simulator Screen Shot - iPhone 11 - 2021-03-04 at 12 33-1

The result of compression:
Simulator Screen Shot - iPhone 11 - 2021-03-04 at 12 31-1

The expected result of compression:
Simulator Screen Shot - iPhone 11 - 2021-03-04 at 12 33

The configuration used:

let compression = [
  AVVideoAverageBitRateKey: NSNumber(integerLiteral: 1500000),
  AVVideoProfileLevelKey: AVVideoProfileLevelH264BaselineAutoLevel as String
] as [String: Any]
exporter.videoOutputConfiguration = [
  AVVideoCodecKey: AVVideoCodecType.h264,
  AVVideoWidthKey: NSNumber(integerLiteral: 720),
  AVVideoHeightKey: NSNumber(integerLiteral: 1280),
  AVVideoScalingModeKey: AVVideoScalingModeResizeAspectFill,
  AVVideoCompressionPropertiesKey: compression
]

Has anyone faced this issue or does a know a way around it?

Thank you!

@gontovnik gontovnik mentioned this issue Mar 4, 2021
@sjmueller
Copy link

We have the same exact problem! Hoping a fix comes soon, the library has been excellent otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants