Monday, October 23, 2023
HomeiOS Developmentios - SceneKit help for HEVC with alpha channel

ios – SceneKit help for HEVC with alpha channel


I’m making an attempt to make use of HEVC video file with alpha channel in SceneKit. Used two completely different video recordsdata, one from apple(puppet video in asset on this apple demo) and from one other useful resource(video 2).

Pattern code:

  guard let videoURL = Bundle.important.url(forResource: "puppets_with_alpha_hevc", withExtension: ".mov") else {
        print("Filed to load film url")
        return
        
    }
    let videoNode = SKVideoNode(avPlayer: videoPlayer)
    let spriteKitScene = SKScene(dimension: CGSize(width: 360.0 / 2.0, peak: 480.0 / 2.0))
    spriteKitScene.scaleMode = .aspectFit
    videoNode.place = CGPoint(x: spriteKitScene.dimension.width / 2.0, y: spriteKitScene.dimension.peak / 2.0)
    videoNode.dimension = spriteKitScene.dimension
    spriteKitScene.addChild(videoNode)
    let materials = SCNMaterial()
    materials.diffuse.contents = spriteKitScene
    materials.clear.contents = spriteKitScene
    guard let aircraft = container.childNode(withName: "video", recursively: true) else { return }
    aircraft.geometry?.supplies = [material];
    aircraft.scale = SCNVector3(x: Float(referenceImage.physicalSize.width), y: Float(referenceImage.physicalSize.peak), z: 1.0)
    videoNode.play()

Video is performed in opposition to a reference picture in AR.

Getting this exception when making an attempt to play puppet video in SceneKit

validateFunctionArguments:3838: failed assertion `Fragment Perform(FastSingle_FragFunc): lacking sampler binding at index 0 for u_texture_sampler[0].’

For the second video , app will not be crashing however solely black opaque background with audio is seen.

Utilizing Xcode model: 14.2 and iOS model : 14.8



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments