Restructure ffmpeg#2392
Merged
WithoutPants merged 28 commits intostashapp:developfrom Apr 18, 2022
Merged
Conversation
Collaborator
PR seems ok and tests ok.Edit: Updated after
|
bnkai
reviewed
Apr 16, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Significant refactor of the
ffmpegpackage. Focus here was on making a more consistent and reusable package interface.Changes include:
stripExtparameter fromNewVideoFilesince this was used during scanning onlyfsutil.ReadLockManagerto replace running stream checking code. Allows clients to "lock" a particular file for reading. When an operation requires to delete a file, it runsCancelon all of the running lock contexts before returning to allow deletion.ffprobeexecution when stream transcoding files. Should improve performance.ffmpegscene/generatepackageffmpeg/transcoderpackage to expose basic video and image manipulation functions:Transcode(re-encodes or copies a video with optional start time and duration),Splice(combines video files using a concat file),Screenshot(takes a screenshot at a given position),ImageThumbnail(makes a thumbnail of an image).JSONTimeintomodels/jsonpackage so thatffmpegdoes not depend onmodels.hash/videophashpackage. This should help formalise the algorithm.ffmpegfor argument buildingMost public interfaces are now documented according to godoc specs. The only thing that's still in a halfway state is the sprite generation stuff, which will need another refactor pass in future.
Biggest things to consider with this change are ensuring phash generation is consistent with the existing behaviour, ensuring all generation operations work correctly, ensuring live transcoding continues to work and that scene deletion follows existing behaviour with respect to running streams.