Package com.coremedia.iso.boxes

Examples of com.coremedia.iso.boxes.MovieBox


           metadata.set(Metadata.CONTENT_TYPE, "video/quicktime");
        }
       
       
        // Get the main MOOV box
        MovieBox moov = getOrNull(isoFile, MovieBox.class);
        if (moov == null) {
           // Bail out
           return;
        }

       
        XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata);
        xhtml.startDocument();
       
       
        // Pull out some information from the header box
        MovieHeaderBox mHeader = getOrNull(moov, MovieHeaderBox.class);
        if (mHeader != null) {
           // Get the creation and modification dates
           metadata.set(
                 Metadata.CREATION_DATE,
                 MP4TimeToDate(mHeader.getCreationTime())
           );
           metadata.set(
                 TikaCoreProperties.MODIFIED,
                 MP4TimeToDate(mHeader.getModificationTime())
           );
          
           // Get the duration
           double durationSeconds = ((double)mHeader.getDuration()) / mHeader.getTimescale();
           // TODO Use this
          
           // The timescale is normally the sampling rate
           metadata.set(XMPDM.AUDIO_SAMPLE_RATE, (int)mHeader.getTimescale());
        }
       
       
        // Get some more information from the track header
        // TODO Decide how to handle multiple tracks
        List<TrackBox> tb = moov.getBoxes(TrackBox.class);
        if (tb.size() > 0) {
           TrackBox track = tb.get(0);
          
           TrackHeaderBox header = track.getTrackHeaderBox();
           // Get the creation and modification dates
View Full Code Here


           metadata.set(Metadata.CONTENT_TYPE, "video/quicktime");
        }
       
       
        // Get the main MOOV box
        MovieBox moov = getOrNull(isoFile, MovieBox.class);
        if (moov == null) {
           // Bail out
           return;
        }

       
        XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata);
        xhtml.startDocument();
       
       
        // Pull out some information from the header box
        MovieHeaderBox mHeader = getOrNull(moov, MovieHeaderBox.class);
        if (mHeader != null) {
           // Get the creation and modification dates
           metadata.set(
                 Metadata.CREATION_DATE,
                 MP4TimeToDate(mHeader.getCreationTime())
           );
           metadata.set(
                 Property.externalDate(Metadata.MODIFIED), // TODO Should be a real property
                 MP4TimeToDate(mHeader.getModificationTime())
           );
          
           // Get the duration
           double durationSeconds = ((double)mHeader.getDuration()) / mHeader.getTimescale();
           // TODO Use this
          
           // The timescale is normally the sampling rate
           metadata.set(XMPDM.AUDIO_SAMPLE_RATE, (int)mHeader.getTimescale());
        }
       
       
        // Get some more information from the track header
        // TODO Decide how to handle multiple tracks
        List<TrackBox> tb = moov.getBoxes(TrackBox.class);
        if (tb.size() > 0) {
           TrackBox track = tb.get(0);
          
           TrackHeaderBox header = track.getTrackHeaderBox();
           // Get the creation and modification dates
View Full Code Here

               metadata.set(Metadata.CONTENT_TYPE, "video/quicktime");
            }


            // Get the main MOOV box
            MovieBox moov = getOrNull(isoFile, MovieBox.class);
            if (moov == null) {
               // Bail out
               return;
            }


            XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata);
            xhtml.startDocument();


            // Pull out some information from the header box
            MovieHeaderBox mHeader = getOrNull(moov, MovieHeaderBox.class);
            if (mHeader != null) {
               // Get the creation and modification dates
               metadata.set(Metadata.CREATION_DATE, mHeader.getCreationTime());
               metadata.set(TikaCoreProperties.MODIFIED, mHeader.getModificationTime());

               // Get the duration
               double durationSeconds = ((double)mHeader.getDuration()) / mHeader.getTimescale();
               // TODO Use this

               // The timescale is normally the sampling rate
               metadata.set(XMPDM.AUDIO_SAMPLE_RATE, (int)mHeader.getTimescale());
            }


            // Get some more information from the track header
            // TODO Decide how to handle multiple tracks
            List<TrackBox> tb = moov.getBoxes(TrackBox.class);
            if (tb.size() > 0) {
               TrackBox track = tb.get(0);

               TrackHeaderBox header = track.getTrackHeaderBox();
               // Get the creation and modification dates
View Full Code Here

TOP

Related Classes of com.coremedia.iso.boxes.MovieBox

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.