Major bugfix for clip creation
Merge Request Guidelines
- Please fill this form out to the best of your ability.
- Follow the principle of "One Merge Request, One Concern"
- Merge Requests must be complete in total.
- Contributed Code must be universal in scope, ie: Able to be used for all installs / install environments.
Description
- Removes the "ffmpeg-python" package and replaces all of the few usages of it with subprocess.call.
- Peforms a few steps in "dbFixes" and "systemFixes" to complete the generation of clips that were affected by this bug.
- Re-organizes some code in videoFunc.
Motivation and Context
The bug was that when generating a new clip:
- The clip's DB record was successfully generated, but missing a few key items.
- After having generated the initial clip record, it failed to perform the next step to generate the clip's files and then update the clip's DB record with the file paths.
- The result is a clip with metadata, but with no files, and NULL file paths in the DB record itself.
The cause of this was that the "ffmpeg-python" package was failing to detect the FFMPEG program, after OSP had started using Venvs, and thus OSP was using an environment that may or may not include ffmpeg itself.
ffmpeg-python was used in only two spots: generating the clip .mp4, and generating the clip thumbnail. Since all other executions of ffmpeg are done with subprocess.call, I figured it would be best to bring back the subprocess.call() lines used to perform the operations that the ffmpeg-python package was being used for, and fully remove ffmpeg-python.
How Has This Been Tested?
Tested on a test instace of OSP made for testing and experimentation.
- The "ffmpeg-python" is uninstalled from the venv, and the folders are removed from the venv's "site-packages" folders.
- Creating a clip manually:
- The new clip is now fully generated.
- It has a DB record with all the appropriate metadata.
- Its files are located in the appropriate folder
- A "New Clip Created" message is written to the Admin System Logs.
- The appropriate folder is created if it does not already exist.
- The new clip is now fully generated.
- Deleting a clip manually:
- Clip's files are gone.
- Clip's DB record is gone.
- "Clip Deleted - ID #" admin system log message is printed.
- If the clip happens to have NULL values for videoLocation, thumbnailLocation, or gifLocation, it can still be deleted.
- The new DB sanity check procedure in dbFixes.
- Any Clip record that has a videoLocation, or thumbnailLocation, or gifLocation that is NULL, will have those NULL values updated with the appropriate paths.
- The new "resolveBrokenClips" procedure in systemFixes.
- If necessary, the clips folder for a channel is created if it does not already exist.
- Missing clip files for clips are fully generated if the source video still exists.
- Changing a Video's metadata still works as expected.
Screenshots (if appropriate):
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
-
My code follows the code style of this project. -
Merge Request Follows the Merge Request Guidelines -
My change requires a change to the documentation. -
I have updated the documentation accordingly.
Edited by Kenneth Larson