code: private ITag createFileMeta() {
          // Create tag for onMetaData event
          IoBuffer buf = IoBuffer.allocate(192);
          buf.setAutoExpand(true);
          Output out = new Output(buf);
          // Duration property
          out.writeString("onMetaData");
          Map<Object, Object> props = new HashMap<Object, Object>();
          props.put("duration", duration / 1000.0);
          if (firstVideoTag != -1) {
              long old = getCurrentPosition();
              setCurrentPosition(firstVideoTag);
              try {
                  readTagHeader();
                  fillBuffer(1);
                  int codecId = in.get() & MASK_VIDEO_CODEC;
                  // Video codec id
                  props.put("videocodecid", codecId);
              } catch (UnsupportedDataTypeException e) {
                  log.warn("createFileMeta for video", e);
              }
              setCurrentPosition(old);
          }
          if (firstAudioTag != -1) {
              long old = getCurrentPosition();
              setCurrentPosition(firstAudioTag);
              try {
                  readTagHeader();
                  fillBuffer(1);
                  int codecId = (in.get() & MASK_SOUND_FORMAT) >> 4;
                  // Audio codec id
                  props.put("audiocodecid", codecId);
              } catch (UnsupportedDataTypeException e) {
                  log.warn("createFileMeta for audio", e);
              }
              setCurrentPosition(old);
          }
          props.put("canSeekToEnd", true);
          out.writeMap(props);
          buf.flip();
          ITag result = new Tag(IoConstants.TYPE_METADATA, 0, buf.limit(), null, 0);
          result.setBody(buf);
          out = null;
          return result;
      }
docs: Create tag for metadata event.
  
  @return Metadata event tag