"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Videoplayback video inverted

I see video is inverted i.e. upside down when I put camera in front of marker. How to fix it?

AlessandroB

Wed, 10/24/2012 - 13:03

Hi, do you mean that you see the video on texture inverted (with texture attached to the target in 3d space) ?

ayazalavi

Wed, 10/24/2012 - 14:54

yes video is upside down. Here is the code that binds texture in front of marker. Should I use rotate here?

 

QCAR::Matrix44F modelViewMatrixVideo =

AlessandroB

Wed, 10/24/2012 - 15:10

 Hi, since the texture is applied to a 3D object (in this case a simple flat rectangle positioned on top of the target), this will follow the reference frame associated to the target, which in turn depends on how the printed paper target is currently oriented on your ta

ayazalavi

Wed, 10/24/2012 - 15:21

yes your suggestion worked and when I invert target video is playing just fine. But how can I make this to have same orientation as of image target?

AlessandroB

Wed, 10/24/2012 - 15:48

Hi, the target reference frame is by definition the one associated to the target, so your video should be already in the "same" orientation, unless you mean something special;

ayazalavi

Thu, 10/25/2012 - 06:31

thanks the code worked and videos have now fine orientation. Now another bug appeared that contents of videos are flipped and mirrored i.e. left became right and right became left.

AlessandroB

Thu, 10/25/2012 - 06:58

This sounds quite weird; however you can just replace the rotation around Z with a rotation around X instead, and then it should be OK:

SampleUtils::rotatePoseMatrix(180.0f, 1.0f, 0.0f, 0.0f, &modelViewMatrixKeyframe.data[0]);//instead of rotating around Z

 

ayazalavi

Thu, 10/25/2012 - 09:08

I tried replacing X as 1.0f and then y as 1.0f. In both cases audio is there but video is gone. Here is my code

QCAR::Matrix44F modelViewMatrixVideo =

                QCAR::Tool::convertPose2GLMatrix(trackable->getPose());

AlessandroB

Thu, 10/25/2012 - 09:15

I strongly suspect this could be a matrix normalization issue due to the scale; 

try moving the rotatePoseMatrix() line BEFORE the scalePoseMatrix (i.e. first translate, then rotate and finally scale); I believe this could solve the problem;

ayazalavi

Thu, 10/25/2012 - 14:55

If  I increment angle by 30 degree than frame moves accordingly but issue is NOT with frame but with the way video is displaying on the frame. CONTENTS of the video are flipped upside down. Is this written somewhere in the code that video can be mirrored?

ayazalavi

Thu, 10/25/2012 - 15:03

Do you think below code could be the issue

 

JNIEXPORT void JNICALL

Java_com_putitout_buck_VideoPlayback_setProjectionMatrix(JNIEnv *, jobject)

{

    LOG("Java_com_putitout_buck_VideoPlayback_setProjectionMatrix");

 

AlessandroB

Thu, 10/25/2012 - 15:49

Hi, ok I see;

the flipping in this case comes from some problems with the texture coordinates (so you can remove the rotatePoseMatrix() code that we previously tried, as that's not the issue);

alhammadi_am

Sat, 05/04/2013 - 06:09

I have the same exact issue, but this function ( glVertexAttribPointer(videoPlaybackTexCoordHandle, 2, GL_FLOAT, GL_FALSE, 0,

(const GLvoid*) &videoQuadTextureCoordsTransformedStones[0]);) is being used only once! the video is still mirrored. Any help?

BraveCommerce

Fri, 05/24/2013 - 10:21

Hi,

My problem:

 

1. I've 2 movies in mp4 format. Lets call them 1.mp4 and 2.mp4

2. I've 2 markers named: 1 and 2. When recogniced video is start plaing on them. Marker 1 => 1.mp4 2=>2.mp4

 

Ok and problem that makes me crazy ....