locked
Advanced subtitles on xbox 360

    Question

  • Hi,

     

    I have finally managed to setup advanced subtitles in a hd-dvd project. The subtitles display properly on the xbox 360, but the problem now is that they stay displayed and are never removed from the screen even if the specified duration has run out. I have attached my .xas file. Have I missed something obvoius or does the xbox 360 still have problems with advanced subtitles? Anything that might be fixed in the upcoming dashboard release?

     

    .xas file:

    Code Block

    <?xml version="1.0" encoding="utf-8"?>

    <root xml:lang="en" xmlns="http://www.dvdforum.org/2005/ihd" xmlns:style="http://www.dvdforum.org/2005/ihd#style" xmlns:state="http://www.dvdforum.org/2005/ihd#state">

    <head>

    <styling>

    <style id="pos" style:position="absolute" style:x="0px" style:y="980px" style:width="1920px" style:height="100px"/>

    <style id="font" style:font="file:///dvddisc/ADV_OBJ/Miramo.ttf" style:color="white" style:fontSize="x-small" style:textAlign="center"/>

    <style id="hide" style:display="none"/>

    </styling>

    <timing clock="title">

    <defs>

    <set id="show" style:display="auto"/>

    </defs>

    <par>

    <cue begin="00:00:03:00" end="00:00:08:00" select="id('t0')" use="show"/>

    <cue begin="00:00:09:00" end="00:00:13:00" select="id('t1')" use="show"/>

    <cue begin="00:00:13:00" end="00:00:16:00" select="id('t2')" use="show"/>

    <cue begin="00:00:21:00" end="00:00:24:00" select="id('t3')" use="show"/>

    <cue begin="00:00:25:00" end="00:00:28:00" select="id('t4')" use="show"/>

    <cue begin="00:00:29:00" end="00:00:34:00" select="id('t5')" use="show"/>

    </par>

    </timing>

    </head>

    <body>

    <div style="pos">

    <p style="font">

    <span id="t0" style="hide"> Subtitle 1</span>

    <span id="t1" style="hide"> Subtitle 2</span>

    <span id="t2" style="hide"> Subtitle 3</span>

    <span id="t3" style="hide"> Subtitle 4</span>

    <span id="t4" style="hide"> Subtitle 5</span>

    <span id="t5" style="hide"> Subtitle 6</span>

    </p>

    </div>

    </body>

    </root>

     

     

     

     

     

     

    Saturday, November 17, 2007 9:29 PM

Answers

  • If you run your advanced subtitle as an advanced application, the display will work fine.  What you won't get from this is the built in stuff that comes with subtitles, like letting the user surf subtitles by the remote, having the player remember language settings as you go from title to title, and being able to query the player for selected subtitle track.  If you have only one advanced subtitle and its always on, you don't have to do any additional work at all.

    If you were primarily looking to allow the user to activate subtitles via the remote (and you aren’t using subpicture subtitles), you can trap the subtitle keys and handle the subtitle changing yourself with a little bit of script.

    Your playlist title would look something like:

        <Title titleNumber="1" titleDuration="00:05:00:00" id="MainMovie">

          <PrimaryAudioVideoClip titleTimeBegin="00:00:00:00" titleTimeEnd="00:05:00:00" src="file:///dvddisc/HVDVD_TS/VideoFile.Map" dataSource="Disc">

            <Video track="1" />

          </PrimaryAudioVideoClip>

          <ApplicationSegment id="subtitleController" titleTimeBegin="00:00:00:00" titleTimeEnd="00:05:00:00"  src="file:///dvddisc/ADV_OBJ/subtitles.aca/controller.xmf" zOrder="0" autorun="true">

            <ApplicationResource priority="1" size="9999" multiplexed="false" src="file:///dvddisc/ADV_OBJ/subtitles.aca" />

          </ApplicationSegment>

          <ApplicationSegment id="subtitleTrack1" titleTimeBegin="00:00:00:00" titleTimeEnd="00:05:00:00"  src="file:///dvddisc/ADV_OBJ/subtitles.aca/en.xmf" zOrder="1" autorun="true">

            <ApplicationResource priority="1" size="9999" multiplexed="false" src="file:///dvddisc/ADV_OBJ/subtitles.aca" />

          </ApplicationSegment>

          <ApplicationSegment id="subtitleTrack2" titleTimeBegin="00:00:00:00" titleTimeEnd="00:05:00:00"  src="file:///dvddisc/ADV_OBJ/subtitles.aca/es.xmf" zOrder="2" autorun="false">

            <ApplicationResource priority="1" size="9999" multiplexed="false" src="file:///dvddisc/ADV_OBJ/subtitles.aca" />

          </ApplicationSegment>

          <ApplicationSegment id="subtitleTrack3" titleTimeBegin="00:00:00:00" titleTimeEnd="00:05:00:00"  src="file:///dvddisc/ADV_OBJ/subtitles.aca/fr.xmf" zOrder="3" autorun="false">

            <ApplicationResource priority="1" size="9999" multiplexed="false" src="file:///dvddisc/ADV_OBJ/subtitles.aca" />

          </ApplicationSegment>

        </Title>

    And the controller script would look something like:

    var advSubtitles;

    var currentTrack = 0;

    var VK_SUBTITLE_SWITCH = 0xC9;

    var VK_SUBTITLE = 0xCA;

    function handleKey( evt )

    {

        switch (evt.key)

        {

            case VK_SUBTITLE:

                //override the player default

                evt.preventDefault();

                //deactivate current subtitle app

                advSubtitles[currentTrack].inactivate();

                //change track number

                currentTrack++;

                if (currentTrack == advSubitles.length) currentTrack = 0;

                //activate new app

                advSubtitles[currentTrack].activate();           

            break;

            case VK_SUBTITLE_SWITCH:

                //override the player default

                evt.preventDefault();

                //toggle visibility

                if (advSubtitles[currentTrack].state == STATE_ACTIVE)

                    advSubtitles[currentTrack].inactivate();

                else

                    advSubtitles[currentTrack].activate();

            break;

        }

     

    }

    function init()

    {   

        var app;

        advSubtitles = new Array( 3 ); //create as an array to access apps by index

        for (var i=0; i<advancedApplications.length; i++)

        {

            app = advancedApplications[ i ];

            //alternatively, you could push the apps onto the array

            //though order cannot be guarenteed

            switch (app.id)

            {

                case "subtitleTrack1":

                    advSubtitles[0] = app;

                    break;

                case "subtitleTrack2":

                    advSubtitles[1] = app;

                    break;

                case "subtitleTrack3":

                    advSubtitles[2] = app;

                    break;

            }

     

        }

       

    }

    setMarkupLoadedHandler( init );

    addEventListener( "controller_key_down", handleKey, false );

     

    Monday, November 26, 2007 9:15 PM

All replies

  • I just ran your code on Tosh and 360 and it ran fine...what system is this failing on?

    Sunday, November 18, 2007 5:28 AM
  •  JasonG271009 wrote:
    I just ran your code on Tosh and 360 and it ran fine...what system is this failing on?

     

    Hi Jason,

     

    My xbox has version 2.0.5787.0 and the hd-dvd drive has version 2.0.4641.0. Both are european version. My project is authored an a dvd-5 and has vc-1 encoded SD material. What versions and what content did you try?

     

    As described in my previous post the subtitles display correctly, but keeps stacking on top of each other and are never turned off. The subtitles are forced to display via the remote.

     

    Best regards,

     

    Peter

    Sunday, November 18, 2007 11:59 AM
  • This appers to be a player bug. 

     

    It will work if you use an advanced application instead of advanced subtitles, though you will have to handle remote actions with a script file.

    Tuesday, November 20, 2007 1:15 AM
  • Do you think the bug will limit me from using advanced subtitles all together, or will it work if I start the subtitles from a script instead of using the remote?

    My scripting knowledge is a somewhat limitied at the moment, but I'm working on it. An example or something pointing me in the right direction would be great.

     

    Thanks in advance!

     

    Tuesday, November 20, 2007 11:50 AM
  • If you run your advanced subtitle as an advanced application, the display will work fine.  What you won't get from this is the built in stuff that comes with subtitles, like letting the user surf subtitles by the remote, having the player remember language settings as you go from title to title, and being able to query the player for selected subtitle track.  If you have only one advanced subtitle and its always on, you don't have to do any additional work at all.

    If you were primarily looking to allow the user to activate subtitles via the remote (and you aren’t using subpicture subtitles), you can trap the subtitle keys and handle the subtitle changing yourself with a little bit of script.

    Your playlist title would look something like:

        <Title titleNumber="1" titleDuration="00:05:00:00" id="MainMovie">

          <PrimaryAudioVideoClip titleTimeBegin="00:00:00:00" titleTimeEnd="00:05:00:00" src="file:///dvddisc/HVDVD_TS/VideoFile.Map" dataSource="Disc">

            <Video track="1" />

          </PrimaryAudioVideoClip>

          <ApplicationSegment id="subtitleController" titleTimeBegin="00:00:00:00" titleTimeEnd="00:05:00:00"  src="file:///dvddisc/ADV_OBJ/subtitles.aca/controller.xmf" zOrder="0" autorun="true">

            <ApplicationResource priority="1" size="9999" multiplexed="false" src="file:///dvddisc/ADV_OBJ/subtitles.aca" />

          </ApplicationSegment>

          <ApplicationSegment id="subtitleTrack1" titleTimeBegin="00:00:00:00" titleTimeEnd="00:05:00:00"  src="file:///dvddisc/ADV_OBJ/subtitles.aca/en.xmf" zOrder="1" autorun="true">

            <ApplicationResource priority="1" size="9999" multiplexed="false" src="file:///dvddisc/ADV_OBJ/subtitles.aca" />

          </ApplicationSegment>

          <ApplicationSegment id="subtitleTrack2" titleTimeBegin="00:00:00:00" titleTimeEnd="00:05:00:00"  src="file:///dvddisc/ADV_OBJ/subtitles.aca/es.xmf" zOrder="2" autorun="false">

            <ApplicationResource priority="1" size="9999" multiplexed="false" src="file:///dvddisc/ADV_OBJ/subtitles.aca" />

          </ApplicationSegment>

          <ApplicationSegment id="subtitleTrack3" titleTimeBegin="00:00:00:00" titleTimeEnd="00:05:00:00"  src="file:///dvddisc/ADV_OBJ/subtitles.aca/fr.xmf" zOrder="3" autorun="false">

            <ApplicationResource priority="1" size="9999" multiplexed="false" src="file:///dvddisc/ADV_OBJ/subtitles.aca" />

          </ApplicationSegment>

        </Title>

    And the controller script would look something like:

    var advSubtitles;

    var currentTrack = 0;

    var VK_SUBTITLE_SWITCH = 0xC9;

    var VK_SUBTITLE = 0xCA;

    function handleKey( evt )

    {

        switch (evt.key)

        {

            case VK_SUBTITLE:

                //override the player default

                evt.preventDefault();

                //deactivate current subtitle app

                advSubtitles[currentTrack].inactivate();

                //change track number

                currentTrack++;

                if (currentTrack == advSubitles.length) currentTrack = 0;

                //activate new app

                advSubtitles[currentTrack].activate();           

            break;

            case VK_SUBTITLE_SWITCH:

                //override the player default

                evt.preventDefault();

                //toggle visibility

                if (advSubtitles[currentTrack].state == STATE_ACTIVE)

                    advSubtitles[currentTrack].inactivate();

                else

                    advSubtitles[currentTrack].activate();

            break;

        }

     

    }

    function init()

    {   

        var app;

        advSubtitles = new Array( 3 ); //create as an array to access apps by index

        for (var i=0; i<advancedApplications.length; i++)

        {

            app = advancedApplications[ i ];

            //alternatively, you could push the apps onto the array

            //though order cannot be guarenteed

            switch (app.id)

            {

                case "subtitleTrack1":

                    advSubtitles[0] = app;

                    break;

                case "subtitleTrack2":

                    advSubtitles[1] = app;

                    break;

                case "subtitleTrack3":

                    advSubtitles[2] = app;

                    break;

            }

     

        }

       

    }

    setMarkupLoadedHandler( init );

    addEventListener( "controller_key_down", handleKey, false );

     

    Monday, November 26, 2007 9:15 PM
  • Thanks a lot!
    Friday, November 30, 2007 10:35 AM