I would like to share my recent work about playing video on trackable image, and ask some help.
Thank for vuforia team to release the sample code about how to play video using the vuforia sdk, they use avassetreaderoutput to render video pixel on the opengl texture.
However avassetreader can only work on local video file, if you want to play remote video, you need use native mpmovieplayer and into the fullscreen mode.
I try to solve this problem.
The idea is simple.
1.I don't use avassetreader to read the video pixel, instead I use AVPlayer and AVPlayerLayer which can play remote video file.
2.I need to convert opengl modelview matrix to CATransform3D so the AVPlayerLayer will attach on the trackable image.Thanks for Hammer on stackoverflow, he shared an example about how to make this.
3.I tried to render camera background use opengl and AVPlayerLayer at same time, but the performace is not good enough, so I use another calayer to render the camera background. There is a bug in 1.5.8 when getting camera frame, thank for andersfrank the problem was solved here.
I put my code on pastebin:
I can play remote video now, but still have some problem need to solve:
1. I can't make the video flip up-side down.
2. it's also strange that I need to set m22 and m33 negative in scalingMatrix or the convertion between the modelview matrix and catransform3d is not correct.
3. When I rotate my iphone, the attitude of AVPlayerLayer is not quiet well, may be the convertion is not good enough.
this one looks good.
this one is not.
I was stuck on this problem about 3 weeks. Please check the code and give me some feedback.
Thank you very much.
Play remote video on image use calayer (sample code)
Note that ARCALView is a subclass of UIView and not UIViewCOntroller . So, if you try to present another viewcontroller modally then it will throw exception. You should add your new view as a subview of ARCALView. That should sove your issue.
Hi Tim, Would you please send
Hi Tim,
Would you please send the source code to the below address for this query,so I can search how to resolve it.
gunsel5537@yahoo.com.cn
Daniel Cho
Play remote video on image use calayer (sample code)
you sir, are a genious!
i had to adopt the code a little bit to get it working with Unity 4 and Vuforia 2.0.30 (i attached the code parts), but it's working!
thanks a lot!
Play remote video on image use calayer (sample code)
Hi, atti,
I am glad that my code can help you.
I also use my code on my iphone app -- vclip.
Play remote video on image use calayer (sample code)
Hi Tim,
I am running into exception while using the code. Can u help me by posting the code on sssujisun@gmail.com. Thanks much.
Play remote video on image use calayer (sample code)
hi Tim, We found your code is useful for our project but it seems not compatiable with SDK 2.0, have you update the sample with sdk 2.0?
Thank you very much
Update 1: Seems name it as .mm instead or .m will help. Thank you
Play remote video on image use calayer (sample code)
Hi, Nice work both, Could you please explain to me in detail, how did you implement on unity vuforia? thanks you in advance :)
Play remote video on image use calayer (sample code)
hi jpatinop,
just download the code and read through this thread. everythings has been explained.
Play remote video on image use calayer (sample code)
Hello!
Play remote video on image use calayer (sample code)
I am looking at using this sample code now; were you able to get it to run with recent versions of Vuforia?
Play remote video on image use calayer (sample code)
Hi TimLai
Play remote video on image use calayer (sample code)
Hi,
Play remote video on image use calayer (sample code)
Firstly TimLai, Great Code!! It has really helped me out!
I am having a bit of trouble with the position of the video on the trackable.
Does anyone know how I can bind the position, scale, skew of the video to the position, scale and skew of the trackable?
Play remote video on image use calayer (sample code)
It actually requires a lot of code and management to make the correct sizing at the rigth time to avoid flickering and resizing.Also, you need to considder if you want to keep the aspect ratio and if you want to scale to height or width.
Play remote video on image use calayer (sample code)
tgotzsche, I am glad to hear that you got it to work!
I have managed to get the video to display and it scales, however it does not seem to apply the proportions of the target image.
Play remote video on image use calayer (sample code)
Hi Tim,
I am studying on the same topic now, would you please send your code to me, that would be a great help, thanks!
Play remote video on image use calayer (sample code)
I tried to fix getPose with code snippet from EAGLView so it could build and QCAR hints with some hints from EAGLview as well, but ended up with:
2013-07-04 15:47:32.422 ImageTarget[1705:907] APPSTATUS_INITED
Play remote video on image use calayer (sample code)
bump - anybody?
Play remote video on image use calayer (sample code)
I think you may need to contact the author of the code directly as it was developed outside.
N
Play remote video on image use calayer (sample code)
Dear all,
I was busy on my PhD degree last two month, so I didn't have time to answer any question from all of you.
I don't use vuforia for a long time so I am sorry I still cann't answer your question.
Tim
Play remote video on image use calayer (sample code)
I have just come across this and hopefully will be implimenting it in combination with the Cloud recognition to play the videos on the fly, somehting which many people seem to be asking questions about.