zhanghai / zhanghai/MaterialFiles

Thumbnail generation over SFTP extremely slow with large video folders

Open
#1,503 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
9k
Forks
736
PR merge metrics
No merged PRs in 30d

Description

Hi. I am hosting a sftp server on my computer and store my films in there. On my phone I am using material file explorer as sftp client. When I open the films folder on my phone network usage spikes to 12Mb/s and nothing loads for a few minutes untill all the thumbnails are created. I dont want to disable thumbnails. I guess the app is trying to fetch big chunk of the video files to create the thumbnails. Can we make the thumbnail creation less resource hungry?

I tried changing the videoFramePercent to 1.0/100.0 and also to 0.0 but it is still taking a long time.

val framePercent = options.parameters.videoFramePercent() ?: (1.0 / 3.0)

I also tried changing the OPTION_CLOSEST_SYNC to OPTION_NEXT_SYNC but still its taking a long time to create thumbnails for a folder with a lot of big videos.

val frameOption = options.parameters.videoFrameOption() ?: MediaMetadataRetriever.OPTION_CLOSEST_SYNC

VideoFrameFetcher.kt

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with app/src/main/java/me/zhanghai/android/files/coil/VideoFrameFetcher.kt, especially the videoFramePercent and videoFrameOption handling described in the issue. Reproduce thumbnail loading for a large video folder over SFTP and trace how frame extraction affects network usage. Done means thumbnails remain enabled while the folder loads without fetching unnecessarily large portions of remote videos.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.