Is it possible to stream a video rather than keeping it inside the device itself as used in Video Playback example ??
EDIT: I tried to delete this post because of the last one. But I couldn't.
Actually it is possible to play the streamed video on texture on iOS. And also it doesnt have to store it first. Video starts in 2 seconds with 3G network (16mb). We use rackspace ios video streaming service. We have managed to achieve that with 3rd party plugins.
In general it is possible to play video that are streamed from a URL, this article for instance shows how this can be done with the Unity Video Playback sample:
https://developer.vuforia.com/forum/faq/unity-how-do-i-play-video-url
However note that there are some limitations; for example, on iOS you cannot play a video "on-texture" if this is streamed from a network URL;
for more information on what is possible and what not (depending on which platform you use) see also:
https://developer.vuforia.com/forum/faq/videoplayback-what-videos-can-i-play-what-platform
Actually it is possible to play the streamed video on texture on iOS. And also it doesnt have to store it first. Video starts in 2 seconds with 3G network (16mb). We use rackspace ios video streaming service. We have managed to achieve that with 3rd party plugins.
What if i wanna play multiple videos for different targets available in the videoplayback sample ??
setdatasource take's path of only one video ... I wanna add multiple video files to it.
Thanks for this tip, temporalxD;
this is interesting,
so, using this library, what is the approach you would recommend ?
Downloading the video from youtube and storing it on your file system, and then loading and playing the video from the file system ? or is there a way to get a video URL that works with the VideoPlayback (i.e. direct streaming from the URL ) ?
To play youtube stream video, you could use this library http://rg3.github.io/youtube-dl/download.html
You could generate stream url using youtube-dl -g {url video} but its too slow, the library takes 8 seconds to get stream url, and there are 4 seconds to get video playing.
Also youtube create a customized stream url, then you can't generate stream url in a serverside or pre generate the url.
Tested in Android.
In general it is possible to play video that are streamed from a URL, this article for instance shows how this can be done with the Unity Video Playback sample:
https://developer.vuforia.com/forum/faq/unity-how-do-i-play-video-url
However note that there are some limitations; for example, on iOS you cannot play a video "on-texture" if this is streamed from a network URL;
for more information on what is possible and what not (depending on which platform you use) see also:
https://developer.vuforia.com/forum/faq/videoplayback-what-videos-can-i-play-what-platform
Hi!
my question is similar but not same. I have to stream a video for a standard URL (example http://www.someurl.it/video.mp4) and also I have to download it in background (but this is not a problem) and make it in full screen also if in streaming also if in localhost.
Is it possible? And if it is, how can I do this?
Thank's a lot
HI Guys
Can you please help me out in playing the external video over the texture of image. Currently if we pass the external url , the MPMoviePlayer is psuhed on navgation controller and played. If the video is saved locally, then video is played over the image. So can you please help me by which means i can play video from external url over the image.
Thanks in advance!!!
You can't just load a Youtube video with the sample code used in the VideoPlayback sample, because the VideoPlayback sample cannot play or load URL of Youtube videos, as I was saying. The reason is that the URL must point to an actual video file (Youtube videos do not expose a video file, they just expose a video link which hides the actual file behind the Youtube public interface)
So, there is simply no line of code to change. It just cannot be done.
If you wanted to play a Youtube video, you would need to use a Web browser (e.g. a UIWebView in iOS for example, i.e. open the Youtube link in a web page), but this is a different technique, which has nothing to do with the Video Playback sample and with Vuforia.
Youtube links (URLs) typically do not explicitely reveal the video file (e.g. .mp4 or .m4v), so you will not be able to apply the videoplayback sample technique for those;
you would need a URL where the video filename appears explicitly, like: //http://host/videos/some_video.mp4 (Youtube videos are not exposed this way)
See also:
https://developer.vuforia.com/forum/faq/videoplayback-what-videos-can-i-play-what-platform
HI Guys
I am developeing an IOS application using vuforia Video Playback. I want to play the video from you tube link in vuforia video playback. When the video is added in the local bundle , it works fine. Now can you share me piece of code where i can add the youtube link and play the video when user clicks on texture.
Thanks
Roh
Hi,
I added the link in Videoplayback.java , VideoPlayerHelper.java and FullScreen.java like this,
in videoplayback.java
mMovieName[STONES] = " http://giftsoninternet.com/android/EngageApp/VuforiaSizzleReel_1.m4v";
in VideoplayerHelper.java
mMediaPlayer.setDataSource(" http://giftsoninternet.com/android/EngageApp/VuforiaSizzleReel_1.m4v");
and in FullScreenPlayback.java
mMediaPlayer.setDataSource(" http://giftsoninternet.com/android/EngageApp/VuforiaSizzleReel_1.m4v");
but i am getting the video played. Am I wrong anywhere? plz help me.....
Thanks in Advance.
hi , I m facing a problem when loading the video from URL .when i capture to image target ,the error button image will showing and i can not play the video .
i had change the coding on the videoPlayback.java
and the coding on the videoPlayerHelper.java
how can I get direct link youtube as m4v ??
I add this code:
mMediaPlayer.setDataSource("rtsp://r7---sn-o097zuer.c.youtube.com/CiILENy73wIaGQmePdP8gDEB8hMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp");
but it's not working ! help me plz
Actually when I changed the path to the link the video streamed correctly. But it only plays in full screen and when I deploy the app to iPad 4 it sees the app as an iPhone app. (with x2 scaled) I use videoplayback 2.6.7 sample. Is it possible to play inside of the rectangle as normal with as native iPad app.
This code is for Android, and the code should be still there in the samples... are you using Unity or iOS ?
I m using Unity and I couldn't find a code to uncomment or smt to achieve remote video streaming. Can anyone help?
Same here? how can I stream a video with unity?
Hi Alessandro,
Thanks for your reply. I am using Unity (and targeting Android devices). Could you advise me on how to stream a video through using Vuforia (with Unity)? At the moment I am trying to modify the Vuforia classes: VideoPlayerHelper class and the VideoPlaybackBehaviour but I can't seem to get it to stream a video. I always end up with an hour glass icon on the screen which never goes away and no useful error information from Logcat or Unity.
El
This code is for Android, and the code should be still there in the samples... are you using Unity or iOS ?
Hi Alessandro, I am trying to stream a video exactly as the OP mentions and your solution sounds like what I'm looking for. However, the latest download from the Vuforia website for the Video Playback example does not contain the code you posted (below)-
mMediaPlayer = new MediaPlayer();
// This example shows how to load the movie from the assets folder of the app
// However, if you would like to load the movie from the sdcard or from a network location
// simply comment the three lines below
AssetFileDescriptor afd = mParentActivity.getAssets().openFd(filename);
mMediaPlayer.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(),afd.getLength());
afd.close();
// and uncomment this one
// mMediaPlayer.setDataSource("/sdcard/myMovie.m4v");
In practice you will need to use something like:
mMediaPlayer.setDataSource("http://some_url_to_some_video");
Also, the class you use - MediaPlayer, does not exist. Could you please advice me on the latest solution? Thanks a lot!
You're welcome. Yes, make sure to add it to our wish-list.
https://developer.vuforia.com/forum/general-discussion/wish-list
Thanks.
@ Dalee: afaik, BeHappy is right on the YouTube URL; you cannot use it directly, as it does not point to the actual video (the Youtube URL rather points to some page that will play the video, but this is not equivalent as pointing to the video file directly)
But as Dalee said, by searching the internet you might find more detailed information on this topic...
@Dalee I will explain how i did it in Unity for Android device,
I downloaded the youtube video using SaveVid Downloader in the mp4 format and added it to a server. After that you can try to open the video pointing to the URL in your mobile browser to check if it is playing. If it doesnt play then there is some problem with the server or mobile.
If it is playing then u can just copy paste the URL directly into the path of the VideoPlayback behaviour script. That should work for sure.
@BeHappy Thanks for your response!
I tried adding the youtuble and converted it to .flv format (using the links provided ) but no go i just see a vuforia image on top with a play button and when i click on it an hourglass comes up for a second and nothing else.
Can you also explain me how did you download a youtube video and add it in assets using this sample and i am doing this in iOS.
Thanks,
Dalee Davis
@ Dalee, May be the following post will help you get the link of youtube video's,
http://tips4pc.com/youtube/find-the-url-of-a-youtube-video.htm
Hi Dalee and Alessandro,
The limitation with URL streaming is we cannot play the video on top of the Target and hence it will play on the video player only.
We need to provide the URL in the variable named "path" available in video behaviour script and Yes we need to give the exact path of the video link like http://www.123.com/videos/myvideo.mp4
And if we want to play the video on top of the Target we need to download it to the Streaming Assets folder at runtime and then play it, but well it will take some time.
Edit : I used Unity to develop the application hence am not sure of the Java file name, think it is the one given by Alessandro in a comment below.
Thaks for ur Reply!!
@AlessandroB - Can you let me know how it can be done in iOS.
As you mentioned Youtube URL points to a link so can you tell me if i can add a UIWeb View to embed youtube link for iOS
but i am not able to figure out how will i add a UIWebview when a target is detected and how will i specify its frame(i.e. x, y cordinates)
I want the same the frame size that comes in the default video playback sample provided. Kindly help me..:)
Thanks,
Dalee Davis
Hi Dalee, I hope BeHappy will also answer your question;
just a little comment from my side;
afaik the Youtube videos URLs usually do not point to the actual video file, but rather to some web page link; as a consequence you should not be able to stream directly from Youtube URLs using the Android MediaPlayer API (of course you can run a quick test to confirm that).
Yes, it is possible. If you are using Android, you can have a look at the VideoPlayerHelper.java file, in the load function:
there you'll find some code to do that (I report it here for convenience):
mMediaPlayer = new MediaPlayer();
// This example shows how to load the movie from the assets folder of the app
// However, if you would like to load the movie from the sdcard or from a network location
// simply comment the three lines below
AssetFileDescriptor afd = mParentActivity.getAssets().openFd(filename);
mMediaPlayer.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(),afd.getLength());
afd.close();
// and uncomment this one
// mMediaPlayer.setDataSource("/sdcard/myMovie.m4v");
In practice you will need to use something like:
mMediaPlayer.setDataSource("http://some_url_to_some_video");
Thanks for pointing this out. I am aware that you can play streamed video on texture using third party libraries;
what I was referring to is that it is not possible using the functions/API used in the Video Playback sample application code "as is" (i.e. without using 3rd party libs)