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

Using SCNRecorder to record a video of a specific number of seconds. #64

Open
giomurru opened this issue Dec 11, 2023 · 1 comment
Open

Comments

@giomurru
Copy link

Hi there and thank you for this awesome library,
I am trying to record a video of a 3D scene with a specific duration of a specific number of seconds, but I am not able to achieve a precise timing to the order of 10 millisecond. In some cases there's difference of 10 millisecond in the output video.
My approach is to observe the duration property of the VideoRecording object and call the finishVideoRecording when the specific amount of frames has been recorded. This seems to be working for short videos (3s, 5s, 15s).
However when duration of video is set to 60 s I get an output of 60.01 s or even 60.03 s depending on the device.
Can you please help me to understand what I am doing wrong. Is there another way to achieve this kind of precision and make independent from the device?
I have pushed in my repo an example app that's using the logic I described in this issue. The repo uses the latest SCNRecorder library but you are free to use a local development version of the library by changing the Podfile and running pod install again.
This is the link to the repo. https://github.com/giomurru/SCNRecorder-SampleApp
Thank you.

@v-grigoriev
Copy link
Collaborator

This is a really late reply 😄 .

I think it is impossible to get accurate precision with the current implementation.
The buffers processing and the pause action happen on its own thread.
When you pause you can't predict how many frames left in the queue.

So, the implementation should be changed to achieve high precision, I just didn't design the processing for this purpose.

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