GPUImage2
GPUImage2 copied to clipboard
Loading a local video is somehow showing in the RenderView rotated 90 degrees
I'm trying to load a local video file into a MovieInput, then into a RenderView and it's showing up like this:
Here's how I'm loading things, testing a basic filter:
do {
let asset = assetV as! AVURLAsset
let screenSize = UIScreen.main.bounds.size
self.filterView = RenderView(frame: CGRect(x: 0, y: 0, width: screenSize.width, height: (screenSize.height - 10) * 0.4))
self.filterView.center = CGPoint(x: self.view.center.x, y: self.view.center.y - (DataBox.homeMenuHeight/4))
//self.filterView.transform = CGAffineTransform(scaleX: 0.9, y: 0.9)
self.filterView.fillMode = .preserveAspectRatio
self.filterView.orientation = .portrait
self.view.addSubview(self.filterView!)
let filter = BrightnessAdjustment()
filter.brightness = 0.1
self.player = try MovieInput(url: asset.url, playAtActualSpeed: true, loop: true)
self.player --> filter --> self.filterView!
//movie.runBenchmark = true
self.player.start()
} catch {
print("Nope")
}
Console is showing: Generating new framebuffer at size: GLSize(width: 3840, height: 2160)
Not sure why width and height seemed to be reversed. Any ideas? It also happens with 1080 and 720 videos, but doesn't happen with boomerang gifs created with Instagram. Any thoughts?
Try changing self.filterView.orientation = .portrait To .landscapeLeft or .landscapeRight
Try changing self.filterView.orientation = .portrait To .landscapeLeft or .landscapeRight
Hmm, that rotates 1080 - 4k videos correctly, but now any gif videos like those created by Instagram are sideways.