Examples of VideoStreamChunk


Examples of entagged.audioformats.asf.data.VideoStreamChunk

          audioStreamChunk.setCodecData (codecSpecificData);
        } else if (GUID.GUID_VIDEOSTREAM.equals(streamTypeGUID)) {
          /*
           * Reading video specific information
           */
          VideoStreamChunk videoStreamChunk = new VideoStreamChunk(
              chunkStart, chunkLength);
          result = videoStreamChunk;

          long pictureWidth = Utils.readUINT32(raf);
          long pictureHeight = Utils.readUINT32(raf);

          // Skipt unknown field
          raf.skipBytes(1);

          /*
           * Now read the format specific data
           */
          // Size of the data section
          Utils.readUINT16(raf);
         
          raf.skipBytes(16);
          byte[] fourCC = new byte[4];
          raf.read(fourCC);
 
          videoStreamChunk.setPictureWidth(pictureWidth);
          videoStreamChunk.setPictureHeight(pictureHeight);
          videoStreamChunk.setCodecId(fourCC);
        }

        /*
         * Setting common values for audio and video
         */
 
View Full Code Here

Examples of org.jaudiotagger.audio.asf.data.VideoStreamChunk

  public void process(RandomAccessFile file, String filename) throws Exception {
      file.seek(0);
    // Let the audio library read the ASF file.
    AsfHeader header = AsfHeaderReader.readHeader(file);

    VideoStreamChunk video = null;
    for (Chunk chunk : header.getChunks()) {
            if (chunk instanceof VideoStreamChunk)
                video = (VideoStreamChunk) chunk;
    }
   
    this.videoStreamPresent = video != null;

    if (this.videoStreamPresent) {
      setVideoResolution(video.getPictureWidth() + "x" + video.getPictureHeight());
      setVideoCodec(video.getCodecIdAsString());
      setDuration(header.getFileHeader().getDurationInSeconds());
     
      // The average bit rate of the video is as hard to gather as the FPS.
      // However in this case there is a recommended chunk in ASF files
      // which contains this information.
      StreamBitratePropertiesChunk propertiesChunk = header.getStreamBitratePropertiesChunk();
      if (propertiesChunk != null)
        setVideoBitRate((int) propertiesChunk.getAvgBitrate(video.getStreamNumber()));

      // The audio part of the video. (optional)
      if (header.getAudioStreamChunk() != null) {
        setAudioCodec(header.getAudioStreamChunk().getCodecDescription());
        setAudioRate((int) header.getAudioStreamChunk().getSamplingRate());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.