Skip to content

Conversation

@GarbageHaus
Copy link

This update adds the --add_video_metadata option (default is False) to include the metadata of a generation in the final video output.

This works by:

  1. Generating the video.
  2. Wrapping the metadata in a JSON.
  3. Checking if FFmpeg exists and appending the metadata to the "comment" field in a temp file.
  4. Removing the original, renaming the temp file to the original name.

**Why?**🤔

  1. key/value pairs can be added arbitrarily but there may be compatibility issues with other software which might discard this.
  2. PyAV seems to lack a way of adding metadata before generating the file (I may be mistaken)
  3. If you need this, I assume FFmpeg is part of the path anyways and doesn't load any 3rd party libraries that require updates to the requirements.txt

Excluding these values can result in an INT_MAX error, something to do with PyTorch.
@kohya-ss
Copy link
Owner

Thank you for this! This is great. Please wait a little while until we merge the other PRs.

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