Exporting Video files along with project

(7 posts) (3 voices)
  1. DJ

    member
    Joined: Jun '13
    Posts: 37

    I have couple of videos in my project. [Like Intro , and couple of cutscenes]
    When I run the project they are playing fine within the Studio.

    However I am not sure how to export them along withr rest of my project.
    When I export, the output doesn't have any video.

    The Videos have been added to \Sources\Videos directory
    Format is .WMV

    Do I need to manually copy the Videos and put it somewhere in the output directory?

    Thanks for your time

    Posted 11 months ago #
  2. iainB85

    Interplanetary Delivery Boy
    Joined: Jun '08
    Posts: 515

    If the videos are referenced by something I believe they should be exported with your project.

    Are you getting any warnings or errors in your build output smart console in the build tab after you publish the project?

    Posted 11 months ago #
  3. hiddentux

    3D Experience Guru
    Joined: Feb '09
    Posts: 381

    Hi windicefire,

    Videos are not embedded in the binary file (mpbin) exported by Studio, and there is no plan to add this in the foreseeable future.

    Thus you have two options :
    - use an absolute path
    - use an online path

    On a side note, if you try to reference an Asset only by its URI (say an XML file), Studio doesn't have any way to know that it should embed it at the time of the export. So you'll have to import the Asset in your Project, in the right folder (Build Workset -> right click on the directory of your choice in the Tree View -> "Import Asset Manually"). But as I said, that doesn't work with videos.

    I hope you can make it work one way or the other.

    Posted 11 months ago #
  4. iainB85

    Interplanetary Delivery Boy
    Joined: Jun '08
    Posts: 515

    Oh, I did not know that -- I typically host the wmv and use the stream method, as this cuts down the file size of your download anyway

    Posted 11 months ago #
  5. DJ

    member
    Joined: Jun '13
    Posts: 37

    Thanks for the reply

    Online Path - can't have this
    Absolute path OR Do you mean relative path?

    I can publish .exe
    {Build\Export\ePC_default\win32}
    There is data folder inside win32.
    I assume the videos should be part of Data folder.

    However I am not sure how to link videos even if I copy manualy in this folder.

    In Stage file the video is added as below:
    <item create="vkActorTemplate::OpAddTemplate"> <destination>:</destination> <templateToAdd ref="../Videos/Intro.wmv#Intro"/> </item>

    Texture:
    <item path="vkNode2D.Texture" type="vkSmartPtr<vkTexture>" ref="../Videos/Intro.wmv#Intro_texture"/>

    *Mods - I think this question belongs to Build and Publish Discussions.

    Posted 11 months ago #
  6. hiddentux

    3D Experience Guru
    Joined: Feb '09
    Posts: 381

    I meant absolute.

    There's one thing you could try though :

    1- Retrieve the URI of the exported Experience (with something like GetStage().GetProject().GetAssetURI()).
    That should give you "file:///C:/Path/To/Experience/win32/data/experience.mpbin/experience.mpproj"

    2- Get the associated vkString (vkURI::GetString()), and cut it to keep only the part that ends at "data/"

    3- Add "Intro.wmv", recompute the URI (vkString::Create()), and use it as the path for the video

    I've never tested it, but I think it's worth give it a try.

    Posted 11 months ago #
  7. DJ

    member
    Joined: Jun '13
    Posts: 37

    Thanks hiddentux,
    and I should thank camille as well,

    We can get the relative path using the code snippet shared by Camillie.
    Earlier, even after trying to load video using her code, I couldnot get the video to play.

    Reason was that video was not loaded.
    I realized that when I am using breakpoint, video is playing, however when I remove the breakpoint, it won't

    ` vkString str;

    str = GetStage().GetProject().GetAssetURI().GetString();
    //str = "file:///C:/Path/To/Experience/win32/data/experience/experience.mpbin/experience.mpproj"

    vkString::ConstIterator iter = str.FindLast("/");
    str.Cut(iter);
    iter = str.FindLast("/");
    str.Cut(iter);

    //I need to cut twice so str = "file:///C:/Path/To/Experience/win32/data/experience"
    // I have saved my videos manually in the experience folder
    str << "/Videos/Intro.wmv";

    if(introVideo)
    {
    introVideo.SetSourcePath(str);
    introVideo.SetSourceType(vkVideo::EType::File);
    introVideo.Load();

    // Important step if the video is not loaded
    while(!introVideo.IsPlaying())
    introVideo.Play();
    }
    }`

    Hope it helps
    Thanks

    Posted 11 months ago #

Reply

You must log in to post.