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

Video Trimming: Reuse existing resource if exists #9333

Closed
barklund opened this issue Oct 8, 2021 · 8 comments
Closed

Video Trimming: Reuse existing resource if exists #9333

barklund opened this issue Oct 8, 2021 · 8 comments
Labels
Elements: Video Group: Canvas Group: Media Group: Video Optimization Media transcoding, compression and cropping P3 Nice to have Type: Enhancement New feature or improvement of an existing feature

Comments

@barklund
Copy link
Contributor

barklund commented Oct 8, 2021

Feature Description

A user might end up with multiple completely identical copies of the same media element in the library for no good reason.

Scenario 1

  • You have an original video of 60-second duration and place two instances of it on the canvas
  • You trim the first instance to exactly the first 30 seconds
  • You also trim the second instance to exactly the first 30 seconds
  • This will result in adding two new elements to the media library which are completely identical

Scenario 2

  • You have an original video of 60-second duration and place an instance of it on the canvas
  • You trim it to 30 seconds
  • You then re-trim that to the original full 60 seconds
  • This will result in a completely identical copy to the original video in the media library

#### Scenario 3

  • You have an original non-muted video and place two instances of it on the canvas
  • You mute the first instance
  • You also mute the second instance
  • This will result in adding two new elements to the media library which are completely identical

-> handling muted videos is covered by #9385

We should be able to reuse existing resources of videos where possible.

This arose from a discussion in #9315.

@barklund barklund added Type: Enhancement New feature or improvement of an existing feature P2 Should do soon Elements: Video Group: Canvas Pod: Prometheus Group: Workspace A group encompassing all of workspace – everything inside the canvas and sidebar Group: Video Optimization Media transcoding, compression and cropping labels Oct 8, 2021
@swissspidy
Copy link
Collaborator

Scenario 1

Given that trimming is based on milliseconds, isn't it extremely unlikely that you trim a video exactly to 30 seconds twice?

Scenario 2

Should we have some "Restore full length version" button or something so you can more easily get the original length video? That would make it easier to prevent this scenario.

Scenario 3

The result is not ideal but negligible IMO. We could probably do something on the server-side to try to find whether a suitable version already exists, but not trivial. Would be good to first see how big of a problem that is before digging into this.

@swissspidy swissspidy changed the title Video transcoding: Reuse existing resource if exists Video Trimming: Reuse existing resource if exists Oct 12, 2021
@swissspidy
Copy link
Collaborator

Scenario 3

Thinking about this, is this actually happening right now?

Both videos will have the same resource ID and useProcessMedia uses updateElementsByResourceId so all instances of the same video within a story will be updated accordingly to use the muted version.

I think a more realistic scenario is:

  • You have an original non-muted video and place it on the canvas
  • You mute it
  • You create a new story and place the original non-muted video on the canvas
  • You mute it
  • This will result in another muted version being created instead of just using the original

@swissspidy swissspidy added Group: Canvas Group: Media and removed Pod: Prometheus Group: Workspace A group encompassing all of workspace – everything inside the canvas and sidebar Group: Canvas labels Oct 12, 2021
@swissspidy
Copy link
Collaborator

Created #9384 and #9385 to handle optimized and muted videos. That would be a bit easier to implement than finding the right trimmed version.

@swissspidy
Copy link
Collaborator

cc @spacedmonkey for thoughts

It still seems very unlikely that a video for a very specific trimming config (start and end time) already exists, but if it's easy to implement we could definitely do that.

@spacedmonkey
Copy link
Contributor

It still seems very unlikely that a video for a very specific trimming config (start and end time) already exists, but if it's easy to implement we could definitely do that.

No, the likelyhood that the trim would be exactly the same, seem highly unlikely. It is also work noting, that is no simple way to get all the trim of a video. Each trimmed video has a piece of post media. To get a list of trimmed video from the original would require a meta query. Not possible at the moment, but we could add this functionality.

How about adding a "Restore original" on trimmed videos? This would allow you to easily go back to the orignal video. meaning you would not have to retrim?

@swissspidy
Copy link
Collaborator

Alright, then I think we can close this as a wontfix.

How about adding a "Restore original" on trimmed videos? This would allow you to easily go back to the original video. meaning you would not have to retrim?

No need for a restore button if the user can just reset the trimming to get back to the full length.

@barklund Does the video trimmer reuse the original video if there is 0 offset?

@barklund
Copy link
Contributor Author

barklund commented Feb 2, 2022

@barklund Does the video trimmer reuse the original video if there is 0 offset?

I am pretty sure that it does not do that. We could repurpose this ticket for that work, because that definitely makes sense.

@swissspidy
Copy link
Collaborator

Let's do that then! 👍

@swissspidy swissspidy added P3 Nice to have and removed P2 Should do soon labels Feb 28, 2023
@swissspidy swissspidy closed this as not planned Won't fix, can't repro, duplicate, stale May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Elements: Video Group: Canvas Group: Media Group: Video Optimization Media transcoding, compression and cropping P3 Nice to have Type: Enhancement New feature or improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants