hiukim / mind-ar-js

Web Augmented Reality. Image Tracking, Face Tracking. Tensorflow.js
MIT License
2.24k stars 417 forks source link

How to display video in same size like image #227

Closed MilosGlisovic closed 1 year ago

MilosGlisovic commented 2 years ago

Hi, can anybody know how to display video in same size like image in image tracking, when you track image from flayer, bilbords or other size? Thank you very much

hiukim commented 2 years ago

just resize the video accordingly. width=1 means same size of the target image

This page discuss this: https://hiukim.github.io/mind-ar-js-doc/quick-start/webpage

MilosGlisovic commented 2 years ago

I set it that way, but the height is not exactly the same as the picture, while the width is correct

<a-video webkit-playsinline playsinline height="0.552" width="1" rotation="0 0 0" src="#backVideo" loop="true"></a-video>

I want someting like your example 1 and 3 in this video : https://www.youtube.com/shorts/rtZqtHQOScg

Do I need to set the video to the same height as the image before placing in the code and then set the height to 0.552?

hiukim commented 2 years ago

You need to set the height relative to your target image aspect ratio. Read the last paragraph: https://hiukim.github.io/mind-ar-js-doc/quick-start/webpage

MilosGlisovic commented 2 years ago

Thank you very much, I would try this.