Package org.openmeetings.app.persistence.beans.flvrecord

Examples of org.openmeetings.app.persistence.beans.flvrecord.FlvRecordingMetaData


     
     
      Element flvrecordingmetadatas = flvrecording.addElement("flvrecordingmetadatas");
     
      for (Iterator<FlvRecordingMetaData> itMeta = flvRec.getFlvRecordingMetaData().iterator();itMeta.hasNext();) {
        FlvRecordingMetaData flvMeta = itMeta.next();
       
        Element flvrecordingmetadata = flvrecordingmetadatas.addElement("flvrecordingmetadata");
       
        flvrecordingmetadata.addElement("flvRecordingMetaDataId").addCDATA(formatString(""+flvMeta.getFlvRecordingMetaDataId()));
        flvrecordingmetadata.addElement("freeTextUserName").addCDATA(formatString(""+flvMeta.getFreeTextUserName()));
        flvrecordingmetadata.addElement("fullWavAudioData").addCDATA(formatString(""+flvMeta.getFullWavAudioData()));
        flvrecordingmetadata.addElement("streamName").addCDATA(formatString(""+flvMeta.getStreamName()));
        flvrecordingmetadata.addElement("wavAudioData").addCDATA(formatString(""+flvMeta.getWavAudioData()));
        flvrecordingmetadata.addElement("initialGapSeconds").addCDATA(formatString(""+flvMeta.getInitialGapSeconds()));
        flvrecordingmetadata.addElement("insertedBy").addCDATA(formatString(""+flvMeta.getInsertedBy()));
        flvrecordingmetadata.addElement("interiewPodId").addCDATA(formatString(""+flvMeta.getInteriewPodId()));
        flvrecordingmetadata.addElement("audioIsValid").addCDATA(formatString(""+flvMeta.getAudioIsValid()));
        flvrecordingmetadata.addElement("inserted").addCDATA(formatString(""+CalendarPatterns.getDateWithTimeByMiliSeconds(flvMeta.getInserted())));
        flvrecordingmetadata.addElement("isAudioOnly").addCDATA(formatString(""+flvMeta.getIsAudioOnly()));
        flvrecordingmetadata.addElement("isScreenData").addCDATA(formatString(""+flvMeta.getIsScreenData()));
        flvrecordingmetadata.addElement("isVideoOnly").addCDATA(formatString(""+flvMeta.getIsVideoOnly()));
        flvrecordingmetadata.addElement("recordEnd").addCDATA(formatString(""+CalendarPatterns.getDateWithTimeByMiliSeconds(flvMeta.getRecordEnd())));
        flvrecordingmetadata.addElement("recordStart").addCDATA(formatString(""+CalendarPatterns.getDateWithTimeByMiliSeconds(flvMeta.getRecordStart())));
        flvrecordingmetadata.addElement("updated").addCDATA(formatString(""+CalendarPatterns.getDateWithTimeByMiliSeconds(flvMeta.getUpdated())));
       
      }
     
    }
 
View Full Code Here


                  Boolean isVideoOnly = importBooleanType(unformatString(flvrecordingmetadataObj.element("isVideoOnly").getText()));
                  Date recordEnd1 = CalendarPatterns.parseDateWithHour(unformatString(flvrecordingmetadataObj.element("recordEnd").getText()));
                  Date recordStart1 = CalendarPatterns.parseDateWithHour(unformatString(flvrecordingmetadataObj.element("recordStart").getText()));
                  Date updated = CalendarPatterns.parseDateWithHour(unformatString(flvrecordingmetadataObj.element("updated").getText()));
                 
                  FlvRecordingMetaData flvrecordingmetadata = new FlvRecordingMetaData();
                  flvrecordingmetadata.setFreeTextUserName(freeTextUserName);
                  flvrecordingmetadata.setFullWavAudioData(fullWavAudioData);
                  flvrecordingmetadata.setStreamName(streamName);
                  flvrecordingmetadata.setWavAudioData(wavAudioData);
                  flvrecordingmetadata.setInitialGapSeconds(initialGapSeconds);
                  flvrecordingmetadata.setInsertedBy(insertedBy1);
                  flvrecordingmetadata.setInteriewPodId(interiewPodId);
                  flvrecordingmetadata.setAudioIsValid(audioIsValid);
                  flvrecordingmetadata.setInserted(inserted1);
                  flvrecordingmetadata.setIsAudioOnly(isAudioOnly);
                  flvrecordingmetadata.setIsScreenData(isScreenData);
                  flvrecordingmetadata.setIsVideoOnly(isVideoOnly);
                  flvrecordingmetadata.setRecordEnd(recordEnd1);
                  flvrecordingmetadata.setRecordStart(recordStart1);
                  flvrecordingmetadata.setUpdated(updated);
                  flvrecordingmetadata.setDeleted("false");
                 
                  flvRecording.getFlvRecordingMetaData().add(flvrecordingmetadata);
                 
                }
               
View Full Code Here

      // Merge Wave to Full Length
      String streamFolderGeneralName = ScopeApplicationAdapter.webAppPath
          + File.separatorChar + "streams" + File.separatorChar
          + "hibernate" + File.separatorChar;

      FlvRecordingMetaData flvRecordingMetaDataOfScreen = this.flvRecordingMetaDataDaoImpl
          .getFlvRecordingMetaDataScreenFlvByRecording(flvRecording
              .getFlvRecordingId());
      String hashFileFullName = flvRecordingMetaDataOfScreen
          .getStreamName()
          + "_FINAL_WAVE.wav";
      String outputFullWav = streamFolderName + hashFileFullName;

      if (listOfFullWaveFiles.size() == 1) {

        outputFullWav = listOfFullWaveFiles.get(0);
       
        flvRecordingMetaDataOfScreen
            .setFullWavAudioData(hashFileFullName);

      } else if (listOfFullWaveFiles.size() > 0) {

        String[] argv_full_sox = new String[listOfFullWaveFiles.size() + 3];
        argv_full_sox[0] = this.getPathToSoX();
        argv_full_sox[1] = "-m";

        int counter = 0;
        for (int i = 0; i < listOfFullWaveFiles.size(); i++) {
          argv_full_sox[2 + i] = listOfFullWaveFiles.get(i);
          counter = i;
        }
        argv_full_sox[counter + 3] = outputFullWav;

        log.debug("START mergeAudioToWaves ################# ");
        log.debug(argv_full_sox.toString());
        String iString = "";
        for (int i = 0; i < argv_full_sox.length; i++) {
          iString += argv_full_sox[i] + " ";
          //log.debug(" i " + i + " argv-i " + argv_full_sox[i]);
        }
        log.debug(iString);
        log.debug("END mergeAudioToWaves ################# ");

        flvRecordingMetaDataOfScreen
            .setFullWavAudioData(hashFileFullName);

        this.flvRecordingMetaDataDaoImpl
            .updateFlvRecordingMetaData(flvRecordingMetaDataOfScreen);

        returnLog.add(GenerateSWF.executeScript("mergeWave",
            argv_full_sox));
      } else {

        // create default Audio to merge it.
        // strip to content length
        String outputWav = streamFolderGeneralName + "one_second.wav";

        // Calculate delta at beginning
        Long deltaTimeMilliSeconds = flvRecording.getRecordEnd()
            .getTime()
            - flvRecording.getRecordStart().getTime();
        Float deltaPadding = (Float.parseFloat(deltaTimeMilliSeconds
            .toString()) / 1000) - 1;

        String[] argv_full_sox = new String[] { this.getPathToSoX(),
            outputWav, outputFullWav, "pad", "0",
            deltaPadding.toString() };

        log.debug("START generateSampleAudio ################# ");
        String tString = "";
        for (int i = 0; i < argv_full_sox.length; i++) {
          tString += argv_full_sox[i] + " ";
          //log.debug(" i " + i + " argv-i " + argv_full_sox[i]);
        }
        log.debug(tString);
        log.debug("END generateSampleAudio ################# ");

        flvRecordingMetaDataOfScreen
            .setFullWavAudioData(hashFileFullName);

        this.flvRecordingMetaDataDaoImpl
            .updateFlvRecordingMetaData(flvRecordingMetaDataOfScreen);

        returnLog.add(GenerateSWF.executeScript("mergeWave",
            argv_full_sox));

      }

      // Merge Audio with Video / Calculate resulting FLV

      String inputScreenFullFlv = streamFolderName
          + flvRecordingMetaDataOfScreen.getStreamName() + ".flv";

      File outputFolder = new File(streamFolderGeneralName);
      if (!outputFolder.exists()) {
        outputFolder.mkdir();
      }
View Full Code Here

    if (writer != null && !this.isClosed) {
      try {
       
        //Add Delta in the beginning, this Delta is the Gap between the
        //device chosen and when the User hits the button in the Flash Security Warning
        FlvRecordingMetaData flvRecordingMetaData = FlvRecordingMetaDataDaoImpl.getInstance().getFlvRecordingMetaDataById(this.flvRecordingMetaDataId);
       
        flvRecordingMetaData.setRecordStart(new Date(flvRecordingMetaData.getRecordStart().getTime() + this.initialDelta));
       
        FlvRecordingMetaDataDaoImpl.getInstance().updateFlvRecordingMetaData(flvRecordingMetaData);
       
        writer.close();
       
View Full Code Here

      EntityTransaction tx = session.getTransaction();
      tx.begin();
      Query query = session.createQuery(hql);
      query.setParameter("flvRecordingMetaDataId", flvRecordingMetaDataId);
     
      FlvRecordingMetaData flvRecordingMetaData = null;
      try {
        flvRecordingMetaData = (FlvRecordingMetaData) query.getSingleResult();
        } catch (NoResultException ex) {
        }
      tx.commit();
View Full Code Here

  public Long addFlvRecordingMetaData(Long flvRecordingId, String freeTextUserName,
          Date recordStart, Boolean isAudioOnly, Boolean isVideoOnly,
          Boolean isScreenData, String streamName, Integer interiewPodId) {
    try {
     
      FlvRecordingMetaData flvRecordingMetaData = new FlvRecordingMetaData();
     
      flvRecordingMetaData.setDeleted("false");
     
      flvRecordingMetaData.setFlvRecording(FlvRecordingDaoImpl.getInstance().getFlvRecordingById(flvRecordingId));
      flvRecordingMetaData.setFreeTextUserName(freeTextUserName);
      flvRecordingMetaData.setInserted(new Date());
     
      flvRecordingMetaData.setRecordStart(recordStart);
     
      flvRecordingMetaData.setIsAudioOnly(isAudioOnly);
      flvRecordingMetaData.setIsVideoOnly(isVideoOnly);
      flvRecordingMetaData.setIsScreenData(isScreenData);
     
      flvRecordingMetaData.setStreamName(streamName);
     
      flvRecordingMetaData.setInteriewPodId(interiewPodId);
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
     
      flvRecordingMetaData = session.merge(flvRecordingMetaData);
      Long flvRecordingMetaDataId = flvRecordingMetaData.getFlvRecordingMetaDataId();
     
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
     
      return flvRecordingMetaDataId;
View Full Code Here

  public Long updateFlvRecordingMetaDataEndDate(Long flvRecordingMetaDataId,
                    Date recordEnd) {
    try {
     
      FlvRecordingMetaData flvRecordingMetaData = this.getFlvRecordingMetaDataById(flvRecordingMetaDataId);
     
      flvRecordingMetaData.setRecordEnd(recordEnd);
     
      log.debug("updateFlvRecordingMetaDataEndDate :: Start Date :"+flvRecordingMetaData.getRecordStart());
      log.debug("updateFlvRecordingMetaDataEndDate :: End Date :"+flvRecordingMetaData.getRecordEnd());
     
      this.updateFlvRecordingMetaData(flvRecordingMetaData);
     
      return flvRecordingMetaDataId;
     
View Full Code Here

  public Long updateFlvRecordingMetaDataInitialGap(Long flvRecordingMetaDataId,
                    long initalGap) {
    try {
     
      FlvRecordingMetaData flvRecordingMetaData = this.getFlvRecordingMetaDataById(flvRecordingMetaDataId);
     
      flvRecordingMetaData.setInitialGapSeconds(Long.valueOf(initalGap).intValue());
     
      this.updateFlvRecordingMetaData(flvRecordingMetaData);
     
      return flvRecordingMetaDataId;
     
View Full Code Here

      stripAudioFirstPass(flvRecording, returnLog, listOfFullWaveFiles, streamFolderName);

      // Merge Wave to Full Length
      String streamFolderGeneralName = getStreamFolderName();

      FlvRecordingMetaData flvRecordingMetaDataOfScreen = this.flvRecordingMetaDataDaoImpl
          .getFlvRecordingMetaDataScreenFlvByRecording(flvRecording
              .getFlvRecordingId());
     
      if (flvRecordingMetaDataOfScreen == null) {
        throw new Exception("flvRecordingMetaDataOfScreen is Null FlvRecordingId "+flvRecording
              .getFlvRecordingId());
      }
     
      if (flvRecordingMetaDataOfScreen.getStreamReaderThreadComplete() == null) {
        throw new Exception("StreamReaderThreadComplete Bit is NULL, error in recording");
      }
     
      if (!flvRecordingMetaDataOfScreen.getStreamReaderThreadComplete()) {
       
        log.debug("### meta ScreenStream not yet written to disk" + flvRecordingMetaDataOfScreen.getFlvRecordingMetaDataId());
        boolean doStop = true;
        while(doStop) {
         
          log.debug("### Stream not yet written Thread Sleep - " + flvRecordingMetaDataOfScreen.getFlvRecordingMetaDataId());
         
          Thread.sleep(100L);
         
          flvRecordingMetaDataOfScreen = flvRecordingMetaDataDaoImpl.getFlvRecordingMetaDataById(flvRecordingMetaDataOfScreen.getFlvRecordingMetaDataId());
         
          if (flvRecordingMetaDataOfScreen.getStreamReaderThreadComplete()) {
            log.debug("### Screen Stream now written Thread continue - " );
            doStop = false;
          }
        }
      }
     
     
      String hashFileFullName = flvRecordingMetaDataOfScreen
          .getStreamName() + "_FINAL_WAVE.wav";
      String outputFullWav = streamFolderName + hashFileFullName;

      if (listOfFullWaveFiles.size() == 1) {

        outputFullWav = listOfFullWaveFiles.get(0);

        flvRecordingMetaDataOfScreen
            .setFullWavAudioData(hashFileFullName);

      } else if (listOfFullWaveFiles.size() > 0) {

        String[] argv_full_sox = mergeAudioToWaves(listOfFullWaveFiles, outputFullWav);

        log.debug("START mergeAudioToWaves ################# ");
        log.debug(argv_full_sox.toString());
        String iString = "";
        for (int i = 0; i < argv_full_sox.length; i++) {
          iString += argv_full_sox[i] + " ";
        }
        log.debug(iString);
        log.debug("END mergeAudioToWaves ################# ");

        flvRecordingMetaDataOfScreen
            .setFullWavAudioData(hashFileFullName);

        this.flvRecordingMetaDataDaoImpl
            .updateFlvRecordingMetaData(flvRecordingMetaDataOfScreen);

        returnLog.add(ProcessHelper.executeScript("mergeWave",
            argv_full_sox));
      } else {

        // create default Audio to merge it.
        // strip to content length
        String outputWav = streamFolderGeneralName + "one_second.wav";

        // Calculate delta at beginning
        Long deltaTimeMilliSeconds = flvRecording.getRecordEnd()
            .getTime() - flvRecording.getRecordStart().getTime();
        Float deltaPadding = (Float.parseFloat(deltaTimeMilliSeconds
            .toString()) / 1000) - 1;

        String[] argv_full_sox = new String[] { this.getPathToSoX(),
            outputWav, outputFullWav, "pad", "0",
            deltaPadding.toString() };

        log.debug("START generateSampleAudio ################# ");
        String tString = "";
        for (int i = 0; i < argv_full_sox.length; i++) {
          tString += argv_full_sox[i] + " ";
        }
        log.debug(tString);
        log.debug("END generateSampleAudio ################# ");

        flvRecordingMetaDataOfScreen
            .setFullWavAudioData(hashFileFullName);

        this.flvRecordingMetaDataDaoImpl
            .updateFlvRecordingMetaData(flvRecordingMetaDataOfScreen);

        returnLog.add(ProcessHelper.executeScript("mergeWave",
            argv_full_sox));

      }

      // Merge Audio with Video / Calculate resulting FLV

      String inputScreenFullFlv = streamFolderName
          + flvRecordingMetaDataOfScreen.getStreamName() + ".flv";

      String hashFileFullNameFlv = "flvRecording_"
          + flvRecording.getFlvRecordingId() + ".flv";
      String outputFullFlv = streamFolderGeneralName
          + hashFileFullNameFlv;
View Full Code Here

          "WHERE c.flvRecordingMetaDataId = :flvRecordingMetaDataId";
     
      TypedQuery<FlvRecordingMetaData> query = em.createQuery(hql, FlvRecordingMetaData.class);
      query.setParameter("flvRecordingMetaDataId", flvRecordingMetaDataId);
     
      FlvRecordingMetaData flvRecordingMetaData = null;
      try {
        flvRecordingMetaData = query.getSingleResult();
        } catch (NoResultException ex) {
        }
     
View Full Code Here

TOP

Related Classes of org.openmeetings.app.persistence.beans.flvrecord.FlvRecordingMetaData

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.