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

[Bug] Scarce seekbar thumbnails for YouTube #215

Closed
5891 opened this issue Feb 10, 2024 · 14 comments
Closed

[Bug] Scarce seekbar thumbnails for YouTube #215

5891 opened this issue Feb 10, 2024 · 14 comments
Labels

Comments

@5891
Copy link

5891 commented Feb 10, 2024

Since installing v3.2.1 over v3.2.0, there shows only one for somewhere around every fifteen seconds. Some of them look like a cropped sprite source image. Thumbnails of other sorts appear as normal.

Regrettably though I will not be useful in any way fixing the problem, I am mollified that it is unlikely that there will be any serious dispute as to why it is related to this particular version and hope any relevant entity blesses so that a peaceful solution is discovered.

thumbnail of thumbnails at 0:00

thumbnail of thumbnails at 1:31

@InfinityLoop1308
Copy link
Owner

https://github.com/InfinityLoop1308/PipePipe/actions/runs/7854116332 fixed the issue. You can download the apk there but a new release will take more time.

@5891
Copy link
Author

5891 commented Feb 10, 2024

thumbnails within thumbnails fixed
sparse thumbnails not yet

@5891
Copy link
Author

5891 commented Feb 10, 2024

the preview used to stay on display while moving the seek position
with sparse thumbnails, the preview tends to disappear, but the time code remains

to hazard a guess, SeekbarPreviewThumbnailHolder needs to know that PicassoHelper shrinks the frameset in order to correct the arguments for Bitmap.createBitmap(), while the frameset possibly goes beyond 4000px in width or whatever it is

Edit: ok, opened embed in desktop edge and it fetched 800x450, so that was a hazard, i guess 💦

thumbnail in absentia

@5891
Copy link
Author

5891 commented Feb 14, 2024

W/SeekbarPrevThumbHolder(31465): Unable to get seekbar preview
W/SeekbarPrevThumbHolder(31465): java.lang.IllegalArgumentException: x + width must be <= bitmap.width()
W/SeekbarPrevThumbHolder(31465):        at android.graphics.Bitmap.createBitmap(Bitmap.java:804)
W/SeekbarPrevThumbHolder(31465):        at android.graphics.Bitmap.createBitmap(Bitmap.java:770)
W/SeekbarPrevThumbHolder(31465):        at org.schabi.newpipe.player.seekbarpreview.SeekbarPreviewThumbnailHolder.lambda$generateDataFrom$3(SeekbarPreviewThumbnailHolder.java:153)
W/SeekbarPrevThumbHolder(31465):        at org.schabi.newpipe.player.seekbarpreview.SeekbarPreviewThumbnailHolder$$ExternalSyntheticLambda4.get(Unknown Source:6)
W/SeekbarPrevThumbHolder(31465):        at org.schabi.newpipe.player.seekbarpreview.SeekbarPreviewThumbnailHolder.getBitmapAt(SeekbarPreviewThumbnailHolder.java:232)
W/SeekbarPrevThumbHolder(31465):        at org.schabi.newpipe.player.Player.onProgressChanged(Player.java:1915)
W/SeekbarPrevThumbHolder(31465):        at org.schabi.newpipe.views.FocusAwareSeekBar$NestedListener.onProgressChanged(FocusAwareSeekBar.java:130)
W/SeekbarPrevThumbHolder(31465):        at android.widget.SeekBar.onProgressRefresh(SeekBar.java:95)
W/SeekbarPrevThumbHolder(31465):        at android.widget.ProgressBar.doRefreshProgress(ProgressBar.java:1298)
W/SeekbarPrevThumbHolder(31465):        at android.widget.ProgressBar.refreshProgress(ProgressBar.java:1353)
W/SeekbarPrevThumbHolder(31465):        at android.widget.ProgressBar.setProgressInternal(ProgressBar.java:1418)
W/SeekbarPrevThumbHolder(31465):        at android.widget.AbsSeekBar.trackTouchEvent(AbsSeekBar.java:877)
W/SeekbarPrevThumbHolder(31465):        at android.widget.AbsSeekBar.onTouchEvent(AbsSeekBar.java:787)
W/SeekbarPrevThumbHolder(31465):        at android.view.View.dispatchTouchEvent(View.java:12513)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
W/SeekbarPrevThumbHolder(31465):        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
W/SeekbarPrevThumbHolder(31465):        at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:450)

@5891
Copy link
Author

5891 commented Feb 14, 2024

maybe either

public static RequestCreator loadSeekbarThumbnailPreview(final String url) {
    //return picassoInstance.load(url).transform(transformation);
    return picassoInstance.load(url);
}

or

// Cut out the corresponding bitmap form the "srcBitMap"
return Bitmap.createBitmap(srcBitMap, bounds[1], bounds[2],
        frameset.getFrameWidth() - 1, frameset.getFrameHeight() - 2);

since

def print_height(source_width, source_height, label='', *, inverse=True):
    notif_thumb_width = min(4000, source_width)
    width = notif_thumb_width - 1
    # https://codeberg.org/NullPointerException/PipePipeClient/src/commit/9b78286703/app/src/main/java/org/schabi/newpipe/util/PicassoHelper.java#L59
    # (int) (source.getHeight() / (source.getWidth()
    #         / (notificationThumbnailWidth - 1))),
    f_height = source_height / (source_width / (notif_thumb_width - 1))
    i_height = int(f_height)
    w_diff = width - source_width
    h_diff = i_height - source_height
    if label: tail = f'; {label}'
    print(f'{source_width}x{source_height} \u21d2 {width}x{i_height} ({w_diff}x{h_diff}; {width}x{f_height:.02f}{tail})')
    if inverse:
        print_height(source_height, source_width, label, inverse=False)
print_height(800, 450, 'embed in edge desktop')
#print_height(3840, 2160, '4K')
#print_height(7680, 4320, '8K')

prints

800x450 ⇒ 799x449 (-1x-1; 799x449.44; embed in edge desktop)
450x800 ⇒ 449x798 (-1x-2; 449x798.22; embed in edge desktop)

@InfinityLoop1308
Copy link
Owner

I rollbacked the changes. It should work now.

@5891
Copy link
Author

5891 commented Feb 16, 2024

thank you, but somehow no ci entry or commit at codeberg
wonder what i'm missing out

frameset.getFrameWidth()-1, frameset.getFrameHeight()-2
(int) notificationThumbnailWidth + 1,
...
/ (notificationThumbnailWidth + 1))),

both seem to work
at least the thumbnail portion of the floater seems to stay

result == source actually happens

@InfinityLoop1308
Copy link
Owner

@TruongTanLuc201270
Copy link

TruongTanLuc201270 commented Feb 16, 2024

Here bug this:

SM-G935F_20240216210115.mp4

VideoCapture_20240216-210130

@InfinityLoop1308
Copy link
Owner

Is this the latest version? That shouldn't happen as it is just the same code before 3.2.1🤔

@5891
Copy link
Author

5891 commented Feb 17, 2024

Before it further complicates.

My understanding is that v3.2.1 introduced the 800px width limit for "framesets", which are the concatenated seekbar preview thumbnail sprites (tiles?). All framesets beyond that limit would be reduced to 800px in width, proportionate in height. I guess that might render these patchwork thumbnails.

The first hotfix (which is not released, but only exists in the ci entry) adjusted that limit to 4000px, but has still retained the minus-one pixel reduction because it is necessary to force Android to create a new Bitmap object rather than return the passed object as is. It fixed the patchwork issue (but now that it is mentioned i'm uncertain if i really checked it; ok, no patchwork previews, but non-sparse previews, with the plus-one fix in addition to the 4000px width limit, confirmed on that nokia video; the ci build for later; ok, the second ci entry works as well on the nokia clone video, and no sparsity issue), but left the sparsity issue.

My comment mentioning the plus-one fix and the minus-two fix was based on the first hotfix, not v3.2.1 proper, elaborating on the remaining sparsity issue.

NewPipe originally introduced the minus-one pixel reduction for some devices the System UI of which crashes if the bitmap wasn't copied anew for the notification background image. It had never been applied to seekbar preview thumbnails in the first place.

@InfinityLoop1308
Copy link
Owner

InfinityLoop1308 commented Feb 17, 2024

  1. Other user reported that very large avatar crash the app, so a limit has been introduced to solve that problem. As some other thumbnails, including seekbar preview, also don't have a limit, I decided to set a limit for them.

  2. That is a mistake. At least the seekbar preview should not be resized.

  3. I first tried to increase the limit but doesn't work.

  4. Since the old code never has any issue, the safest (and probably the best) solution should be just rollback the change I made in 3.2.1. i.e. no limit for seekbar previews.

  5. I have tested the lastest CI and it works properly.

Your suggestion is very likely to be better but for stability I have to choose the safest option. Sorry for that.

Thanks for your feedback and discovery

@5891
Copy link
Author

5891 commented Feb 18, 2024

no problem
thank you for the work

@InfinityLoop1308
Copy link
Owner

Fixed in 3.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants