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

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

Open
cosmicsalad opened this issue Dec 14, 2018 · 2 comments

Comments

@cosmicsalad
Copy link

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?

@Topwiz
Copy link

Topwiz commented Dec 15, 2018

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

@cosmicsalad
Copy link
Author

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.

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