Log in or register to post comments

Cloud Reco + Videoplayback + Metada video url

March 29, 2014 - 8:39pm #1

Hi.

I mixed the Cloud Recognition sample app, with the Videoplayback sample app, in Unity3D.
It works fine with a static video path (embedded video) or a static url (streaming video) declared in the VideoPlaybackBehaviour script (in the Videoplayback video prefab) via Unity editor.

I want the video to change, based on the tracked image metadata.
When I created the Cloud Recon database and uploaded the image to be tracked, I also uploaded a txt file as metadata. It only contains a video url (http://domain/video.m4v), wich I want to use to change the video according to the image being scanned.

I'm stuck and cannot get it.
Can anyone help me and point me to the solution? Which script to change? and how?
Thanks in advance.

 

PS: English is not my native language. I'm sorry if I couldn't make my self clear. Ask me whatever you can't understand in my question.

Cloud Reco + Videoplayback + Metada video url

March 6, 2017 - 2:50pm #9

Trying to do exactly the same think.

I think I need further guidance.

Cloud Reco + Videoplayback + Metada video url

March 3, 2017 - 4:30am #8

hello someone has solved? I have the same problem?

Cloud Reco + Videoplayback + Metada video url

November 30, 2015 - 9:47am #7

Hey,

Ihave this exact problem. I'm fairly new to C# and just starting. I can see that I need to get metadata info from CloudRecoEventHandler to VideoPlaybackBehaviour where m_path is located.

I'm using CloudRecoEventHandler from the sample and i'm wondering if I need to change this part somehow?

/// <summary>
    /// Handles new search results
    /// </summary>
    /// <param name="targetSearchResult"></param>
    public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult)
    {
        // This code demonstrates how to reuse an ImageTargetBehaviour for new search results and modifying it according to the metadata
        // Depending on your application, it can make more sense to duplicate the ImageTargetBehaviour using Instantiate(), 
        // or to create a new ImageTargetBehaviour for each new result

        // Vuforia will return a new object with the right script automatically if you use
        // TargetFinder.EnableTracking(TargetSearchResult result, string gameObjectName)
        
        //Check if the metadata isn't null
        if(targetSearchResult.MetaData == null)
        {
            return;
        }

        // First clear all trackables
        mObjectTracker.TargetFinder.ClearTrackables(false);

        // enable the new result with the same ImageTargetBehaviour:
        ImageTargetBehaviour imageTargetBehaviour = mObjectTracker.TargetFinder.EnableTracking(targetSearchResult, mParentOfImageTargetTemplate) as ImageTargetBehaviour;
        
        //if extended tracking was enabled from the menu, we need to start the extendedtracking on the newly found trackble.
        if(CloudRecognitionUIEventHandler.ExtendedTrackingIsEnabled)
        {
            imageTargetBehaviour.ImageTarget.StartExtendedTracking();
        }
    }

Also in the VideoPlaybackBehaviour script how exactly I use the metadata?

public class VideoPlaybackBehaviour : MonoBehaviour
{
    #region PUBLIC_MEMBER_VARIABLES

    /// <summary>
    /// URL of the video, either a path to a local file or a remote address
    /// </summary>
    public string m_path = null;

 

Cloud Reco + Videoplayback + Metada video url

October 21, 2015 - 12:05pm #6

Any help me plz?

Cloud Reco + Videoplayback + Metada video url

October 9, 2015 - 12:30pm #5

Hi.How can I send the metadata to m_path variable from Videoplayback class? I have the same issue. Please Anyone help me. Thanks

Cloud Reco + Videoplayback + Metada video url

October 7, 2015 - 10:33am #4

Im stuck at the same point, I´m able to recognize the cloud target and the metadata but I cant write the metadata text to the m_path variable. Does anyone have a solution for this or can explain further how we can achieve that.

Really appreciate any help.

Cloud Reco + Videoplayback + Metada video url

October 6, 2015 - 6:31am #3

Does anyone have a solution to this problem? I have the same issue.

Cloud Reco + Videoplayback + Metada video url

March 30, 2014 - 12:19pm #2

Hi,

uploading the video URL as text in the metadata of each Cloud target is definitely is the correct approach for your use case;

this article goes a bit further and explains how you can read back the metadata and use them, with basic code snippets:

https://developer.vuforia.com/forum/faq/cloud-metadata-how-can-i-store-my-data-cloud

 

Also, the following article explains how to build a simple Cloud reco app that simply retrieves the target metadata when a target is detetced (this does not show how to play a video, but you can use this as a starting point, to handle Cloud Reco properly):

https://developer.vuforia.com/forum/faq/unity-how-do-i-create-simple-cloud-reco-app

 

Finally, this article explains how you can play video from a URL using the VideoPlayback sample:

https://developer.vuforia.com/forum/faq/unity-how-do-i-play-video-url

The rest of your problem is about combining the samples and the information above into an application logic... but this is up to you, as it will be specific to your application architecture.

 

 

Log in or register to post comments