Video in Augmented Reality

6 views
Skip to first unread message
Message has been deleted

SDaniel

unread,
Sep 6, 2009, 10:35:23 PM9/6/09
to FLARToolKit userz
Hi group!

I'm trying to put a video in augmented reality; the video works
perfectly, is just that the audio starts when the window is open. I
would like the sound and the video start when the marker will be in
front of the cam and <important>pause</important> the video and sound
when the marker is removed, so, when the marker appear again, the
video continue.

I try to put something at the end of the onInit function like
this.addEventListener(Event.ENTER_FRAME, this.showVideo);
And in showVideo function the code of the video. But I get only
errors.
My code is here: http://pastebin.ca/1556696

Any help is appreciated greatly.
Thank you (:

jimalliban

unread,
Sep 7, 2009, 6:29:20 AM9/7/09
to FLARToolKit userz
Hi SDaniel

After netStream.play("borg.flv"); you should pause the netStream -
netStream.pause();

Then once the marker is recognised/removed, call netStream.resume();
or netStream.pause(); where appropriate.

I always like to wait for a couple of seconds after the marker is
removed before pausing the video, that way you don't get a stutrtered
playback.

I also like to fade the video and sound in and out. I achieve this by
executing the following code every frame:

var videoVolumeTransform:SoundTransform = new SoundTransform();
videoVolumeTransform.volume = _volume;
_netStream.soundTransform = videoVolumeTransform;

I then just tween _volume as I tween the alpha of the video.

SDaniel

unread,
Sep 7, 2009, 12:26:57 PM9/7/09
to FLARToolKit userz
I said: you're the best!
Bue, now I have other problem :s
If the marker is closer to the cam, everything ok. But, if the marker
is not closer, the video is frozen, like when the video has not
completely loaded and played by pieces.


Thank you for your help Tim. I will upload the source cdode soon, I
see many guys with the same problem.
Reply all
Reply to author
Forward
0 new messages