Log in or register to post comments

Add more video to "vuforia-videoplayback"

July 11, 2012 - 7:05pm #20

Hallo all

I enjoy sample"vuforia-videoplayback" in iOS and Android.

I'm trying to add trackingdata and movie in this sample.
But I can't add more than 4 items.
These error occur in debuglog.

Error - AVAssetReader not in reading state
Error - Unable to prepare media for playback

E/(2464): Can't open file for reading

I use iPad2 and Android4.0device
Can This sample play more than 4 movies?

Thank you for your advice.


Add more video to "vuforia-videoplayback"

July 11, 2012 - 7:18pm #19

Have you defined NUM_TARGETS in VideoPlayback.cpp for Android and/or NUM_VIDEO_TARGETS in EAGLView.h for iOS?

And your videos are in the Assets folders?

There are no hard limits on the number of videos that you can include, though only 1 can play at a time.

Add more video to "vuforia-videoplayback"

July 12, 2012 - 7:48pm #18

 Yes, I defined NUM_TARGETS in VideoPlayback.cpp for Android and NUM_VIDEO_TARGETS in EAGLView.h for iOS.

And my videos are in assets folder.


I write detail in iOS.

in EAGLView.h

   #define NUM_VIDEO_TARGETS 10

in VideoPlaybackAppDelegate.mm

    [qUtils addTargetName:@"Stones & Chips" atPath:@"test.xml"];

in VideoPlaybackAppDelegate.mm

        switch (i) {

            case 0:

                filename = @"aaa.m4v";


            case 1:

                filename = @"bbb.m4v";



            case 8:

                filename = @"iii.m4v";



                filename = @"jjj.m4v";



in EAGLView.mm

    const char* textureFilenames[] = {









    enum tagObjectIndex {








in EAGLView.mm

        // VideoPlayerHelper to use for current target

        int playerIndex = 0;    // aaa

        if (strcmp(trackable->getName(), "bbb") == 0)


            playerIndex = 1;



        if (strcmp(trackable->getName(), "jjj") == 0)


            playerIndex = 9;




Add more video to "vuforia-videoplayback"

July 12, 2012 - 10:51pm #17

I can play  movies (over 4) in fullscreen mode.

But ,I want to play on texture.


Thank you for your advice.


Add more video to "vuforia-videoplayback"

September 13, 2012 - 8:48pm #16

I read, at least for Android, for playing video over the textures you need Android 4.0 or higher. Are you using the Unity plugin? Where do you put the videos? 

Add more video to "vuforia-videoplayback"

October 18, 2012 - 2:31am #15

same with me after debubuuging i find that the problem is here:

        // Start reading the track

        [assetReader startReading];  

        if (AVAssetReaderStatusReading != [assetReader status]) {          

            NSLog(@"Error - AVAssetReader not in reading state");

            ret = NO;


but still dont know what is causing it

Please Help Me

December 27, 2012 - 9:34pm #14


I am begginner in vuforia augmented reality,I am not able to add more than two image target in Videoplayback application,Please help ma for adding 4 image target ,

Thank you,


What happens when you try

December 28, 2012 - 2:13am #13

What happens when you try adding more than 2 videos?

Which device are you using?

Are you using the latest Vuforia 2.0 SDK?

Other developers have had success with up to 4 videos and more.  Bear in mind you need to have MAX_SIMULTANEOUS_TARGETS set to more than 2 if you want multiple targets to be available and detected simultaneously.


Please Help Me

December 28, 2012 - 3:09am #12


First of all thank you for your reply.I am begginner in vuforia developing,So I can't understand where i have to change in videoplayback.cpp file.Please suggest me .

Thank you,


Look at

December 28, 2012 - 8:30am #11

Look at EAGLView.mm

particularly these lines:


    // Set the number of simultaneous trackables to two





Not Found

December 28, 2012 - 10:32pm #10


        EAGLView.mm file not found 

        but in videoplayback.cpp i found this string at two place.only this place i have to chang number of targets?

        Basically i want to play 4 different video on four different image detection. Can you send sample which play 4 video on 4 different target    setected if possible?please........

Thank you,


"Can you send sample which

December 31, 2012 - 3:14am #9

"Can you send sample which play 4 video on 4 different target    setected if possible?please"

Well, really you need to make this application yourself - unfortunately there is no shortcut to learning Vuforia, though if you want the easier route then use Unity, as that is what it is there for :)

Firstly you need to create a device database containing the 4 images so that all can be simultaneously recognised.

Secondly you need to import them into sample code - use the video playback sample as a starting point.

Third, you need to modify the code to deal with 4 images (MAX SIMULTANEOUS TARGETS)

Fourth, you need to be able to recognise the additional two images and play the new videos that must be added to the project - study the existing code and find out where to extend it.




Please Help Me

December 31, 2012 - 10:22pm #8



please let me know what maximum number of target we can track in vuforia,because i got suceess to track 5 target but for six target it hang the application.


Thank you,


The maximum number of

January 1, 2013 - 3:57am #7

The maximum number of simultaneous targets partly depends on the device and what you are trying to do.

You can try setting MAX_SIMULTANEOUS to 10 or higher and see if it tracks with Image Targets in the first instance.  However if you then want to do the same with videos you may run into resource issues.  If this happens then it is unrealistic to load up lots of videos into memory and expect them to work - instead you will need to find a way of dynamically loading and playing the videos so as to minimise resource usage.

One developer was able to modify the Unity scripts to do just this and was able to have up to 30 different video playing (obviously not all at once), so hopefully this can point you inthe right direction.


Hi   I am developing an iOS

January 7, 2013 - 9:41am #6



I am developing an iOS app where in I have to show a video on an image target.  It works well with one image target and the corresponding videos.  The app is only to recognize one image at a time and display the corresponding video.  There is no need for simultaneous recognition.  How many images and videos can be added as part of the app

The app should work like this, When Image1 is scanned, video1 should play, when Image2 is scanned video2 should play, etc.

Also is is possible to load the video dynamically from external source (youtube or a server url)







This is exactly how the Video

January 8, 2013 - 2:44am #5

This is exactly how the Video Playback sample works, so it would be a good idea to check it out.



"How many images and videos can be added as part of the app"

This is very much device dependent because one needs to consider available memory and possibly other factors.  If you are not worried about simultaneous videos, then the first option would be to create a prototype that extends the sample.  Here the video file is part of the bundle, so iOS should be able to load and unload on demand rather than you having to write any special code.

The other thing to do is set MAX_SIMULTANEOUS to 1.



Maximum video support

January 8, 2013 - 9:00am #4

Hi Nalin,

Thanks for your response, i was set MAX_SIMULTANEOUS to 1 and still not working for multiple videos but image recognizition works for 10 images but playing corresponding video is not working only supporting 3 videos. Please suggest me how to load and unload more videos dynamically where i can change the code pls explain it in detail with example.




Have you tried setting

January 9, 2013 - 9:19am #3

Have you tried setting NUM_VIDEO_TARGETS as well as that is set to 2 default.

The sample indicates it need one per Image Target / Video that you want to play.


Regarding downloading videos - let's break this down into 

1 - playing video from the documents directory

2 - actually doing the download from your server.


For 1) if you look at VideoPlayerHelper.m around line 147


            // If filename is an absolute path (starts with a '/'), use it as is

            if (0 == [filename rangeOfString:@"/"].location) {

                fullPath = [NSString stringWithString:filename];


            else {

                // filename is a relative path, play media from this app's

                // resources folder

                fullPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:filename];


..you can see that the code already should be able to handle a video that is specified with an Absolute path - chances are you will need to have this stored in the Documents directory.  So the first test would be to build your app and then transfer the video file using iExplore (or equivalent) and place it manually where it needs to go.  Once you have this mechanism established then you can move on to stage 2.


For 2) this is outside the scope of Vuforia per se.  All you need to do is to find a way of downloading remote files into the Documents directory and sites like StackOverFlow should be able to assist you.




Add more video to "vuforia-videoplayback"

December 26, 2013 - 5:24am #2

how much video can be played?

Add more video to "vuforia-videoplayback"

December 27, 2013 - 3:35am #1

Why don't you try and find out?



Log in or register to post comments