Taking Screen Snapshots

Is anyone aware of a way to take screen captures of the video and save those to the player storage for later viewing



Answer this question

Taking Screen Snapshots

  • droujav

    well actualy i have read Peter's blog and i have played with the samples... it's only that there are concepts that i don't understand

  • Lostlogic

    and how you got to copy from the filecache to p. storage i'm so noob... :P

  • Andres Aguiar

    How do you display it in markup Do you have write it first to persistent storage

    I've used this along with your code but no images was shown. (using HDi simulator):

    in script:

    document.screenshot.style.backgroundImage=url("file:///filecache/image.cvi");

    in markup:

    <div id="screenshot" style:position="absolute" style:x="0px" style:y="0px" width="1920px" height="1080px" style:display="auto" />


  • Chandrakanttt

    Jacco - Once you've taken the screen shot, its in the filecache and ready to use - you don't need to copy it to the p-stor and then copy it back to use it.  Putting the screenshot in p-stor is for when you want to access it later.  You only need to copy from p-stor back to the filecache after your app restarts (ie,  you've ejected the disc) and the screenshot is removed from the filecache (or if the screenshot is removed from your filecache during your app due to garbage collection).

    Xavier - FileIO is its own object, it is not a member of application (use FileIO.copy).  Once you've finished your screen shot, you can set the background image of a div to uri('file:///filecache/myimage.cvi').  Your code is not triggered by button press, its triggered by a scheduled event from the playlist.  And the place you should store this is in your content directory ("file:///required" + PersistentStorageManager.contentId)



  • Seb.Net

     Xavier Arnau wrote:

    i can't follow you at all, you say that in this code the event comes from the playlist... what i need to write in the playlist to do that

    On the other side... i don't understand the part of ps directory, i have to create it manually Or it already exists How can i open it to saw if there's anything in...

    I have C:\Archivos de programa\HD DVD Interactivity Jumpstart\Samples\Events\ADV_OBJ and

    C:\Archivos de programa\HD DVD Interactivity Jumpstart\Samples\Events\HVDVD_TS so where is the ps directory

     

    For firing events from the playlist use

    <ScheduledControlList>

       <Event id="fireEvent" titleTime="00:00:05:00"

    </ScheduledControlList>

    This will call your function in the script corresponding to that event after 5 seconds in that title.

    Persistent storage is created automatically. Look into C:\HDDVD\HD_DVD folder and you will find it.



  • sandyJ

    i can't follow you at all, you say that in this code the event comes from the playlist... what i need to write in the playlist to do that

    On the other side... i don't understand the part of ps directory, i have to create it manually Or it already exists How can i open it to saw if there's anything in...

    I have C:\Archivos de programa\HD DVD Interactivity Jumpstart\Samples\Events\ADV_OBJ and

    C:\Archivos de programa\HD DVD Interactivity Jumpstart\Samples\Events\HVDVD_TS so where is the ps directory



  • DenisCote

    Ohhh man...now i can bokmark videos! I just got screenshot bookmarking working...just swap the code...too easy!

    ~thanx!


  • AussieNoobie

    Yes, you can save to p-stor on the simulator. However, images referenced in the markup must first be loaded into the filecache.

  • Dan_Brownlow

    The p-stor directory is automatically created when you write to the content directory. When using the simulator, I believe these directories will be created in your C:\Archivos de programa\HD DVD Interactivity Jumpstart\HD_DVD folder (if not, do a search for the HD_DVD folder on your hard drive).

    Xavier - sounds like you are new enough to HDi that you would benefit from playing around with the sample applications from Microsoft more:

    http://www.microsoft.com/downloads/details.aspx FamilyId=E19C869B-EF37-4E5E-91ED-32D059E3775B&displaylang=en

    You will find examples of how to listen for key press events and the virtual key codes that represent the remote control keys.

    Also, take a look at Peter Torr's blog (http://blogs.msdn.com/ptorr/) he has a lot of great code examples that will help you. Start with his "Hello World" sample (http://blogs.msdn.com/ptorr/archive/2006/03/29/564548.aspx) and work forward.

    Good Luck.



  • neotom

    Using something like: application.FileIO.copy("file:///filecache/myimage.cvi","file:///required/myimage.cvi",true,function(){ });

    But you better use a real function instead of just function(){}


  • Joe G

    Just got it to work! Pretty cool feature. How to do it is a bit unusual, you first have to capture a "screenshot" to the filecache then copy the .cvi file from the filecache to the p. storage then copy it from the p.storage back into the filecache and then use some line to display it on screen.

    Using SACA's emulator for testing.

    BTW, if you want to view the cvi file: rename it to .raw open it in photoshop, enter for width and size 1920x1080 (or an other size if you have scaled it). However the picture is displayed in gray, maybe someone knows of a way to display .cvi images correctly


  • nsam

    Real code I stole from my boss, the playlist has a scheduled event when the capture is required:

    application.addEventListener( "scheduled_event", OnScheduledEvent, false );

    function VideoMainCaptureCallback(i,uri)
    {
    Player.playlist.play();
    }

    function PlayerVideoMainCapture(filename)
    {
    try
    {
    Player.video.main.capture(filename,VideoMainCaptureCallback);
    }
    catch (ex)
    {
    DebugOutput("PlayerVideoMainCapture(" + filename + ") Exception: " + ex.message);
    }
    }


    function OnScheduledEvent(evt)
    {
    if (evt.id == 'Five')
    {
    Player.playlist.pause();
    PlayerVideoMainCapture("
    file:///filecache/test.cvi");
    }
    }




  • ShaneShowers

    application.addEventListener( "scheduled_event", OnScheduledEvent, false );

    function VideoMainCaptureCallback(i,uri)

    {

    application.FileIO.copy("file:///filecache/myimage.cvi","file:///required/myimage.cvi",true,aplicationFileIOCallback);

    }

    function aplicationFileIOCallback()

    {

    Player.playlist.play();

    }

    function PlayerVideoMainCapture(filename)

    {

    try

    {

    Player.video.main.capture(filename,VideoMainCaptureCallback);

    }

    catch (ex)

    {

    DebugOutput("PlayerVideoMainCapture(" + filename + ") Exception: " + ex.message);

    }

    }

     

    function OnScheduledEvent(evt)

    {

    if (evt.id == 'Five')

    {

    Player.playlist.pause();

    PlayerVideoMainCapture("file:///filecache/myimage.cvi");

    }

    }

    The event is called with a button etc, well, this don't work, any tip And where should be the myimage.cvi stored I'm usind the MS Sim



  • Davids Learning

    i'm interested on this, can you work with PS with the Simulator

  • Taking Screen Snapshots