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

Media metadata #2174

Merged
merged 9 commits into from
Sep 15, 2023
Merged

Media metadata #2174

merged 9 commits into from
Sep 15, 2023

Conversation

dennisrijsdijk
Copy link
Collaborator

@dennisrijsdijk dennisrijsdijk commented Jun 3, 2023

Description of the Change

This PR introduces better handling for video duration, removing the overlay-dependent method.
It also introduces some variables and frontendCommunicator events related to media duration.

$audioDuration and $videoDuration take a file path or URL and return the floating point duration when successful, [NO URL PROVIDED] when no URL/Path is provided and [ERROR FETCHING DURATION] when there is an error.

$youtubeVideoDuration takes a URL (eg. https://youtu.be/dQw4w9WgXcQ) or ID (dQw4w9WgXcQ) and returns the duration as an integer. When no ID or URL is provided, [NO VIDEO ID PROVIDED] is returned. [ERROR FETCHING DURATION] is returned if there's an error.

frontendCommunicator.fireEventAsync("getVideoDuration", path: string);

  • On success: returns number (seconds duration)
  • On error: returns {error: string, path: string}

frontendCommunicator.fireEventAsync("getYoutubeVideoDuration", id: string);

  • On success: returns number (seconds duration)
  • On error: returns {code: number, error: string, youtubeId: string}

Applicable Issues

#2058

Testing

Extensive testing has been done with both the variables and changes to the play video effect.

Variables

Relative paths will always cause error messages. Absolute paths are detected properly.
URLs require http:// or https:// to be prepended at all times.

Play Video Effect

The play video effect doesn't deadlock anymore if the requested overlay is not available. In addition, Youtube now works with shorts as well as regular videos. This has been tested extensively over many different video files and youtube links, including long/large video files that used to break before.

@dennisrijsdijk dennisrijsdijk marked this pull request as ready for review August 6, 2023 17:42
@itsjesski itsjesski merged commit f87e7ed into crowbartools:v5 Sep 15, 2023
1 check passed
@dennisrijsdijk dennisrijsdijk deleted the media-metadata branch July 31, 2024 10:22
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