Log in or register to post comments

Vuforia VideoPlayback in Unity

October 16, 2014 - 5:54pm #1

Been trying to play videos in AR via the Unity Vuforia VideoPlayback package to no avail. 

I am able to build&run the sample scene from Vuforia to my Nexus 5 and tap the video to watch it playback flawlessly. Obviously MovieTextures work on it and it does not need to playback videos fullscreen... Yet... 

To replicate the Video Playback prefab in my own scene with my own assets has gone nowhere. There are lots of confusing bits with this video package. 

Why is it that we have to manually type the path to our video file? Why is it that we have to provide a texture for the video file as in the samples (PNGs)? Why is it that the Vuforia sample videos are in the m4v format and not something more common like mp4 or mov if it requires H264 to work well? The Vuforia video files do not show up anywhere except under the streaming assets folder yet I am not able to playback the files under the inspector? 

Anyway, I have followed all the tutorials I could find to try to build my own AR video playback to no success. I have matched script for script the ones that were given to me via the Vuforia VideoPlayback and checked all settings by cross referencing the sample scene (working video one) with my own. No Video. 

I get an X or an hourglass icon on the video texture plane during scene/game playback... but no video. The same goes actually for the sample scene yet when you build & run the app - it magically works. I am out of options having done my due diligence in various trials and errors. If anyone has a clue on how to make this work or that small setting that throws it all off somewhere - I am all ears. This would be super appreciated. 

Thanks in advance to the Vuforia community out there. 

 

OSARDA

 

PS. I am attaching a text file that shows the methodology I have applied including the screen caps I took as reference from the Vuforia Video Samples... the only one that works as far as I am concerned... 

AttachmentSize
Package icon Vuforia VideoPlayback.rtfd_.zip848.04 KB

Vuforia VideoPlayback in Unity

April 24, 2018 - 10:03pm #23

vuforia VideoPlayback-6-2-10.unitypackage

Vuforia VideoPlayback in Unity

October 27, 2014 - 3:19pm #22

Elpuerco63,

Hoping that you will get back to me and point me in the right direction. I really would like to know how to play those videos in Vuforia with touch & pause and not just AutoPlay. You've been a great help so far. Please don't stop. It has all been much appreciated. Seriously. :)

 

Please advise,

 

OSARDA

Vuforia VideoPlayback in Unity

October 27, 2014 - 2:38pm #21

Thx EdusitoMX,

I am relieved to hear I am not the only one here who shares the same frustrations. 

As you could tell in this back & forth forum conversation with Elpuerco63 who was super helpful and friendly, I got close to getting a bulletproof solution but close is not enough unfortunately. ElPuerco63 has not responded to my last reply and I hope he is not offended by my last words that I simply would like a solution to my problem and not that I should take coding classes for the answer. It is already frustrating enough to navigate those waters when my coding skills are at a beginner level and that I need to be guided along a bit more than the more advanced Unity user out there. It seems to me that I get shut out of the coding club as soon as my rookie ways are revealed and then gratuitous support or advice is now more tough to come by as a result. Elpuerco63 - where are you? We need more users like you with benevolent attitudes and who are willing to share their wealth of knowledge & expertise. 

Yes - I would really like to have a 'poke' button to get the help out there when needed. Instead, I find myself spending countless hours editing scripts in a language I know nothing about. Trial & error. Trial & error. Not fun... It's almost like adding a paragraph in a Chinese text and the Chinese writer tells you insert it in Chapter 4 Paragraph 2 and it will all make sense. It never does :(

 

Please don't hesitate to let me know if you do find a solution and I shall do the same.

 

Cheers,

 

OSARDA

 

Vuforia VideoPlayback in Unity

October 27, 2014 - 1:16pm #20

Hello Osarda.

Unfortunately I share your very same frustration.

A moderator's presence would come in handy (since elpuerco66 might be awfully busy with his dayjob,...nevertheless his efforts to help us out are extremely appreciated) but I noticed not a single one has come to even take a quick peek at what's been going on here.

I wonder if there is a way to "poke" them, in order to come & help us out.

 

If I happen to come across any practical solution, I will share it with you ASAP.

 

Best regards

Vuforia VideoPlayback in Unity

October 24, 2014 - 12:53am #19

Elcuerpo63,

i can appreciate your advice to learn coding basics to get through some of these hurdles but it doesn't solve my immediate problem of trying to playback videos on mobiles via Unity. I have under my belt an overwhelming amount of expertise in various softwares and I have had zero interest in coding from the get-go and still don't. Since we both know Unity allows for non coders a huge amount of functionality to build games and apps, I have not had the need except for once in a while when I am stuck on such an exercise. It is probably trivial to someone with experience in that department I get that. 

I would still appreciate if you could point me in the right direction scripting wise or let me reverse engineer a Unity project that allows for touch & pause playback. Considering I have been able to build apps on my own without coding experience, I consider the Vuforia video playback to be a little lacking in tutorials or simply not fully baked for the general Unity user and not just the advanced users with coding/scripting experience. 

Again, you have been super helpful guiding me along the process and I thank you for it but please don't patronize me by telling me I should effectively go back to school to do my homework! ;)

Looking forward to your advice on how to get back on track. I know I am only a couple lines of code away from getting videos to playback effectively on iOS and Android and not just with AutoPlay turned on. 

Cheers,

 

Osarda

 

Vuforia VideoPlayback in Unity

October 23, 2014 - 11:15pm #18

osarda I think you are trying to run before you can walk.  If like you say you have zero coding experience you really should at a minimum try to learn some form of programming language before jumping in at the deep end.

Depending on what language you find easiet to understand JavaScript or C# try looking up some beginners tutorials so that you get some understanding of the language syntax, flow etc.

;-)

 

Vuforia VideoPlayback in Unity

October 23, 2014 - 1:41pm #17

ElCuerop63,

I was I could do this bit of editing with the right syntax and all but since I have ZERO and I do mean ZERO coding experience. It is all guess work unfortunately! :(

It makes sense now that you tell me that the ImageTarget needs a bit of extra code to play the video for touch & play.

I can't even get the script to build properly without an error with the script you sent me. But I will play along and say that if turned the false to a true, would that give me the pause functionality? 

Either way - you get what I am trying to do. I just want to be able to play videos without the scenemanager and appmanager either in AutoPlay or by touching a play/pause button. That's all. Wish it wasn't this convulated.... Or I such a newbie when it comes to coding... 

I am attaching the TrackableEvenTHandler script I pathetically tried to edit to no avail.... I got it down to one error. Still no cigar! ;)

Thanks again for all your support ElCuerop63. 

 

OSARDA

PS. I switched the format to jpg from cs to upload it directly to you. Switch it back to TrackableEvenHandler.cs to see my crappy edit/paste job... 

AttachmentSize
Image icon TrackableEventHandler.jpg5.89 KB

Vuforia VideoPlayback in Unity

October 23, 2014 - 12:10am #16

Ok, quick and dirty (I'm at work now) but you need to add code to detect touches because we are not using the SceneManager and AppManager in the sample

Add this to your TrackableEventHandler file:

// test for touch 
if (Input.touchCount == 1) {
			
   // grab reference to this touch
   Touch userTouch = Input.GetTouch(0);
			
   if (userTouch.phase == TouchPhase.Began) {

	video = GetComponentInChildren<VideoPlaybackBehaviour>();

	if (video.CurrentState != VideoPlayerHelper.MediaState.PLAYING) {

	   video.VideoPlayer.Play(false, video.VideoPlayer.GetCurrentPosition());
	}
    }
}

Note this will play the video from a tap anywhere on the screen and does not provide tap to pause.....this is an exercise for you, you need to get this to run when tapping on the video only plus pause if already playing....look at the sample...the answer is there ;-) See VideoPlaybackAppManager

 

 

Regarding the video aspect I added this to the VideoPlaybackBehaviour file

 

 

Vuforia VideoPlayback in Unity

October 22, 2014 - 4:49pm #15

ElPuerco63,

 

Here is a link to the video file I converted from a MOV to M4V. It successfully plays in your setup under Auto Play but not when turned off... 

The Play Icon does show up but nothing starts the video... ?

https://www.dropbox.com/s/ws8pkf8i1xh9u5l/Moonwalk.m4v?dl=0

Please advise.

 

Cheers,

 

OSARDA

Vuforia VideoPlayback in Unity

October 22, 2014 - 4:25pm #14

Did you tweak any script or syntax anywhere? I noticed your turned on AutoPlay but that shouldn't be any issue.

I added the public property for keep aspect ratio of the video so when unchecked the video remains at the sie I set in scene design 

 

Elpuerco63 - would you please care to elaborate what script you added the public property to? 

Just want to make sure I follow your every step through the process. 

 

Cheers,

 

OSARDA

Vuforia VideoPlayback in Unity

October 22, 2014 - 4:19pm #13

Hello Elpuerco63,

Thx again for your support and advice.

I managed to successfully play a video with your Unity Assets. I tried converting the video in VLC to no success then with Quicktime to no success and managed to get a video of mine to play once I ran it through Apple Compressor outputting to the m4v format. 

Here comes the crazy part... If I simply remove the checkmark 'Auto Play' under ImageTarget/FlatScreen TV/Video - it doesn't work. Tried a couple different videos and nothing works now. Only when I turn on Auto Play do the videos actually play correctly. This is insane. 

I tried turning on keyframe textures and videomaterial with the vuforia png stills to run it as a movie texture while keeping the Path the same... Nothing. I actually get the Play button to show up in AR but nothing happens when I touch it. 

If you have time, try turning off 'Auto Play' and see if you get videos to work on your end as well. I would be curious to hear the results you get. I am halfway there now since I can Auto Play videos thx to you. It shoudn't be this complicated and finnicky. 

Cheers,

 

OSARDA.

 

Vuforia VideoPlayback in Unity

October 22, 2014 - 2:45am #12

"I did try other video formats than .mov... I tried ogg like it recommends in Unity. "

I believe that the Vuforia plugin requires .m4v, that is how I use it so have never tried other formats

 

"Should I try .m4v instead? Is there a special conversion you did for that video to work? Or a specific resolution? "

It would make sense to me.  I use QuickTime 7 Pro to convert to m4v but I think VLC also does it

 

"Interestingly, under the Image Asset/FlatScreen TV/Video - you don't specify the texture either on VideoMaterial or on VideoPlayback Behavior(script). "

Then maybe I am not actualy playing video on a texture and rather just a GameObject, but for all of my circumstances to date the way I do it fits the bill ;-)

 

"You are using the standard video file from Vuforia which i did use successfuly myself. "

That is correct

 

To understand your steps:

- Use Video Prefab and assign the video path under Video Playback Behavior (Script)

Correct

 

The Video file lives under StreamingAssets but does not show up as a playable file in Unity... just a white icon? 

Correct

 

- Place Video/Plane/Prefab under Image Target - in this case you parented it to Flatscreen TV for obvious reasons

Correct

 

- Under Image Target - you replaced/removed the Default Trackable Event by the Tracable Event Handler (Script)

Correct

 

- In The AR Camera - you loaded the dataset and activated it for AR then added a Play Video (Script) 

Correct

 

That should more or less be all the steps to make it happen and replicate what you have done, right?

Correct

 

Did you tweak any script or syntax anywhere? I noticed your turned on AutoPlay but that shouldn't be any issue.

I added the public property for keep aspect ratio of the video so when unchecked the video remains at the sie I set in scene design 

 

Am I missing something? Trying to figure out how you did it. 

That seems to be it, but look through the project I sent and then ask what confuses you

 

Any recommendation as to video conversion software? Mov to M4V or MP4 to M4V etc.... ? 

QuckTime / VLC to name two

 

Cheers again for the awesome help.

You are welcome ;-)

 

Vuforia VideoPlayback in Unity

October 21, 2014 - 3:48pm #11

ElCuerpo63 - Thank you. You are awesome. 

I have checked the APK and Xcode and Unity Assets and they all seem fine. It works in other words flawlessly.

Now comes the part where I have to figure out where I go wrong. I did try other video formats than .mov... I tried ogg like it recommends in Unity. 

Should I try .m4v instead? Is there a special conversion you did for that video to work? Or a specific resolution? 

Interestingly, under the Image Asset/FlatScreen TV/Video - you don't specify the texture either on VideoMaterial or on VideoPlayback Behavior(script). 

You are using the standard video file from Vuforia which i did use successfuly myself. 

 

To understand your steps:

- Use Video Prefab and assign the video path under Video Playback Behavior (Script)

The Video file lives under StreamingAssets but does not show up as a playable file in Unity... just a white icon? 

- Place Video/Plane/Prefab under Image Target - in this case you parented it to Flatscreen TV for obvious reasons

- Under Image Target - you replaced/removed the Default Trackable Event by the Tracable Event Handler (Script)

- In The AR Camera - you loaded the dataset and activated it for AR then added a Play Video (Script) 

That should more or less be all the steps to make it happen and replicate what you have done, right?

Did you tweak any script or syntax anywhere? I noticed your turned on AutoPlay but that shouldn't be any issue.

Am I missing something? Trying to figure out how you did it. 

Any recommendation as to video conversion software? Mov to M4V or MP4 to M4V etc.... ? 

 

Cheers again for the awesome help.

 

OSARDA

 

 

Vuforia VideoPlayback in Unity

October 21, 2014 - 1:48pm #10

Hi,

OK here you go, let me know if it helps...

You will find all you need at the link below that contains:
 
Unity Project
 
IOS Project
 
Android APK file
 
Unity: open the scene Main under Assets ;-)
 
IOS you will need to add your own Apple Dev details to compile to device
 
Android feel free to install, but understand re Android you should not install from known sources, it is clean, but if uncomfortable just re-output from Unity
 
What you should see....point device at the stones image that comes with Vuforia samples and a nice flat screen tv will have the video playing on it..
 
I've run on two different IOS devices and two different Android and it works as I would expect ;-)
 
Enjoy, any questions ... ask away
 
;-)
 

Vuforia VideoPlayback in Unity

October 21, 2014 - 12:59pm #9

Hi,

OK, you got a lot of missing messages there, plus you have a .mov file?  I believe the format has to be m4v.

 

I'm just waiting for my upload to Dropbox to complete and will post link, you will see how I have done it, it includes Unity and IOS projects and the Android apk...

 

Will post link once upload complete...it's slow lol ;-)

 

Vuforia VideoPlayback in Unity

October 21, 2014 - 12:43pm #8

Hello again ElPuerco63,

Here goes a sample project with a video of mine which won't play... I did not include the Vuforia VideoPlayback-3-0-10 package since that would take too long to download and I am quite sure you have it handy... If you open up the VideoTest scene, you can see my setup which won't work on either Android or iOS.

You may find the problem or not from there. 

Thx again for all your support.

https://onedrive.live.com/redir?resid=768749BE1A4AE8CD%2143847

Cheers,

OSARDA

Vuforia VideoPlayback in Unity

October 21, 2014 - 11:58am #7

Elpuerco - you are my hero! :)

Thank you so much for offering this support. Yes. I would love to figure out why I am not getting any proper video playback results. 

I am now intrigued to find out why it would work for you and not for me especially if 4.6 beta is not the issue at hand here. 

Your small tester project for download would be a boon and I should probably do the same and send it to you to see if my setup works on your end? 

Would that be work for you? 

 

Again - a million thx for your advice & help.

 

Osarda

Vuforia VideoPlayback in Unity

October 21, 2014 - 11:28am #6

I have used 4.6 beta with no problems and have video running on both Android & IOS, same goes for current 4.5 version.  In fact I was heavily developing my app in 4.6 beta and then realised as Unity rightly states....don't use for production!  So reverted to 4.5

What I can do to help is to create a small tester project and confirm at my end that I can run on both Android and IOS.  I have access to a few devices in each platform so can see it worsk.

Once Ihave it ready I'll post a link for you to download, will that suffice?

Vuforia VideoPlayback in Unity

October 21, 2014 - 11:00am #5

Thx for your reply elpuerco63. I really appreciate you trying to help me with this issue. 

I am starting to think that Unity 4.6 beta might be my issue and not my Nexus 5. I can indeed run the Vuforia video samples just fine on the phone but nothing else I have tried worked. In fact, the video texture/plane shows up in my scene but disappears when running on the mobile. It's not even recognized. I would expect the texture or 3D plane to show up but no... nothing. Nada. 

I am not sure what I am doing wrong or how you can help me since I have followed the step-by-step process. Anyway, I am all ears and would be happy to have you assist me in solving this mysterious issue of not being able to play videos on either iOS or Android. 

 

Cheers,

 

Osarda

 

Vuforia VideoPlayback in Unity

October 20, 2014 - 11:30pm #4

Hi,

I can get the videos to play on textures no problem at all.

What might be a good test is to modify the sample, add a cube the grab the stones video and rotate and position it on the face of the cube.  That is minmal mods to the orignal and should just work.

Let me know, I am happy to step you through it / what I do...

Vuforia VideoPlayback in Unity

October 20, 2014 - 12:52pm #3

Thx for your reply elpuerco63. My problem is still there unfortunately. I can't get videos to play outside of the sample video/scene that comes with the vuforia package. 

I am using a Nexus 5 which is pretty reliable generally. I am trying to find a solution that would work well for both iOS and Android when it comes to playing videos on mobile. 

Can't say I am a fan of Movie Textures so far. It has never worked for me! :(

 

Cheers,

 

Osarda.

 

 

Vuforia VideoPlayback in Unity

October 17, 2014 - 1:45am #2

I think you will find the docs say that the video playback does not work when viewing in Unity viewr, you have to use a device. It also states I believe that if you see the X icon it menas all is well, which is the case as you see for yourself when you build it.

The docs also say that the videos have to reside in that folder, just the way it is, same as when loading assets Unity exects the files to be in a certain folder ;-)

I found that yes you have to type the video name manually, but really that is no problem...really? ;-)

So from what I can gather it is actually all working good for you ;-)

 

 

 

 

Log in or register to post comments