1.3/1.4 UI bug - Video preview often black

*** Please report new bugs here! ***

Moderators: XnTriq, helmut, xnview, Dreamer

thany2
Posts: 63
Joined: Mon Apr 29, 2013 9:29 am

1.3/1.4 UI bug - Video preview often black

Post by thany2 »

Prerequisites:

* Enable dark mode
* Have a preview pane visible
* Have a file list visible
* Tabs are hidden
* Status bar is visible

(not sure which of these matter, if any)

To reproduce:

1. Switch to thumbnail view in the file list
2. Now make sure to get into a folder with losts of MP4 files
3. Let it load thumbnails
4. select any MP4, and arrow-key through them one by one.

Actual result:

Most MP4 files show a black frame in the preview pane, while they don't have a first black frame at all. Some do show a first frame. It is seemingly random which ones do show a frame. It is also not consistent which videos do and don't. One may sometimes show its frame, other times it won't. Thereby I reckon that posting any one such video is not useful.

Desired result:

Every selected video shows its first frame in the preview pane.

Additional context:

This must've been introduced recently. I think in at least version 1.0 this worked fine. Possibly later as well.
Also good to know I'm on Windows 10.
Videos don't autoplay for me. That's good, but I'm just saying because I think there's an option or en-/disable this.

Workaround:

There are three workarounds available, two with a huge disadvantage:

1. Make the preview pane change in size. Even one pixel makes it suddenly show that first video frame it was supposed to show. Kind of like forcing a redraw or something.
2. Hit Enter on a video file to fullscreen it (at least that how I've set op XnView) without playing it. This exposes another bug: the video file will be locked (i.e. cannot be deleted) until XnView is closed completely.
3. Arrow-key through video's while holding Shift. This inexplicably makes it draw that video frame in the preview.
Last edited by thany2 on Wed Feb 08, 2023 8:03 pm, edited 1 time in total.
Using Windows 10 21H1 and loving it. Cheers!
User avatar
xnview
Author of XnView
Posts: 43132
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 1.3 UI bug - video preview oftenly black

Post by xnview »

'auto play' is off?
Pierre.
thany2
Posts: 63
Joined: Mon Apr 29, 2013 9:29 am

Re: 1.3 UI bug - video preview oftenly black

Post by thany2 »

Sure thing.
Using Windows 10 21H1 and loving it. Cheers!
eMeM
Posts: 5
Joined: Wed Oct 05, 2022 12:46 pm

Re: 1.3 UI bug - video preview oftenly black

Post by eMeM »

Just two notes:
Preview window should be detached.
The bug also affects Win7.
Cheers
User avatar
xnview
Author of XnView
Posts: 43132
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 1.3 UI bug - video preview oftenly black

Post by xnview »

when preview is attached, no problem?
Pierre.
eMeM
Posts: 5
Joined: Wed Oct 05, 2022 12:46 pm

Re: 1.3 UI bug - video preview oftenly black

Post by eMeM »

Yes
User avatar
xnview
Author of XnView
Posts: 43132
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 1.3 UI bug - video preview oftenly black

Post by xnview »

i can't reproduce, could you send me your xnview.ini?
Pierre.
eMeM
Posts: 5
Joined: Wed Oct 05, 2022 12:46 pm

Re: 1.3 UI bug - video preview oftenly black

Post by eMeM »

Regards
You do not have the required permissions to view the files attached to this post.
User avatar
xnview
Author of XnView
Posts: 43132
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 1.3 UI bug - video preview oftenly black

Post by xnview »

could you send me a mp4 with black frame, and one with correct frame?
Pierre.
eMeM
Posts: 5
Joined: Wed Oct 05, 2022 12:46 pm

Re: 1.3 UI bug - video preview oftenly black

Post by eMeM »

No, you'll need some samples without black frames to reproduce.
Just carefully read the message from thany2.
These files will do:
https://file-examples.com/index.php/sam ... mp4-files/
Download them.
User avatar
xnview
Author of XnView
Posts: 43132
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 1.3 UI bug - video preview oftenly black

Post by xnview »

ok i can reproduce sometimes with dettached preview
Pierre.
thany2
Posts: 63
Joined: Mon Apr 29, 2013 9:29 am

Re: 1.3 UI bug - video preview oftenly black

Post by thany2 »

xnview wrote: Thu Oct 06, 2022 6:25 am when preview is attached, no problem?
Yes problem :)

I didn't even know it can be detached.
eMeM wrote: Wed Oct 12, 2022 5:58 am No, you'll need some samples without black frames to reproduce.
Exactly. It doesn't matter which videos you use for testing. Problem can be reproduced (or not) *seemingly randomly*.
Using Windows 10 21H1 and loving it. Cheers!
thany2
Posts: 63
Joined: Mon Apr 29, 2013 9:29 am

Re: 1.3 UI bug - video preview oftenly black

Post by thany2 »

Yes, fixed. Mostly. However, the fix possibly introduced a new bug: it plays the tiniest fraction of the video when displaying it, probably to force the video to draw its frame. But it also plays audio. So videos that immediately start with some sort of audio, now cause an audible "click" from the first 1/30th second of audio. This also makes going through the file list quite sluggish.

Some, but fewer, videos still show a black frame. Reselecting works around this problem. And so does shift+selecting it.

Looks like the problem still exists like it always did, but you've included a workaround to "force" a frame to be drawn. But because it's a workaround (and from the looks of it not a very graceful one at that) it still doesn't fix it for each preview.

Here's a different take: video thumbnails are being generated very fast. And it works every time (as long as it doesn't crash, I'm testing that one too). So why not use that very same mechanism in order to show a video's first frame in the preview pane? Seems like all you'd have to do is some good ol' copypaste mechanics and bob's your uncle :)
Using Windows 10 21H1 and loving it. Cheers!
thany2
Posts: 63
Joined: Mon Apr 29, 2013 9:29 am

Re: 1.3 UI bug - video preview oftenly black

Post by thany2 »

Ok, so no, it's not actually fixed.

Problem persists in 1.4.2.

Workaround remains the same as well. Which by all means really *is* a workaround, as it's quite inconvenient, and doesn't work 100% anyway.

Also worthy of note (and fixing), there's now a very noticable lag between selecting a video, and its preview displaying.

(changed topic title to be more relevant, not sure if it helps anyone though :) )
Using Windows 10 21H1 and loving it. Cheers!
thany2
Posts: 63
Joined: Mon Apr 29, 2013 9:29 am

Re: 1.3/1.4 UI bug - Video preview often black

Post by thany2 »

Just wanted to mention this issue still exists in 1.4.4. Nothing seems to have changed in this regard.

Browsing through videos is also extremely laggy. There's a lag of at least 300 or 400 milliseconds between pressing an arrow key, and its preview displaying. Anything over 1/60 second I would consider lag, but hundreds of milliseconds is quite extreme, isn't it.
Using Windows 10 21H1 and loving it. Cheers!