Tuesday, March 19, 2013

How DVD chapters were implemented?

   DVD movies contains chapters. The user can browse chapters to view the DVD contents.Once the user has selected the movie chapter, the corresponding movie chapter is played on TV or system.

We might have seen the DVD movie with chapters as follows:
  1) chapter 1,2,3 or play video songs, list of songs in DVD

How it is possible?
   Every chapter has some information like chapter thumbnail [which will be shown while showing the chapter list],
chapter's starting position [milli seconds] in DVD video file.

  When the user has selected the movie chapter, the player application will seek to the chapter's starting position in a video.

  Example:
     chapter 1,120 ms
     chapter 2,360 ms #chapter 2 is starting from 360 ms of the DVD video file whenever the user select this chapter
                      #player application will seek to 360 ms and play the video



Some players have support for moving to next chapter. Usually the player code will have the below logic:

     if ( chapterAvailableForVideo)
     {
         //if chapters are available, next/previous buttons are mapped to switch to next/prev chapter
          map(nextbutton,NextChapter);
          map(prevButton,PrevChapter);
     }
     else
     {
         map(nextButton,forward);
         map(prevButton,rewind);
     }   
   

    onSelectNext()
    {
        if(chapterAvailableForVideo)
         {
              switchTo(nextChapter);  //get next chapter's starting position, seekto this position
                                      // and play video on screen
      }
         else
         {
            doForward();
         }

    }
    onSelectPrev()
    {
        if(chapterAvailableForVideo)
         {
              switchTo(prevChapter);
      }
         else
         {
            doRewind();
         }
     }

Labels: ,

0 Comments:

Post a Comment

<< Home