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

Add the movieFragmentInterval value to the recording feature. #1561

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

shogo4405
Copy link
Owner

Description & motivation

  • It possible to specify the movieFragmentInterval to recover from crashes or unintended task termination.

Type of change

  • New feature (non-breaking change which adds functionality)

Screenshots:

@shogo4405 shogo4405 changed the base branch from main to release/1.9.x September 8, 2024 07:59
@shogo4405 shogo4405 added this to the 1.9.4 milestone Sep 8, 2024
@mkrn
Copy link

mkrn commented Sep 9, 2024

Thank you for adding this!
I'm looking at the documentation
https://developer.apple.com/documentation/avfoundation/avcapturemoviefileoutput/1387146-moviefragmentinterval
and it looks like it is 10s by default.. but the files are still sometimes unusable with crash.. was this feature disabled before?

@shogo4405
Copy link
Owner Author

I have never implemented this before, so it will be a new implementation.

There are APIs using iOS that include AVAssetWriter and AVCaptureMovieFileOutput. HaishinKit uses AVAssetWriter.

In the case of AVAssetWriter, the default value for this is set to invalid.
https://developer.apple.com/documentation/avfoundation/avassetwriter/1387469-moviefragmentinterval

@shogo4405
Copy link
Owner Author

I see, so it's unstable when it crashes. I was testing with Task Kill.
It seems like further research is needed, but for now, I believe this is the right specification and it will improve from here. I'll merge it for the time being.

@shogo4405 shogo4405 merged commit c961e24 into release/1.9.x Sep 9, 2024
1 of 2 checks passed
@shogo4405 shogo4405 deleted the feature/movieFragmentInterval branch September 9, 2024 16:01
shogo4405 added a commit that referenced this pull request Sep 9, 2024
@mkrn
Copy link

mkrn commented Sep 18, 2024

Thank you this worked! It could be even 10.0s by default
Thank you for pointing out that it was invalid in AVAssetWriter.

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

Successfully merging this pull request may close these issues.

2 participants