h5ai icon indicating copy to clipboard operation
h5ai copied to clipboard

Thumbnail generation for short (<2sec) video files.

Open RomeSilvanus opened this issue 7 years ago • 2 comments

As stated in the title. I have a folder with a few dozen WebM files, most of these are around 1-5 seconds long. The FFMPEG config is set to generate a thumbnail at the 5 second mark (because I still have a lot of movie length video files and don't want black thumbnails). This leads to a lot of files being without thumbnails. Which together with the naming scheme is not really helpful to find out what the content of the file is.

My suggestion, if possible, would be to:

  • Include an option to, if the file is below the mark set in the config, make FFMEPG take a thumbnail from the last second of the video file.
  • If the video file is shorter than set in the config, take a thumbnail from the middle of the video file.
  • Include an option to set different times for different video lengths
    e.g.:
    • Video file is up to 5 seconds: Take a thumb at the 3 second mark
    • Video file is up to 10 seconds: Take a thumb at the 5 second mark
    • Video file is up to 1 minute: Take a thumb at the 10 second mark
    • Video file is up to 20 minutes: Take a thumb at the 1 minute mark

Just an idea I had because, as I said, I have a lot of video files ranging from 1 second to over two hours.

RomeSilvanus avatar Aug 10 '16 12:08 RomeSilvanus

Furthermore I might add that it doesn't generate thumbnail for some WebM files at all when they are shorter than the mark set in the config. In that case I can watch the process run and generate thumbnails in htop but h5ai will just throw a 504 after some time and never display any thumbnails. Unless I set the time in the config lower than the video file is long (e.g. 1 second), then it suddenly works.

Example:

  • WebM files: 2 seconds long
    Config: 5 seconds
    h5ai is timing out with a 504 and doesn't display thumbnails for all files (including the ones longer than 5 seconds)
  • WebM files: 1 seconds long
    Config: 1 second
    h5ai generates and displays the thumbnail normally

If I set them config to 1 second, let it generate al the thumbnails, and then set it back to 5 seconds it of course works normally and displays the already generated thumbnails.

RomeSilvanus avatar Aug 10 '16 13:08 RomeSilvanus

This is fixed in #765 and #769. Thumbnails for video files are generated from the frame found at 50% of the total video duration by default, but there is the option to change that value.

glubsy avatar Nov 29 '20 18:11 glubsy