GPUImage2 icon indicating copy to clipboard operation
GPUImage2 copied to clipboard

Loading a local video is somehow showing in the RenderView rotated 90 degrees

Open cosmicsalad opened this issue 6 years ago • 2 comments

I'm trying to load a local video file into a MovieInput, then into a RenderView and it's showing up like this: photo dec 14 12 36 44 pm

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?

cosmicsalad avatar Dec 14 '18 20:12 cosmicsalad

Try changing self.filterView.orientation = .portrait To .landscapeLeft or .landscapeRight

Topwiz avatar Dec 15 '18 05:12 Topwiz

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.

cosmicsalad avatar Dec 17 '18 22:12 cosmicsalad