Log in or register to post comments

Video Playback - Problem loading many videos

November 11, 2013 - 3:15am #1

 

 

 

I've problem when I try to add more videos to the VP sample and it show this 2 errors when add more than 10 or less base on each devices.

 

 

Error - AVAssetReader not in reading state

Error - Unable to prepare media for playback

 

I think it maybe a memory problem.

 

How can I prepare videos asset or load it after marker found?

I don't want to load all of them at the same time. Just want to load 1 or 2 videos when marker found and unload the video s when lost.

 

Please help

Thanks

 

Video Playback - Problem loading many videos

July 21, 2017 - 6:42am #16

Thanks IntermediaSolutions, I search a couple of days for this solution and you resolved my issues.

My app only read 7 or 8 videos on targets and then show black screens on others. Applying your scripts changes all the videos works fine.

For who interested on that, i'm using unity and the app is for android. Sorry the bad english.

Video Playback - Problem loading many videos

July 16, 2017 - 1:06am #15

Try this on an android device. Dosn´t work, this won´t play no video.

Video Playback - Problem loading many videos

April 23, 2017 - 10:23am #14

Hi 

 

I think this is a change in the API since the code that was posted below was created...Using the below method for that error should work...just replace the method calling the error with this one:

 

public IEnumerator InitVideoPlayer()

    {

        // Initialize the video player

        VuforiaRenderer.RendererAPI rendererAPI = VuforiaRenderer.Instance.GetRendererAPI();

        if (mVideoPlayer.Init(rendererAPI))

        {

            yield return new WaitForEndOfFrame();

           

            // Wait in case other videos are loading at the same time

            while (sLoadingLocked)

            {

                yield return new WaitForSeconds(0.5f);

            }

            // Now we can proceed to load the video

            StartCoroutine(LoadVideo());

        }

        else

        {

            Debug.Log("Could not initialize video player");

            HandleStateChange(VideoPlayerHelper.MediaState.ERROR);

            this.enabled = false;

        }

    }

 

Video Playback - Problem loading many videos

February 21, 2017 - 2:08pm #13

Mr. I have tried your code, and I'm getting an error:

VideoPlaybackBehaviour.cs

line: 231

if (mVideoPlayer.Init(isMetalRendering))

It says: The best overloaded method match for 'VideoPlayerHelper.Init(Vuforia.VuforiaRenderer.RendererAPI.)' has some invalid arguments

Argument #1 cannot convert 'bool' expresion to type Vuforia.VuforiaRenderer.RendererAPI.

I tried some code but I still can't figure out what is happening, do you have any idea what am I missing?

Thank You in advance

Video Playback - Problem loading many videos

February 16, 2017 - 10:19pm #12

problem solved?

Video Playback - Problem loading many videos

February 6, 2017 - 6:15pm #11

I am not sure if it works on android but you can use some video converter to merge your videos together and then load them

Video Playback - Problem loading many videos

January 30, 2017 - 9:29am #10

Does this works for android? Because I'm trying to load 12 videos and random 3 videos always shows that sandclock or X icon.

Video Playback - Problem loading many videos

December 2, 2016 - 8:35am #9

I have cracked it!

 

What you need to do is to make the videos to be loaded in dynamically to stop the internal memory if the iOS devices to overload and crash! I have attached the scripts to this post to use! I managed to get over 50 videos to play on my iPhone 5 with these scripts!

 

Best Wishes

Video Playback - Problem loading many videos

December 1, 2016 - 9:02pm #8

try calling prepare almost solve my problem. but their are some scenarios that it really does not load some videos for some reasons. may be on the memory

Video Playback - Problem loading many videos

October 18, 2016 - 4:05am #7

Any updates on this, devs?

Video Playback - Problem loading many videos

October 10, 2016 - 4:20am #6

I don't really get errors.

 

But it seem to be a memory problems with the devices. If I use short videos it works up to about 16 videos then 2 random videos just display X instead of a movie when I find them on my device. I have tried to cut down on the target databases to just have 5 trackables in each, yet it still errors out. If I recreate the trackable that X-ed out, that one start to work again but then 1 other random stops.

 

Any ideas are welcome.

Video Playback - Problem loading many videos

October 9, 2016 - 2:36am #5

how could you load 20 videos? If I load more than 16 videos , Always get the error "Error - AVAssetReader not in reading state".Could you please leave me some message,thanks.

Video Playback - Problem loading many videos

September 28, 2016 - 5:11pm #4

I was able to load 20 videos, following the VP sample, but it's kind of weird, it only works on an iPhone 5c.

iPhone 4s, 7 videos max.

5C 20 and it keeps running good.

iPhone 5, runs good.

iPhone 6plus, crash!

i tried with a 6, but it crash. 

Here is the 4S log:

2016-09-28 19:06:10.180 VidPlayback[3585:413695] debug: shaderName=(Simple), shaderFileTYpe=(vertsh)

2016-09-28 19:06:10.181 VidPlayback[3585:413695] debug: shaderPath=(/var/containers/Bundle/Application/EB48A544-4398-4FA1-979B-5DB73715F818/VidPlayback.app/Simple.vertsh)

2016-09-28 19:06:10.186 VidPlayback[3585:413695] debug: shaderName=(Simple), shaderFileTYpe=(fragsh)

2016-09-28 19:06:10.186 VidPlayback[3585:413695] debug: shaderPath=(/var/containers/Bundle/Application/EB48A544-4398-4FA1-979B-5DB73715F818/VidPlayback.app/Simple.fragsh)

2016-09-28 19:06:10.300 VidPlayback[3585:413871] INFO/AR(3585) 2016-09-29 19:06:10: Vuforia SDK version 6.0.112

2016-09-28 19:06:10.473 VidPlayback[3585:413695] self.navigationController.navigationBarHidden: Yes

2016-09-28 19:06:12.068 VidPlayback[3585:413871] Rendering mode set to: OpenGL ES 2.0

2016-09-28 19:06:12.281 VidPlayback[3585:413695] AVPlayerItemStatusObservationContext -> AVPlayerItemStatusReadyToPlay

2016-09-28 19:06:12.294 VidPlayback[3585:413695] AVPlayerItemStatusObservationContext -> AVPlayerItemStatusReadyToPlay

2016-09-28 19:06:12.302 VidPlayback[3585:413695] AVPlayerItemStatusObservationContext -> AVPlayerItemStatusReadyToPlay

2016-09-28 19:06:12.309 VidPlayback[3585:413695] AVPlayerItemStatusObservationContext -> AVPlayerItemStatusReadyToPlay

2016-09-28 19:06:12.318 VidPlayback[3585:413695] AVPlayerItemStatusObservationContext -> AVPlayerItemStatusReadyToPlay

2016-09-28 19:06:12.519 VidPlayback[3585:413871] Rendering mode set to: OpenGL ES 2.0

2016-09-28 19:06:12.527 VidPlayback[3585:413695] DEBUG/AR(3585) UIView has CAEAGLLayer layer class

2016-09-28 19:06:12.527 VidPlayback[3585:413695] DEBUG/AR(3585) UIView responds to selector renderFrameVuforia

2016-09-28 19:06:12.899 VidPlayback[3585:414004] loadAndActivateImageTrackerDataSet (ARGreca.xml)

2016-09-28 19:06:12.947 VidPlayback[3585:414004] INFO/AR(3585) 2016-09-29 19:06:12: ObjectTracker: Successfully created dataset

2016-09-28 19:06:18.320 VidPlayback[3585:414004] INFO: successfully activated data set

2016-09-28 19:06:19.414 VidPlayback[3585:413695] Received memory warning.

2016-09-28 19:06:19.666 VidPlayback[3585:414004] VideoBackgroundConfig: size: 720,960

2016-09-28 19:06:19.671 VidPlayback[3585:414004] VideoMode:w=640 h=480

2016-09-28 19:06:19.677 VidPlayback[3585:414004] width=640.000 height=960.000

2016-09-28 19:06:19.684 VidPlayback[3585:414004] ViewPort: X,Y: -40,0 Size X,Y:720,960

2016-09-28 19:06:20.583 VidPlayback[3585:413791] Deleting old image data @ 0x0

2016-09-28 19:06:20.583 VidPlayback[3585:413791] Created new image data buffer @ 0xe064000 w/ 460800 bytes

2016-09-28 19:06:24.325 VidPlayback[3585:413695] No video sample buffer available

2016-09-28 19:06:24.361 VidPlayback[3585:413695] No video sample buffer available

2016-09-28 19:06:24.385 VidPlayback[3585:413695] No video sample buffer available

2016-09-28 19:06:24.414 VidPlayback[3585:413695] No video sample buffer available

2016-09-28 19:06:24.448 VidPlayback[3585:413695] No video sample buffer available

2016-09-28 19:06:24.482 VidPlayback[3585:413695] No video sample buffer available

2016-09-28 19:06:24.516 VidPlayback[3585:413695] No video sample buffer available

2016-09-28 19:06:24.555 VidPlayback[3585:413695] No video sample buffer available

2016-09-28 19:06:24.582 VidPlayback[3585:413695] No video sample buffer available

2016-09-28 19:06:24.616 VidPlayback[3585:413695] No video sample buffer available

2016-09-28 19:06:24.650 VidPlayback[3585:413695] No video sample buffer available

The camera loads, but when it detects an marker, it tries to play the video and crash. With no more info, memory warning or something, just what it's showed above.

The only weir thing I see it's: 

2016-09-28 19:06:19.414 VidPlayback[3585:413695] Received memory warning.

2016-09-28 19:06:19.666 VidPlayback[3585:414004] VideoBackgroundConfig: size: 720,960

2016-09-28 19:06:19.671 VidPlayback[3585:414004] VideoMode:w=640 h=480

2016-09-28 19:06:19.677 VidPlayback[3585:414004] width=640.000 height=960.000

seems the videoBackground it's different than videoMode. 

 

By the way, have you found any way to start the video player in full-screen but using the videoHelper methods?

 

Cheers

 

Video Playback - Problem loading many videos

September 28, 2016 - 1:38am #3

have you resolve the issue , i need to load more than 12 videos , and i meet the same issue, wish you help. best wishes.

Video Playback - Problem loading many videos

November 11, 2013 - 6:44am #2

Unfortunately you cannot just keep adding videos and expect it to work because mobile devices have limited resource.

Chances are you will need to write some code to handle this yourself, however this is not related to Vuforia, so you probably need to go through the sample code and the Apple Documentation.

You may find some threads in the forums if you search for "multiple videos" like this one :

https://developer.vuforia.com/forum/ios/add-more-video-vuforia-videoplayback

 

N

Log in or register to post comments