Home › Forums › Programming › 3D window screen recording
Tagged: video recording
- This topic has 3 replies, 2 voices, and was last updated 2 hours, 46 minutes ago by deconstruction.
-
AuthorPosts
-
2024-11-15 at 4:18 am #78767deconstructionCustomer
Hello everyone. I have a question regarding recording video inside a 3D window.
I have connected a script to the project that creates a window recording with my 3D model, and after its ends saves the recording to the computer. However, the final file format is “webm”. When I change the output format inside the script to “mp4”, the file crushes.
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()
}
}What can I change here?
Thanks in advance for your answer
2024-11-15 at 4:23 am #78768deconstructionCustomerMaybe i need to change the second line to this? But i tried this and nothing changes
const type = v3d.Detector.checkIOS() ? ‘video/mp4’ : ‘video/mp4;codecs=MPEG-4’
- This reply was modified 4 hours, 19 minutes ago by deconstruction.
2024-11-15 at 5:28 am #78770domjasperCustomerI have gone down a deep rabbit whole on this. Tried hiring two different developers, one freelancer and another agency. Both of whom were not able to get a good quality screen recording downloaded as an MP4.
As far as I know it is impossible to record and download an MP4 with good quality client side.
There are a few alternative solutions, such as using a server, or an API, but it will cost you.
I wish there was a solution as it is critical to my application. If there are any developers here who have already built this functionality I will pay you to install in on my file.
2024-11-15 at 6:08 am #78787deconstructionCustomerHm. This is interesting. I thought it might be difficult, but not that much.
Thank you
-
AuthorPosts
- You must be logged in to reply to this topic.