Chocobozzz / PeerTube

ActivityPub-federated video streaming platform using P2P directly in your web browser
https://joinpeertube.org/
GNU Affero General Public License v3.0
13.16k stars 1.52k forks source link

Increase PREVIEWS_SIZE #5464

Closed RinCat closed 4 months ago

RinCat commented 1 year ago

Describe the problem to be solved

1080p monitors are already very common, and 1440p and 2160p are already plentiful. But why is the preview image of the video still only 480p JPEG that has a lot of artifacts. Especially bad for the visual effect of the live waiting UI.

https://github.com/Chocobozzz/PeerTube/blob/21e73020142635f0b1b2c8694a6b5164437954b9/server/initializers/constants.ts#L719-L729

Describe the solution you would like

I would like have a dynamic resolution from 480p to 1080p for PREVIEWS_SIZE, which image smaller than 480p got scale up to 480p, image larger than 1080p got scale down to 1080p. Keep the same resolution between 480p and 1080p.

I am OK with current THUMBNAILS_SIZE, but it looks blurry (could be I am on 4K display), maybe it can be increased to 360p or 480p.

I am also interested in adding an option to let the user decide whether to use JPEG or PNG.

ilfarpro commented 11 months ago

I also see that the miniatures are of very low quality. It is very noticeable to me that they are very compressed and have low resolution. Please let's make them better. At least x2 resolution and increase the quality. Video thumbnails are the most eye-catching ones, so it's important that they look good.

ilfarpro commented 4 months ago

@RinCat hi!

In latest version of Peertube you can define custom resolution in production.yaml just like that:

thumbnails:
  # When automatically generating a thumbnail from the video
  generation_from_video:
    # How many frames to analyze at the middle of the video to select the most appropriate one
    # Increasing this value will increase CPU and memory usage when generating the thumbnail, especially for high video>    # Minimum value is 2
    frames_to_analyze: 50

  # Only two sizes are currently supported for now (not less, not more)
  # 1 size for the thumbnail (displayed in video miniatures)
  # 1 size for the preview (displayed in the video player)
  sizes:
    -
      width: 560
      height: 317

    -
      width: 1280
      height: 720

And it works! Let's close this issue.

RinCat commented 4 months ago

https://github.com/Chocobozzz/PeerTube/issues/5618