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

Fix Scene Detection frames mismatch causes invalid frame access crashes #927

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

BoatsMcGee
Copy link

Scene Detection currently uses FFmpeg, even when the chunking method used later encodes the video with a VapourSynth script. This leads to a mismatch in the frame count and crashes on the offending chunk. Scene Detection should instead use the same decoding method as Av1an does when encoding chunks in order to avoid this mismatch.

Additionally, when testing this fix I discovered a race condition that fails scene detection when retrieving the frame count in a thread. I don't fully understand why this occurs but moving the resolution of that thread before scene detection starts resolves that race condition.

This issue can be replicated by improperly cutting a lossless clip and using that as the input while specifying a chunking method that generates/uses a VapourSynth script.

As a workaround, users can instead input a VapourSynth script instead of the clip itself and the Scene Detection should perform the same function as this PR.

Thank you,
- Boats M.

Boats McGee added 2 commits February 24, 2025 10:42
Fix Scene Detection uses incompatible decode method leading to accessing invalid frames
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.

1 participant