Package org.apache.openmeetings.util.process

Examples of org.apache.openmeetings.util.process.ConverterProcessResult


              , "-i", path
              , "-an" // only input files with video will be treated as video sources
              , "-v", "error"
              , "-f", "null"
              , "file.null"};
          ConverterProcessResult r = ProcessHelper.executeScript("checkFlvPod_" + pod , args);
          returnLog.add(r);
          if ("0".equals(r.getExitValue())) {
            //TODO need to remove smallest gap
            long diff = diff(meta.getRecordStart(), meta.getFlvRecording().getRecordStart());
            if (diff != 0L) {
              // stub to add
              // ffmpeg -y -loop 1 -i /home/solomax/work/openmeetings/branches/3.0.x/dist/red5/webapps/openmeetings/streams/hibernate/default_interview_image.jpg -filter_complex '[0:0]scale=320:260' -c:v libx264 -t 00:00:29.059 -pix_fmt yuv420p out.flv
              File podFB = new File(streamFolder, meta.getStreamName() + "_pod_" + pod + "_blank.flv");
              String podPB = podFB.getCanonicalPath();
              String[] argsPodB = new String[] { getPathToFFMPEG(), "-y" //
                  , "-loop", "1", "-i", defaultInterviewImageFile.getCanonicalPath() //
                  , "-filter_complex", String.format("[0:0]scale=%1$d:%2$d", flvWidth, flvHeight) //
                  , "-c:v", "libx264" //
                  , "-t", formatMillis(diff) //
                  , "-pix_fmt", "yuv420p" //
                  , podPB };
              returnLog.add(ProcessHelper.executeScript("blankFlvPod_" + pod , argsPodB));
             
              //ffmpeg -y -i out.flv -i rec_15_stream_4_2014_07_15_20_41_03.flv -filter_complex '[0:0]setsar=1/1[sarfix];[1:0]scale=320:260,setsar=1/1[scale];[sarfix] [scale] concat=n=2:v=1:a=0 [v]' -map '[v]'  output1.flv
              File podF = new File(streamFolder, meta.getStreamName() + "_pod_" + pod + ".flv");
              String podP = podF.getCanonicalPath();
              String[] argsPod = new String[] { getPathToFFMPEG(), "-y"//
                  , "-i", podPB //
                  , "-i", path //
                  , "-filter_complex", String.format("[0:0]setsar=1/1[sarfix];[1:0]scale=%1$d:%2$d,setsar=1/1[scale];[sarfix] [scale] concat=n=2:v=1:a=0 [v]", flvWidth, flvHeight) //
                  , "-map", "[v]" //
                  , podP };
              returnLog.add(ProcessHelper.executeScript("shiftedFlvPod_" + pod , argsPod));
 
              pods[pod - 1] = podP;
            } else {
              pods[pod - 1] = path;
            }
          }
          found = true;
        }
      }
      if (!found) {
        ConverterProcessResult r = new ConverterProcessResult();
        r.setProcess("CheckFlvFilesExists");
        r.setError("No valid pods found");
        returnLog.add(r);
        return;
      }
      boolean shortest = false;
      List<String> args = new ArrayList<String>();
View Full Code Here


      // Add empty pieces at the beginning and end of the wav
      // FIXME: Is this really needed anymore?!

    } catch (Exception err) {
      log.error("[startConversion]", err);
      returnLog.add(new ConverterProcessResult("startConversion", err.getMessage(), err));
    }

    return returnLog;
  }
View Full Code Here

          "-ar", "22050", "-acodec", "libmp3lame", "-ab", "32k",
          "-vcodec", "flv",
          outputFullFlv.getCanonicalPath() };
      // "-s", flvWidth + "x" + flvHeight,

      ConverterProcessResult returnMapConvertFLV = ProcessHelper.executeScript("uploadFLV ID :: "
          + fileExplorerItem.getFileExplorerItemId(), argv_fullFLV);
     
      //Parse the width height from the FFMPEG output
      FlvDimension flvDimension = getFlvDimension(returnMapConvertFLV.getError());
      int flvWidth = flvDimension.width;
      int flvHeight = flvDimension.height;
     
     
      fileExplorerItem.setFlvWidth(flvWidth);
      fileExplorerItem.setFlvHeight(flvHeight);

      returnLog.add(returnMapConvertFLV);

      String hashFileFullNameJPEG = "UPLOADFLV_" + fileExplorerItem.getFileExplorerItemId() + ".jpg";
      File outPutJpeg = new File(getStreamsHibernateDir(), name + ".jpg");

      fileExplorerItem.setPreviewImage(hashFileFullNameJPEG);

      String[] argv_previewFLV = new String[] { getPathToFFMPEG(), "-y", "-i",
          outputFullFlv.getCanonicalPath(), "-vcodec", "mjpeg", "-vframes", "1", "-an",
          "-f", "rawvideo", "-s", flvWidth + "x" + flvHeight,
          outPutJpeg.getCanonicalPath() };

      returnLog.add(ProcessHelper.executeScript("previewUpload ID :: "
              + fileExplorerItem.getFileExplorerItemId(),
              argv_previewFLV));

      fileExplorerItemDaoImpl.updateFileOrFolder(fileExplorerItem);

      for (ConverterProcessResult returnMap : returnLog) {
        flvRecordingLogDaoImpl.addFLVRecordingLog("generateFFMPEG", null, returnMap);
      }
    } catch (Exception err) {
      log.error("[convertToFLV]", err);
      returnLog.add(new ConverterProcessResult("convertToFLV", err.getMessage(), err));
    }

    return returnLog;
  }
View Full Code Here

TOP

Related Classes of org.apache.openmeetings.util.process.ConverterProcessResult

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.