ffmpeg 分割flv文件 在java中 使用ffmpeg 将一个 大flv的文件 分割成多个小文件最好是有代码 多些各位大侠赐教 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public String SplitFlv(final String oldfilepath) throws IOException { if (!checkfile(oldfilepath)) return null; String newFilePath = null; final List<String> commend = new java.util.ArrayList<String>(); commend.add("ffmpeg"); commend.add(oldfilepath); commend.add("-quiet"); commend.add("-vf"); commend.add("scale="+width+":-3,harddup"); commend.add("-of"); commend.add("lavf"); commend.add("-ovc"); commend.add("lavc"); commend.add("-lavcopts"); commend.add("vcodec=flv:vbitrate=300"); commend.add("-ofps"); commend.add("12"); commend.add("-srate"); commend.add("22050"); commend.add("-oac"); commend.add("mp3lame"); commend.add("-lameopts"); commend.add("abr:br=32:mode=3"); commend.add("-o"); commend.add(newFilePath); InputStream stderr = null; InputStreamReader isr = null; BufferedReader br = null; Process proc = null; try { final ProcessBuilder builder = new ProcessBuilder(); builder.command(commend); builder.redirectErrorStream(true); proc = builder.start(); stderr = proc.getInputStream(); isr = new InputStreamReader(stderr); br = new BufferedReader(isr); boolean flag = false; while (br.readLine() != null) { } if(flag){ return newFilePath; }else{ return null; } } catch (final Exception e) { LOGGER.error("Convert Error!", e); return null; } finally { proc.destroy(); br.close(); isr.close(); stderr.close(); } }将上面的参数换成ffmpeg切割参数加到command里面 基于Ajax+SSH的个人博客网站正式上线,散分 struts2页面动态添加行,并且批量提交数据,数据无法得到 求助,cxf相关,请问如下代码神马意思? struts2+spring2.5+hibernate整合的问题 好多的视频教程 急!!!Myeclipse中启动Tomcat问题 字符YYYY-MM-DD怎样转换成日期YYYY-MM-DD 一个简单的程序,大家帮帮我。 免费的asp.net虚拟主机!要的快点!站长说只开通80个免费帐户! 菜鸟知道jsp怎么和oracle相连?能给我代码就更好了。 Apache + Weblogic Cluster上传文件的问题 SSH 整合问题
if (!checkfile(oldfilepath))
return null;
String newFilePath = null;
final List<String> commend = new java.util.ArrayList<String>();
commend.add("ffmpeg");
commend.add(oldfilepath);
commend.add("-quiet");
commend.add("-vf");
commend.add("scale="+width+":-3,harddup");
commend.add("-of");
commend.add("lavf");
commend.add("-ovc");
commend.add("lavc");
commend.add("-lavcopts");
commend.add("vcodec=flv:vbitrate=300");
commend.add("-ofps");
commend.add("12");
commend.add("-srate");
commend.add("22050");
commend.add("-oac");
commend.add("mp3lame");
commend.add("-lameopts");
commend.add("abr:br=32:mode=3");
commend.add("-o"); commend.add(newFilePath); InputStream stderr = null;
InputStreamReader isr = null;
BufferedReader br = null;
Process proc = null;
try {
final ProcessBuilder builder = new ProcessBuilder();
builder.command(commend);
builder.redirectErrorStream(true);
proc = builder.start(); stderr = proc.getInputStream();
isr = new InputStreamReader(stderr);
br = new BufferedReader(isr);
boolean flag = false;
while (br.readLine() != null) {
}
if(flag){
return newFilePath;
}else{
return null;
}
} catch (final Exception e) {
LOGGER.error("Convert Error!", e);
return null;
} finally {
proc.destroy();
br.close();
isr.close();
stderr.close();
}
}将上面的参数换成ffmpeg切割参数加到command里面