OvenMediaEngine icon indicating copy to clipboard operation
OvenMediaEngine copied to clipboard

Thumbnail improvements

Open naanlizard opened this issue 2 years ago • 4 comments

Is your feature request related to a problem? Please describe. This is partly a request for clarification in the docs as well as features.

For our purposes, input streams may be arbitrary aspect ratios. This means that for creating thumbnails, we need to not adjust the aspect ratio at all. This can be done either by taking a thumbnail of the stream and using black bars to fill in empty space (rather than stretch), taking the thumbnail as the maximum dimension that fits in the target thumbnail size, taking a full size screenshot, or some other method.

This second mode is used already in OME for video transcoding - see here and perhaps can be easily added to the thumbnailer, or may already work that way - if so, the documentation should be updated to describe that

Additionally, again for our purposes we do not need thumbnails more frequently than 5 seconds at most. Perhaps this can already be done, but it is not clear in the documentation here whether you can input fractional and/or decimal values.

Lastly, it would be useful to have multiple thumbnail providers for multiple sizes we may need - full size is one of the more common sizes we need, but also smaller thumbnails and sometimes medium size. I think this is already possible, and if it is, I will make a PR to update the gitbook

naanlizard avatar Nov 13 '21 15:11 naanlizard

In FFMPEG you could use this filter to pad it to an aspect ratio of your choosing (just set the resolution)

-vf scale=256:144:force_original_aspect_ratio=decrease,pad=256:144:-1:-1:color=black

I agree it would be cool if OME just gave us thumbnails in their native aspect ratio, where the size dimensions provided are treated as a maximum size rather than an absolute size.

bchah avatar Nov 14 '21 13:11 bchah

Yes, we do something similar with ffmpeg and a cronjob, but this isn't a clean solution and it would be nice if we could just pull a thumbnail from OME (whether by http or not)

naanlizard avatar Nov 14 '21 21:11 naanlizard

@naanlizard

Thanks for the great report.

Like the video scaling option, the thumbnail image can be rescaling while keeping the aspect ratio. see the example below. However, it does not support the option to keep the aspect ratio along with the margins for certain resolutions.

<Image> <Codec>jpeg</Codec> <Width>320</Width> <Framerate>0.2</Framerate> </Image>

It's not clearly written in the manual, but if you want to generate a thumbnail image once every 5 seconds. try setting 0.2 as in the example above. It is an option to generate 0.2 images per second.

I would be very grateful if you could PR about the insufficient contents of the gitbook.

Thanks.

Keukhan avatar Jan 17 '22 08:01 Keukhan

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 02 '22 13:06 stale[bot]