ARnft icon indicating copy to clipboard operation
ARnft copied to clipboard

Having some video flickering issue

Open suxscribe opened this issue 4 years ago • 8 comments

Hi! Been playing with ARnft for some time - great library for NFT among others available.

I've found an issue with video rendering, i guess. Got it recorded on youtube: https://youtu.be/Dg6h-EPyEIk

  1. When camera is close to NFT marker the video element is shown correctly.
  2. When I start to move camera away from NFT at some point video starts to flicker.. (0:11)
  3. When I move camera even further theres a moment when video stops flickering. (0:20)
  4. And when i move camera beyond that point video disappears completely. (0:29) But the sound is playing and there's no 'marker lost' event in console, so marker is still being recognized.

At first I thought it may be related to near/far settings of three.js camera, but I've tweaked the 'far' setting in latest ARnft version with no effect. Tried to change other various three.js parameters, z-axis positioning - also no effect.

Is there a way to get rid of flickering and increase the distance of where video is shown?

suxscribe avatar Dec 17 '20 13:12 suxscribe

I think addVideo need to be improved, Iwith hte latest changes maybe can help a bit to a different threejs setup. Maybe it depends by the type of the video, codec, lenght of the video... Maybe @ThorstenBux may also help on this. I have not so much time for a deep answer, In the next week i will be more free.

kalwalt avatar Dec 17 '20 22:12 kalwalt

Hi @suxscribe i have done some changes in the code since this issue, have you tried again? I think also that can depend on how DPI has the NFT image marker. A very low DPI may cause this issue.

kalwalt avatar May 03 '21 14:05 kalwalt

Hi @kalwalt ! I have tested 0.8.6 & 0.8.7 of ARNFT. Noticed improvements in video rendering - Much less flickering in Chromium based browsers, in Firefox - the same as before. There's still a gap in video visibility at some distance, as described in the first comment.

I looked up in js code, but i still can't get why the video flickers or disappears without 'nftTrackingLost' event.

Also I've played with different variations of NFT markers. And came up with that the best results (the biggest tracking distance) I get with NFT marker sized 1000px on the long side and increased sharpness (Unsharp Mask, 3px, 100%) and increased microcontrast (I use ColorEfex Pro - Detail Extractor in Photoshop). With markers 1500px or 2000px+ on the long side the tracking distance is much less.

suxscribe avatar May 25 '21 12:05 suxscribe

Hi @suxscribe i recently did a big refactor of the code, see 0.9.0, moving the rendering part to a separate repository/package ARnft-threejs see PR #180, i will continue to improve this. Probably need some extra settings the Rendering part? and thank you for your insights!

kalwalt avatar May 25 '21 20:05 kalwalt

Any update on this? The flickering of videos, seems not gone yet.

MasoudShah avatar Aug 21 '23 12:08 MasoudShah

I believe this problem is related to z-fighting between video and the marker, but I don't know how to solve it yet. I have to dig into ThreeJS code in free time.

MasoudShah avatar Oct 11 '23 11:10 MasoudShah

This happens in this repository, but I checked the video in the main repository (jsArToolkit), the flickering doesn't exist at all. There must be some issues in this wrapper repository.

MasoudShah avatar Oct 25 '23 12:10 MasoudShah

@MasoudShah the fact is webarkit/jsartoolkitNFT examples use the oneeuro filter that i haven't yet implemented in the ARnft examples i started in this PR https://github.com/webarkit/ARnft/pull/310 i think it's time to complete the job. :smile:

kalwalt avatar Oct 25 '23 13:10 kalwalt