We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Low quality when recording area with 3D model

Home Forums Programming Low quality when recording area with 3D model

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #78790
    deconstruction
    Customer

    Is there a way to increase the bitrate for recording video from a 3D window?
    The image on the saved file is very unstable and sometimes produces pixels at high file resolutions.

    This is my current screen record script.

    function runCode(app, puzzles) {
    const type = v3d.Detector.checkIOS() ? ‘video/mp4’ : ‘video/webm;codecs=avc1’
    const stream = app.renderer.domElement.captureStream()
    const recorder = new MediaRecorder(stream, { mimeType: type })

    recorder.addEventListener(‘dataavailable’, function (e) {
    const link = document.createElement(‘a’)
    link.href = URL.createObjectURL(e.data)
    link.download = ‘video.webm’
    document.body.appendChild(link)
    link.click()
    URL.revokeObjectURL(link.href)
    link.remove()
    })

    const recordBtn = parent.document.getElementById(‘recordBtn’)
    recordBtn.addEventListener(‘click’, function () {
    if (recorder.state == ‘inactive’) {
    setScreenScale(1)
    setTimeout(function () {
    recorder.start()
    }, 100)
    recordBtn.classList.add(‘stopped’)
    } else if (recorder.state != ‘inactive’) {
    recorder.stop()
    recordBtn.classList.remove(‘stopped’)
    }
    })

    function setScreenScale(factor) {
    app.renderer.setPixelRatio(factor)
    if (app.postprocessing) app.postprocessing.composer.setPixelRatio(factor)
    app.onResize()
    }
    }

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.