"-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;
}