Package quicktime.std.movies

Examples of quicktime.std.movies.Movie


  public static Track getAudioTrack(Movie mov)
  {
    Track audio = null;
    try
    {
      Movie movie = cloneMovie(mov);
      audio = movie.getIndTrackType(1, StdQTConstants.soundMediaType,
        StdQTConstants.movieTrackMediaType);
    } // try
    catch (QTException qte)
    {
      qte.printStackTrace();
View Full Code Here


   * @param end     Time in mov to stop getting audio track
   * @return audio  Segment of audio track in mov from start to end
   */
  public static Track extractAudioSegment(Movie mov, float start, float end)
  {
    Movie mseg = extractSegment(mov, start, end);
    return getAudioTrack(mseg);
  } // extractAudioSegment(Movie, float, float)
View Full Code Here

   * @param start    Time in movie to start adding audio
   * @return result  mov with audio added at start
   */
  public static Movie addAudioTrack(Movie mov, Track audio, float start)
  {
    Movie newMov = null;
    try
    {
      // make a copy of mov
      newMov = cloneMovie(mov);
      Track newAudio;

      // use addEmptyTrack to make sure it has SoundMedia characteristics
      newAudio = newMov.addEmptyTrack(audio, new DataRef(new QTHandle()));
      audio.insertSegment(newAudio, 0, audio.getDuration(),
        (int)(start * newMov.getTimeScale()));
    } // try
    catch (QTException qte)
    {
      qte.printStackTrace();
    } // catch (QTException)
View Full Code Here

   * @return result   mov with aduio added at start
   */
  public static Movie addAudioTrack(Movie mov, Track audio, float start,
    float duration)
  {
    Movie newMov = null;
    try
    {
      // make a copy of mov
      newMov = cloneMovie(mov);
      Track newAudio;
      newAudio = newMov.addEmptyTrack(audio, new DataRef(new QTHandle()));

      // use addEmptyTrack to make sure it has Sound Media characteristics
      audio.insertSegment(newAudio, 0, (int) (duration
          * audio.getMovie().getTimeScale()),
          (int) (start * newMov.getTimeScale()));
    } // try
    catch (QTException qte)
    {
      qte.printStackTrace();
    } // catch (QTException)
View Full Code Here

   * @param mov      Movie to remove an audio track from
   * @return result  mov without the first audio track
   */
  public static Movie removeAudioTrack(Movie mov)
  {
    Movie newMov = null;
    try
    {
      // make a copy of mov
      newMov = cloneMovie(mov);

      // remove first track with SoundMedia characteristics
      newMov.removeTrack(newMov.getIndTrackType(
        1, StdQTConstants.soundMediaType, StdQTConstants.movieTrackMediaType));
    } // try
    catch (QTException qte)
    {
      qte.printStackTrace();
View Full Code Here

   */ 
  public Vector<Movie> squishMovies(Vector<Movie> movies, int direction)
  throws QTException, SchemeException
  {
    Vector<Movie> result = new Vector<Movie>();
    Movie mov = null;
    Movie temp = null;
    for (int i = 0; i < movies.size(); i++)
    {
      mov = movies.get(i);
      temp = new Movie();
      temp.setBounds(movies.get(i).getBounds());
      for (int j = 0; j < (i + 1); j++)
      {
        if (Thread.interrupted())
        {
          throw new SchemeException(new Pair(), null, null);
View Full Code Here

   * @throws SchemeException
   */ 
  public Movie glueMovies(Vector<Movie> movies, float cycle)
  throws QTException, SchemeException
  {
    Movie mov = new Movie();
    for (int i = 0; i < movies.size(); i++)
    {
      if (Thread.interrupted())
      {
        throw new SchemeException(new Pair(), null, null);
View Full Code Here

  public Movie trackKluberizeMovie(Movie mov, int direction, float cycle)
  throws SchemeException
  {
    try
    {
      Movie video = glueMovies(squishMovies(cutMovie(mov, cycle), direction),
        cycle);
      Track sound = mov.getIndTrackType(1,
        StdQTConstants.audioMediaCharacteristic,
        StdQTConstants.movieTrackCharacteristic);
      MovieUtils.addAudioTrack(sound, video);
View Full Code Here

      // copy the audio into the new movie
      Track sound = mov.getIndTrackType(1,
        StdQTConstants.audioMediaCharacteristic,
        StdQTConstants.movieTrackCharacteristic);
      Movie video = MovieUtils.compileFrames(result.toArray(res),
        (int)MovieUtils.countFrames(mov, 0, 1), mov.getTimeScale());
      if (sound != null)
      {
        MovieUtils.addAudioTrack(sound, video);
      } // if (sound != null)
View Full Code Here

   * @param mov    Movie to copy
   * @return copy  Copy of mov
   */
  public static Movie cloneMovie(Movie mov)
  {
    Movie movie = null;
    try
    {
      movie = new Movie();
      mov.insertSegment(movie, 0, mov.getDuration(), 0);
      movie.setDefaultDataRef(new DataRef(new QTHandle()));
    } // try
    catch (QTException qte)
    {
      qte.printStackTrace();
    } // catch (QTException)
View Full Code Here

TOP

Related Classes of quicktime.std.movies.Movie

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.