Log in or register to post comments

Video on Texture fullscreen broken

July 17, 2012 - 9:10am #1

I was wondering if there's anything else I should look at.  I have been working with some videos that were fine to play fullscreen before, but now they won't.  They play on the texture plane fine.  I've debug logged all the way to the native call to play the movie on the iphone and everything seems to be fine in the code leading up to the fullscreen playback, but then it immediately returns a new media state of READY which brings qcar back to life and doesn't play the video.  I've been trying to figure this out for hours now.  Any ideas?  Really need to figure this out!

Thanks

Video on Texture fullscreen broken

August 9, 2012 - 1:04pm #18

I've developed a workaround for this issue.  I am now listening for the OnTrackingFound() and OnTrackingLost() events and creating the video instances dynamically.  This allowed me to play a video from 14 different trackables through instantiation at runtime.

Previously, I could play up to 4 and then the rest would either display an "X" and force fullscreen when tapped.  Now, all videos play on texture and i am able to view the video as many times as I'd like.

You could also extend on this solution using the method described by DavidBeard in this thread:

  • Create a single video plane 
  • Load/unload your different videos onto this single plane
  • Change the planes position and parent relative to the trackable you're currently viewing.

For now, this type of solution has solved my problem.

Video on Texture fullscreen broken

July 30, 2012 - 2:46pm #17

>> I've been able to replicate this issue and testing confirms that my Android ICS 4.0 Galaxy Nexus is running out of memory after viewing more than 4 video instances.

We're doing some targetted testing on the Galaxy series and Nexus specifically.

Video on Texture fullscreen broken

July 27, 2012 - 6:03am #16

@DavidBeard Sent you a PM

Video on Texture fullscreen broken

July 25, 2012 - 6:34pm #15

Yes please send your log. If you PM me I can give you an email that you can attach that to.

Thanks.

Video on Texture fullscreen broken

July 25, 2012 - 6:03pm #14

@DavidBeard,

"@vincekillian by 'watch a video X times' do you mean that you are acquiring the target, playing the video, and then moving the camera away from the target? - are you allowing the video to pause, or returning while it's still playing?"

I simply locked onto the trackable once, held my phone in place and pressed play 25 times while maintaining trackability.  Then I would move on to the next one.  Occasionally I would move my arm away and lose trackability, so pausing and unpausing did occur intermittently.

"you did this 25 times + 5 x 3 times before the crash? - across 4 videos, with the 5th crashing."


Yes, but after testing further with a cycle of "Track Image / Play Video x1 / Move on to next trackable", I crashed on the 5th trackable.  It seems the allocation of memory in the graphics buffer is filling up with those rects to store all the video texture info.

NOTE: I am using a single video file assigned to multiple image targets in the scene.

Video on Texture fullscreen broken

July 25, 2012 - 2:30pm #13

@vincekillian by 'watch a video X times' do you mean that you are acquiring the target, playing the video, and then moving the camera away from the target? - are you allowing the video to pause, or returning while it's still playing?

And in the test that crashed, you did this 25 times + 5 x 3 times before the crash? - across 4 videos, with the 5th crashing.

Video on Texture fullscreen broken

July 25, 2012 - 1:59pm #12

Hey guys,

I've been able to replicate this issue and testing confirms that my Android ICS 4.0 Galaxy Nexus is running out of memory after viewing more than 4 video instances.  My video files load and play fine, just after viewing the video on any image target beyond the first 4-5 results in an immediate hang

Video is in the same exact format as the sample app's video (M4V) with a smaller resolution (320x240 for testing purposes) - approx 2.1MB total.

During my tests I used 8 image targets in the scene, each one a duplicate of the image target + video plane prefab (just like the sample app) attached as a child to each image target:

  • I was able to watch a single video 25 times before confirming there was no issues and moving on
  • I was able to watch a single video 25 times, watch each consecutive video 5 times each until reaching the 5th image target
  • Once I reached the fifth target and hit the "Play" button, it immediately hangs Unity and throws up out of memory errors in logcat
  • Soft-killing the app in the system tray allows me to restart the app and repeat the cycle

Is there a way to free up the allocated memory buffers after a video is played and tracking is lost for that image target.  Better yet, at the point in which QCAR decides to stop playing the video [since when you immediately lose tracking the video will continue for a breif time to allow the user to regain trackability] can we clean up and deallocate the used up memory?

I can PM a logcat if the devs want to take a look?

 

Video on Texture fullscreen broken

July 23, 2012 - 2:57pm #11

The 4 videos all told are around the size of one of the sample videos. They are m4v format.  They all play fine individually, it's just when using all videos in one scene that problems occur.  We have tested on a range of Android devices including 2.x.x - 4 os's( I don't have the list of actual device names here with me) It does seem that the video on texture playback is the main problem now...I've tested on a pre-ICS device that plays back the fullscreens now (after including the code above to help deinit the video) it seems to be holding up over time as well and not crashing.  For the video on texture, on capable devices, the video on texture will appear and work for around 5-6 viewings, then the video plane renders black and the app locks up.  Sometimes it locks up to the point of needing to remove the battery from the device.  Logs indicate that it is running out of memory.

Thanks!

-p

pm sent

Video on Texture fullscreen broken

July 22, 2012 - 6:48pm #10

Thanks for the follow-up on this issue. Can you tell me how large each of the video files are, and their formats? Also the range of devices and OS's will be helpful

Have you tried loading the new scene additively (i.e. Application.LoadLevelAdditive() )?

Video on Texture fullscreen broken

July 20, 2012 - 7:06pm #9

The fix we have found is to put in:

mVideoPlayer.Deinit();

mIsInited = false;

mIsPrepared = false;

inside a VideoPlaybackBehaviour's OnDisable function to launch when tracking is lost.

It seems the native video player is getting overloaded somehow with over 3 video planes active in the scene.  Android has a much worse problem with this than iOS.  The above code solves the issue on iOS for the most part, but Android (4.0) will run out of memory and crash the app after a a handful of movie viewings (either full screen, or video on texture)  We've tried on a wide range of Android devices.

We're still looking for ways to optimize how the native video player handles new video instances.  One thing we may try is just having one video instance in the scene at a time and switching out the video playing on it during runtime as needed.  It would be a lot of re-writing to work with our set up, but if it ends up solving the issue, it would be worth it.

Another angle we tried was having a new scene load for the 4th video plane, but it looks clunky to have the arcamera freeze, go black, and then reload to find the tracking target and continue on.  But, it does solve the issues we've seen.  If we could get the arcamera to persist across scene files, that may be something to look at as well.

Thanks for any ideas,

-p

 

Video on Texture fullscreen broken

July 20, 2012 - 1:59pm #8

What are you seeing? Does the fullscreen player launch? Are there errors in the log?

Video on Texture fullscreen broken

July 20, 2012 - 1:53pm #7

4 video instances with fullscreen video still functional?  we've been at it from many angles and its the same result. I'll post what we are doing to try to work around the issue

Video on Texture fullscreen broken

July 20, 2012 - 1:48pm #6

I've built Video Playback apps w/ 4 video instances before, though not based on the sample app. So it's certainly possible to use many Video instances. But please report any issues that you find.

Video on Texture fullscreen broken

July 19, 2012 - 10:01pm #5

Hey David thanks for the reply. The problem shows up when you have more than 3 video planes.  We've been messing with the code and think we've got a fix. I'll let you know when we know for sure.

Thanks!

Video on Texture fullscreen broken

July 19, 2012 - 11:21am #4

That shouldn't be an issue - I've just tested this to confirm that the current sample can be modified for 3 video player instances.

If you've copied Video prefab instances, check each to confirm that components haven't been stripped, which can happen when copying within Unity scenes. The best approach is to use an original ImageTarget and Video prefab instance. Also confirm that you have a Video Playback Controller script on your ARCamera. And all local videos need to be in Streaming Assets.

Also there needs to be a 1:1 relationship between video instances and ImageTargets.

Video on Texture fullscreen broken

July 18, 2012 - 8:57pm #3

If you take the vuforia video demo as is without modifying any of the scripts, and try to have more than 3 video player instances, your fullscreen playback won't work anymore.  I'm trying for a desperate work around as this issue has snuck up on me in a bad way. If I would have known about this i would have gone for a different approach. dam.  If you can think of something, it would be awesome.

thanks

Video on Texture fullscreen broken

July 17, 2012 - 9:26am #2

If this is occurring on the same device, I'd recommend uninstalling the app and restarting the device.

Also is there anything that you've changed in the project, concerning the Video Playback, before these videos stopped playing? - have you tried the videos in the VP sample to see if that's working?

Log in or register to post comments