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

Feat 1322 Initial Prototype Code Review #6266

Closed
wants to merge 8 commits into from

Conversation

kntndrsn
Copy link
Contributor

Description

This is a prototype of the Thumbnail/Preview selection from video frame feature documented in #1322. I need some initial feedback on the design to verify this aligns with your expectations.

I've created a new ThumbnailManagerComponent with a FrameSelectorComponent component.

The Thumbnail Manager has two features:

  • Upload image - References existing file upload mechanism to update thumbnail image.
  • Select from video - Loads frame selector where user can select the frame they wish to use and click Use frame. At the moment, this calls a PUT api to update. This updates the thumbnail and preview immediately instead of waiting for the overall Update operation. This will be corrected, but I want to get alignment first that I've setup the controller and core lib code meeting your expectation.

On the back-end, I've implemented a new controller for thumbnails. Currently I just have a PUT method that gets the image and updates. Another way we could do would be to implement a GET that could return images in a compatible format to preview for the user, then update the thumbnail when the Update button for the page is clicked.

Related issues

#1322

Has this been tested?

  • 👍 yes, I added tests to the test suite
  • 💭 no, because this PR is a draft and still needs work
  • 🙅 no, because this PR does not update server code
  • 🙋 no, because I need help

Screenshots

image

image

@kntndrsn kntndrsn marked this pull request as draft March 12, 2024 16:15
@kntndrsn kntndrsn marked this pull request as ready for review March 12, 2024 16:15
@kntndrsn
Copy link
Contributor Author

@Chocobozzz Hello. I've submitted to get some feedback on the design. Would appreciate your guidance as this is my first contribution.

@kntndrsn
Copy link
Contributor Author

@Chocobozzz Hello. Just following up to see if there is anything more I can do on this request or if I'm headed in the right direction. Thanks.

@Chocobozzz
Copy link
Owner

Chocobozzz commented Mar 27, 2024

Hi @kntndrsn and sorry for the late review.

Can we imagine using the embed player instead of using directly video.js? Then we can use the embed api where we can add a method that captures a video frame using a canvas (example: https://stackoverflow.com/questions/70162503/get-frame-from-video-using-js) and send it back to the parent as an image URI (embed api code is here: https://github.com/Chocobozzz/PeerTube/blob/develop/client/src/standalone/videos/embed-api.ts)

With this method everything is built in the client so you don't need to add another route to generate the thumbnail on server side + we don't have to maintain another video.js instantiation and just use the classic peertube embed.

@kntndrsn
Copy link
Contributor Author

@Chocobozzz Thank you for the feedback. I can try this out to see how it goes.

I did experiment with grabbing a frame from the video but didn't go that way for two reasons.

  1. Small screen sizes like mobile devices will have a small viewport resulting in a lower resolution image. However, I realize that may be a niche situation, so if it works well enough, maybe that is fine.
  2. The other feature requested in Choose thumbnail/preview from a video frame #1322 was to generate some default suggested frames from which the user can select. That would require automatically scrubbing through the video to fetch.

Those points aside, this approach could simplify the code significantly, so I'll set it up in a fresh branch to see how it could be.

@lcaylat
Copy link
Contributor

lcaylat commented Mar 28, 2024

Hi,
This development is an excellent idea. This would simplify setting up a custom thumbnail. I don't know how to code but I'm willing to test it as soon as you have a piece of installable code.
Thank you both for your commitment.
(Google Traduction)

@kntndrsn kntndrsn closed this Apr 16, 2024
@Chocobozzz
Copy link
Owner

@kntndrsn Do you have any blocking points to close this PR?

@kntndrsn
Copy link
Contributor Author

No issue at this point. I have a new branch for the alternative approach recommended. I'll submit a new PR from that location. I just didn't want to leave this one hanging.

@kntndrsn kntndrsn deleted the feat-1322 branch June 4, 2024 18:20
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.

3 participants