{"action":"opened","issue":{"url":"https://api.github.com/repos/rFlex/SCRecorder/issues/351","repository_url":"https://api.github.com/repos/rFlex/SCRecorder","labels_url":"https://api.github.com/repos/rFlex/SCRecorder/issues/351/labels{/name}","comments_url":"https://api.github.com/repos/rFlex/SCRecorder/issues/351/comments","events_url":"https://api.github.com/repos/rFlex/SCRecorder/issues/351/events","html_url":"https://github.com/rFlex/SCRecorder/issues/351","id":180237026,"number":351,"title":"Orientation changes when filter is applied on a video in iphone 6s","user":{"login":"amrit42087","id":11562827,"avatar_url":"https://avatars.githubusercontent.com/u/11562827?v=3","gravatar_id":"","url":"https://api.github.com/users/amrit42087","html_url":"https://github.com/amrit42087","followers_url":"https://api.github.com/users/amrit42087/followers","following_url":"https://api.github.com/users/amrit42087/following{/other_user}","gists_url":"https://api.github.com/users/amrit42087/gists{/gist_id}","starred_url":"https://api.github.com/users/amrit42087/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amrit42087/subscriptions","organizations_url":"https://api.github.com/users/amrit42087/orgs","repos_url":"https://api.github.com/users/amrit42087/repos","events_url":"https://api.github.com/users/amrit42087/events{/privacy}","received_events_url":"https://api.github.com/users/amrit42087/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-30T07:20:05Z","updated_at":"2016-09-30T07:20:05Z","closed_at":null,"body":"I tried saving a video after applying filters to it. The orientation of the output file is changed. However when I save the video with no filter, it saves in correct orientation. This issue occurs on iphone 6s, however works perfectly on iphone. \r\n\r\nNOTE: It only rotates the video when filters are applied and the device is iphone 6 or higher.\r\n\r\nThis is the code for saving the output file:\r\n\r\n        self.view.lock()\r\n        \r\n        let currentFilter = filterView.filter?.copy()\r\n        \r\n        player.pause()\r\n        \r\n        let videoAsset = AVAsset(url: videoUrl!)\r\n        \r\n        let documentsDirectory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]\r\n        let filteredVideoUrl = documentsDirectory.appendingPathComponent(\"filteredVideo.mp4\")\r\n        \r\n        let exportSession = SCAssetExportSession(asset: videoAsset)\r\n        exportSession.videoConfiguration.filter = currentFilter as! SCFilter?\r\n        exportSession.videoConfiguration.preset = SCPresetHighestQuality\r\n        exportSession.audioConfiguration.preset = SCPresetHighestQuality\r\n        exportSession.videoConfiguration.maxFrameRate = 35\r\n        exportSession.outputUrl = filteredVideoUrl\r\n        exportSession.outputFileType = AVFileTypeAppleM4V\r\n        exportSession.delegate = self\r\n        exportSession.contextType = SCContextType.auto\r\n        \r\n        let time = CACurrentMediaTime()\r\n\r\n        exportSession.exportAsynchronously(completionHandler: {() -> Void in\r\n            \r\n            if !exportSession.cancelled {\r\n                print(\"Completed compression in \\(CACurrentMediaTime() - time)\")\r\n            }\r\n            \r\n            let error = exportSession.error\r\n            \r\n            if exportSession.cancelled {\r\n                self.view.unlock()\r\n                print(\"Export was cancelled\")\r\n            }\r\n                \r\n            else if error == nil {\r\n                \r\n                AudioVideoEditor().saveToLibrary(url: exportSession.outputUrl!) { (success, error) in\r\n                                    self.view.unlock()\r\n                                    if success {\r\n                                        self.showAlert(title: \"Success\", message: \"Successfully saved to camera roll\")\r\n                                    }else {\r\n                                        if error != nil {\r\n                                            self.showAlert(title: \"Error\", message: error!.localizedDescription)\r\n                                        }\r\n                                    }\r\n                                    \r\n                        }\r\n                \r\n            }\r\n            else {\r\n                self.view.unlock()\r\n                if !exportSession.cancelled {\r\n                    self.view.unlock()\r\n                    UIAlertView(title: \"Failed to save\", message: (error?.localizedDescription)!, delegate: nil, cancelButtonTitle: \"OK\", otherButtonTitles: \"\").show()\r\n                }\r\n            }\r\n            \r\n        })\r\n\r\nHere are the videos saved with and without filters applied:\r\nWithout Filter:\r\nhttps://vid.me/tilP\r\n\r\nwith Filter\r\nhttps://vid.me/hOdZ\r\n\r\nAlso the video is zoomed a lot when filters are applied. I also tried changing the videoconfiguartion.scale = AVVideoScalingModeResizeAspect. The zoom is fixed but orientation still changes.\r\n\r\n"}}
{"actor":{"display_login":"amrit42087"}}