Topic locked

Videoplayback issue in 64 bit Architecture IOS Devices

September 24, 2014 - 2:19pm #1

HI,

 

I think i have already raised this issue in a different link.But haven't got any solution.

 

The Vuforia Videoplayback sample only works fine with the default 640x360 size.If i load any other size.The video loses FPS and starts to skip frames.This problem only happens in the iphone5s,IPAD Air,Iphone 6 ,Iphone 6 plus and Ipad Mini(2nd generation) - All 64 bit architectures.

 

 

 

Here is the link to my old forum

https://developer.vuforia.com/forum/ios/vufroia-video-playback-issue

Videoplayback issue in 64 bit Architecture IOS Devices

October 10, 2014 - 11:31pm #26

Great ! ;-)

Just to summarize this thread, I'll put here a link to this Sticky, which contains the native guide + the Unity-specific instructions:

https://developer.vuforia.com/forum/ios/ios-8-video-playback-frame-rate

 

Videoplayback issue in 64 bit Architecture IOS Devices

October 10, 2014 - 1:33pm #25

finally...using build sh worked....tx alessandro...

Videoplayback issue in 64 bit Architecture IOS Devices

October 10, 2014 - 12:34pm #24

I tried building the VideoPlayback sample project with the new (rebuilt) libVuforiaMedia.a and I did not get any errors;

have you tried starting from a fresh VideoPlayback sample project ?  maybe there is something different in your custom project settings..

 

 

Videoplayback issue in 64 bit Architecture IOS Devices

October 10, 2014 - 12:03pm #23

hi alassendro,

 

i think u misunderstood the bug.Please check my previous screenshots.Executing libvuforiamedia xcode project is not an issue.It published without issues.But after replacing the .a file and when i tried to build and run my  unity project.The xcode throws all sorts of linking error with respect to the libvuforiamedia .

 

can you attach your latest libvuforiamedia file....so that i can check...wether the problem is with the libvuforiamedia or anything else.....

 

 i too use xcode 6.0.1 + unity 4.5.4 p3  + vufroia latest

Videoplayback issue in 64 bit Architecture IOS Devices

October 10, 2014 - 11:49am #22

I just went throught the documentation again and the library did build OK;

 

I will summarize the steps here again (as I verified them one by one):

- open VuforiaMedia.xcodeproj with Xcode 6 (note: I'm using Xcode 6.0.1, i.e. the current latest stable Xcode version)

- add the SimpleTimer class (.h and .m) and the changes in VideoPlayerHelper.m ./h as documented in the KB article: https://developer.vuforia.com/resources/dev-guide/how-improve-video-framerates-ios-8

- add the #import <pthread.h> line at the top of SImpleTimer.h

- quit Xcode

- edit the build.sh with Text Edit to point it to Xcode development directory and to use ios sdk 8.0,  as I mentioned in my previous post

- run build.sh

- observe console message ending with:  ** BUILD SUCCEEDED **

Maybe try to do it once again or to check if you've done anything different w.r.t. the list above.

 

Videoplayback issue in 64 bit Architecture IOS Devices

October 10, 2014 - 8:41am #21

Hi Alessandro,

Did followed all the instructions as u said...still the same bug....apple-macho's

Videoplayback issue in 64 bit Architecture IOS Devices

October 10, 2014 - 2:01am #20

Guys,

in Xcode, you may just need to remove the arm64 from the Build Settings > Architectures > Valid Architectures (and leave armv7 and armv7s).

However, the easiest (and recommended) is to simply use the provided build script "build.sh" (in case you have not seen it)

which is in the same directory as the VuforiaMediaSource; this script will build the libVuforiaMedia and will also automatically replace the original libVuforiaMedia.a library with the newly built one.

 

build.sh - Usage Notes:

before running the build.sh, make sure that the build.sh points to the valid Xcode path, i.e., open it in a Text Editor and adjust this line:

export DEVELOPER_DIR=/Applications/Xcode_511.app/Contents/Developer

You need to put there the actual Xcode.app that you're using in the path above.

and of course, if using iOS8, also change this line:

export CONST_IOS_SDK=iphoneos7.1

to

export CONST_IOS_SDK=iphoneos8.0

 

Videoplayback issue in 64 bit Architecture IOS Devices

October 10, 2014 - 1:41am #19

Hi,

try setting the option "Build Active Architectures Only" to NO in the Build-Settings when compiling the lib.

Best Regards
Maik

Videoplayback issue in 64 bit Architecture IOS Devices

October 9, 2014 - 2:13pm #18

tx alessandro

i think its #import <phtread.h>...now it got published without issues.....replaced the file...

But while build and run.....xcode throws lots of apple-macho-link error

 

at the start of the error it says.........libvuforiamedia.a file was built for achive which is not the architecture being linked (arm v7)

Does the documentation really got tested for unity applications ? The problem is clearly a compatiblity issue between vuforia and 64 bit devices.Will this  libvuforiamedia.a will be automaticaaly updated in the next vuforia release ??? or we have to keep making these changes by ourselves??

 

Does anybody in the support/users/developers can help me in sharing the working version of libvuforiamedia.a....instead of us breaking our heads without knowing whats happening.....

 

  "_videoPlayerSetVideoTextureIDIOS", referenced from:

  "_videoPlayerSeekToIOS", referenced from:

  "_videoPlayerPlayIOS", referenced from:

  "_videoPlayerSetVolumeIOS", referenced from:

  "_videoPlayerPauseIOS", referenced from:

  "_videoPlayerOnPauseIOS", referenced from:

  "_videoPlayerDeinitIOS", referenced from:

  "_videoPlayerGetVideoWidthIOS", referenced from:

  "_videoPlayerGetVideoHeightIOS", referenced from:

  "_videoPlayerUnloadIOS", referenced from:

  "_videoPlayerIsPlayableFullscreenIOS", referenced from:

  "_videoPlayerIsPlayableOnTextureIOS", referenced from:

  "_videoPlayerGetCurrentPositionIOS", referenced from:

  "_videoPlayerGetCurrentBufferingPercentageIOS", referenced from:

  "_videoPlayerLoadIOS", referenced from:

  "_videoPlayerGetStatusIOS", referenced from:

  "_videoPlayerUpdateVideoDataIOS", referenced from:

  "_videoPlayerGetLengthIOS", referenced from:

  "_videoPlayerStopIOS", referenced from:

  "_videoPlayerInitIOS", referenced from:

clang: error: linker command failed with exit code 1 (use -v to see invocation)
 

Undefined symbols for architecture armv7:
  "_videoPlayerSetVideoTextureIDIOS", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_videoPlayerSeekToIOS", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_videoPlayerPlayIOS", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_videoPlayerSetVolumeIOS", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_videoPlayerPauseIOS", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_videoPlayerOnPauseIOS", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_videoPlayerDeinitIOS", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_videoPlayerGetVideoWidthIOS", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_videoPlayerGetVideoHeightIOS", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_videoPlayerUnloadIOS", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_videoPlayerIsPlayableFullscreenIOS", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_videoPlayerIsPlayableOnTextureIOS", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_videoPlayerGetCurrentPositionIOS", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_videoPlayerGetCurrentBufferingPercentageIOS", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_videoPlayerLoadIOS", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_videoPlayerGetStatusIOS", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_videoPlayerUpdateVideoDataIOS", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_videoPlayerGetLengthIOS", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_videoPlayerStopIOS", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_videoPlayerInitIOS", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

 

it all points to the libvuforiamedia.a

 

 

 

AttachmentSize
Package icon libVuforiaMedia.a.zip73.36 KB

Videoplayback issue in 64 bit Architecture IOS Devices

October 9, 2014 - 12:37pm #17

You need to add the pthread import statement in SimpleTimer.h:

#import <pthreads.h>

 

 

Videoplayback issue in 64 bit Architecture IOS Devices

October 9, 2014 - 12:12pm #16

Hi alassandro,

 

Did everything said in the document.Recieved these error as you  see in the attachment.Ive also attached the script files.Kindly send me the updated libVuforiaMedia.a file.

AttachmentSize
Package icon bug.zip244.06 KB

Videoplayback issue in 64 bit Architecture IOS Devices

October 9, 2014 - 12:07am #15

Hi,

if you read my previous post, 

for Unity, you should go to the /Assets/plugins/iOS/ directory under your Videoplayback Unity sample project;

there you should see:

- libVuforiaMedia.a

- a directory called "/VuforiaMediaSource"

the VuforiaMediaSource directory contains the source code and Xcode project from which the libVuforiaMedia.a has been built.

If you open the VuforiaMedia.xcodeproj project in VuforiaMediaSource, you will find the VideoPlayerHelper class (.mm and .h); there you can apply the modifications (code changes) as described in the article.

Then, once you have done the changes,  by rebuilding the VuforiaMedia.xcodeproj project you will be able to generate a new libVuforiaMedia.a; this should replace the original libVuforiaMedia.a; 

Then, go back to your VideoPlayback sample project and build it again (maybe make a "Clean" so that it picks up the new library libVuforiaMedia.a).

 

Videoplayback issue in 64 bit Architecture IOS Devices

October 8, 2014 - 10:42pm #14

Hi Alessandro,

Thank you very much for the help in sorting out this issue.

I went throught the documentation and i just cannot find anything similar in the VideoPlayerHelper.h and ...mm file regarding the various methods that we have to change. I have VideoPlayer.h and VideoPlayer.mm under classe/Unity in xcode which have nothing similar to what is mentioned in the doc.

I am able to create the SimpleTimer.h and .mm but the rest, i just get lost.

I think we are almost there. 

Thanks

Rick

Videoplayback issue in 64 bit Architecture IOS Devices

October 8, 2014 - 2:15pm #13

Dear Alassandro,

Am not an xcode developer.I have no idea about the .a file.Is there any chance that you could send me the Updated libVuforiaMedia.a file with the mentioned changes.I hope the simpletimer.h will be inside the libVufroiaMedia.a file.so that i can reaplce in my project and test it ?

Videoplayback issue in 64 bit Architecture IOS Devices

October 8, 2014 - 10:41am #12

Hi anbu,

for Unity, the VideoPlayback sample makes use of some native calls to a library called "Vuforia Media";  this library is in fact just a piece of native code which is precompiled and used by the C# sample scripts in Unity. You can consider it as part of the VideoPlayback sample code.

The actual source code of Vuforia Media is located under your project directory (once you have imported the videoplayback sample unitypackage), under:

Assets/Plugins/iOS/VuforiaMediaSource

There you can open the project in Xcode and find the VideoPlayerHelper class; you can then make the same modifications as documented in the article, and then re-build the lbVuforiaMedia library with those changes,  replacing the original libVuforiaMedia.a file which is in Assets/Plugins/iOS.

 

 

 

Videoplayback issue in 64 bit Architecture IOS Devices

October 8, 2014 - 9:13am #11

AlessandroB,

Thanks for the solution.

Am working with Unity3d.The implementtion will differ or its all the same for native and unity3d applications ????becaue i dont see videoplayerhelper class in xcode.

 

One more point : This problem was there on ios 7 too.The problem was only seen in 64 bit devices.I dont think it has to do anything with IOS8.Becasue my ipad mini 1st generation worked without issues with both ios7 and ios8.The issue was felt only in iphone5s & IPad Air till now(they both where on ios 7 and updated to ios 8.0.2 recently).

 

 

 

 

 

Videoplayback issue in 64 bit Architecture IOS Devices

October 8, 2014 - 7:17am #10

Hi Alessandro,

 

I will check this ASAP. Wil llet you know how it went.

Thank you very much for your help. 

Rick

Videoplayback issue in 64 bit Architecture IOS Devices

October 7, 2014 - 11:29pm #9

UPDATE:

You may want to check the article which has been published here:

https://developer.vuforia.com/resources/dev-guide/how-improve-video-framerates-ios-8

This provides detailed instructions on how to restore a correct video playback frame rate on iOS8.

Hope this helps.

Videoplayback issue in 64 bit Architecture IOS Devices

October 6, 2014 - 11:05am #8

Hi guys,

Did anyone able to execute Alassandro's workaround method ? if so kindly lemme know.Am stll waiting for a proper solution.

Videoplayback issue in 64 bit Architecture IOS Devices

October 4, 2014 - 12:58pm #7

We're preparing an article to document this, however we are currently evaluating the appropriate ways of publishing the full code of such class through our portal. At the moment the only thing I can add is that you can implement a simple Objective-C class with something like:

- "start" and a "stop" method

- when you call the start method, you could start a background process (e.g. using the performSelectorInBackground), and in the background method you could have, say, a while loop that runs until a "stop"  boolean flag is not true (and this flag could be set when calling the "stop" method)

- in the while loop you could then call a delegate method that in turns updates the video (e.g. calling the getNextVideoFrame() method that is already used in the VideoPlayerHelper)

 

Videoplayback issue in 64 bit Architecture IOS Devices

October 3, 2014 - 5:08am #6

HI Alessandro,

 

I am not to sure how to implement this class. Could you give a more specific exemple of this code to use?

Thanks

Rick

Videoplayback issue in 64 bit Architecture IOS Devices

October 3, 2014 - 4:38am #5

Yes, I've also observed the same on the 640x360 resolution;

the problem is that when upgrading to iOS8, the frameTimer which is initialized and scheduled inside the VideoPlayerHelper.mm will fire timer events at a lower rate than on iOS7 or previous versions;  this is the timer initialization code that I am referring to:

frameTimer = [[NSTimer scheduledTimerWithTimeInterval:(1 / videoFrameRate) 
                   target:self selector:@selector(frameTimerFired:) userInfo:nil repeats:YES] retain];

 

    

and this is the callback method that the timer invokes at regular time intervals:

- (void)frameTimerFired:(NSTimer*)timer;

 

A workaround to this is to not rely on such timer for updating the video; for example you could create a simple class that spawns a loop in a background thread, and in that loop, trigger the frameTimerFired at the desired rate (e.g. every 33 milliseconds or so). 

 

 

Videoplayback issue in 64 bit Architecture IOS Devices

October 2, 2014 - 9:34am #4

I have the same skipping frames issue on the iPad Air running iOS 8, worked fine on iOS 7. 

However, this also is the case for 640x360 videos, opposed to the OP. 

I don't seem to be experiencing any FPS drop worth mentioning. 

 

Videoplayback issue in 64 bit Architecture IOS Devices

September 30, 2014 - 3:32pm #3

Hi,

I have the same problem with playback videos since i upgraded to ISO8. I have been running various size videos up until now witout any issues for any IOS before IOS8.

I tested the latest version of SDK 3.0.9 with Unity 4.5.0 on ipad air and ipad mini. There is a drop in FPS which i wasn't experiencing before.

Thanks

Richard

Videoplayback issue in 64 bit Architecture IOS Devices

September 25, 2014 - 11:16pm #2

Hi, thanks for the report,

it appears there is an issue with the video upate timer scheduling, which we are currently looking at; but on our preliminary observation this seems to happen on devices running iOS 8 (as opposed to iOS 7).

Can you also confirm the same (i.e. are your 64-bit devices iP5S, iPad Air and iP6 all running on iOS 8?)

 

Topic locked