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

feat(server): delete unnecessary encoded videos #6027

Merged
merged 2 commits into from
Dec 28, 2023

Conversation

mertalev
Copy link
Contributor

@mertalev mertalev commented Dec 27, 2023

Description

The current transcoding behavior only allows for the creation or replacement of encoded videos, but not their deletion. This means if an admin decides to change their transcode policy after videos have been transcoded, previous transcodes will continue to exist even if the new policy doesn't require them. This PR adds a check to the transcoding job handler to delete encoded videos in cases where there is an existing transcode despite the current policy.

Fixes #5873

How Has This Been Tested?

  1. Inspect the encoded-video directory with find encoded-video -name *.mp4, confirming there are videos there
  2. Set the transcode policy to disabled
  3. Run transcoding jobs for all videos
  4. Confirm that the microservices container has logs about deleting transcodes
  5. Confirm that find encoded-video -name *.mp4 does not return any videos

@alextran1502
Copy link
Contributor

alextran1502 commented Dec 28, 2023

Besides disabling policy, other policies would overwrite the transcoded videos, correct?

@mertalev
Copy link
Contributor Author

All will always overwrite existing transcodes, disabled will always delete them, and for the other policies it depends on whether the video meets the conditions to transcode. If it does, then the existing transcode gets overwritten. If not, then it gets deleted.

@alextran1502 alextran1502 merged commit a1e1f11 into main Dec 28, 2023
21 of 22 checks passed
@alextran1502 alextran1502 deleted the feat/clean-up-transcodes branch December 28, 2023 05:34
martabal pushed a commit that referenced this pull request Jan 9, 2024
* delete unnecessary transcodes

* added test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean up unnecessarily transcoded videos
2 participants