请问如何从一个视频中获取一张图片出来 就像优酷或其它视频网站一样,在进入视频前不是都有一张图片吗,请问这张图片如何获取 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 恩,这个问题提的好,但是你去查看网页的源代码后就很容易知道他是怎么做出来了就是一张图片,加一个超链接。。如: <a href="http://v.youku.com/v_show/id_XOTMzNTcwODQ=.html" target="video" id="XOTMzNTcwODQ=" name="hotVideoList" charset="100-003-1"><img src="http://vimg16.yoqoo.com/0100641F464A17868FFB8C003B7E6C591D0FD9-C046-8CB1-DBF8-FF1DAB487419" alt="墨城5.7强震再引恐慌 "/></a> 用ffmpeg 对视频指定时间截取图片 还可以转换格式 用ffmpeg 对视频指定时间截取图片 还可以转换格式 import java.io.File;import java.util.List;import java.util.ArrayList;public class ChangeVedio { // resourcePath为原来视频文件的路径 // filename:要转换成FLV的文件名 // realpath:实际存放FLV的路径 public static boolean process(String resourcePath, String fileName, String realPath) { int type = checkContentType(resourcePath); boolean status = false; // 如果符合转换文件类型 if (type == 0) { status = processFLV(resourcePath, fileName, realPath); } return status; } // 检查文件的类型 private static int checkContentType(String resourcePath) { String type = resourcePath.substring(resourcePath.lastIndexOf(".") + 1, resourcePath.length()).toLowerCase(); if (type.equals("avi")) { return 0; } else if (type.equals("mpg")) { return 0; } else if (type.equals("wmv")) { return 0; } else if (type.equals("3gp")) { return 0; } else if (type.equals("mov")) { return 0; } else if (type.equals("mp4")) { return 0; } else if (type.equals("asf")) { return 0; } else if (type.equals("asx")) { return 0; } else if (type.equals("flv")) { return 0; } else if (type.equals("mpeg")) { return 0; } else if (type.equals("mpe")) { return 0; } else if (type.equals("wmv9")) { return 1; } else if (type.equals("rm")) { return 1; } else if (type.equals("rmvb")) { return 1; } return 9; } private static boolean checkfile(String path) { File file = new File(path); if (!file.isFile()) { return false; } return true; } private static boolean processFLV(String resourcePath, String fileName, String realPath) { if (!checkfile(resourcePath)) { System.out.println(resourcePath + " is not file"); return false; } try { Runtime runtime = Runtime.getRuntime(); Process proce; String cmd = ""; String realPath1 = realPath + "//Vedio//"; String realPath2 = realPath + "//Vedio//"; Runtime runtime1 = Runtime.getRuntime(); Process proce1; proce1 = runtime1.exec("c://encoder.bat " + resourcePath + " "+ realPath2 + fileName); proce1.waitFor(); proce = runtime.exec("c://makeing.bat " + resourcePath + " " + realPath1 + fileName + ".jpg"); proce.waitFor(); System.out.println(realPath2 + fileName); //File flvFile = new File(realPath2 + fileName); // 如果转换成功,文件存在并且长度>0 //boolean success = flvFile.exists() && flvFile.length() > 0; return true; } catch (Exception e) { e.printStackTrace(); return false; } } public static void main(String[] args) { //System.out.println("处理中......"); //if (process("D://KISS.mp4", "rexue.flv", "D://transfer")) { // System.out.println("ok"); // //最好在D盘 里一个文件夹 d:transfer\Vedio //} String s="ab.cd.e.fg"; String[] str=s.split("\\."); System.out.println(str[1]); }} 求助!jsp里查询全部数据? 怎么用jsp做网站? 有什么办法可以把一个文本文件全部读到内存然后放到StringBuffer里面 求教各位高手?在JAVA类中返回Boolean类型的函数的处理办法 类定义问题!??? alert问题 jbuilder9里面的borland enterprise server怎么启动? 求java web生成静态页面实例 为什么我新键的一个站台无法显示呢? 在一个页面中如何将两个下拉框的内容联系起来?在线给分 如何在网页插入各种视频文件 求教关于存取大size数据的的数据库操作问题mysql
就是一张图片,加一个超链接。。如:
<a href="http://v.youku.com/v_show/id_XOTMzNTcwODQ=.html" target="video" id="XOTMzNTcwODQ=" name="hotVideoList" charset="100-003-1"><img src="http://vimg16.yoqoo.com/0100641F464A17868FFB8C003B7E6C591D0FD9-C046-8CB1-DBF8-FF1DAB487419" alt="墨城5.7强震再引恐慌 "/></a>
import java.util.List;
import java.util.ArrayList;public class ChangeVedio { // resourcePath为原来视频文件的路径
// filename:要转换成FLV的文件名
// realpath:实际存放FLV的路径
public static boolean process(String resourcePath, String fileName,
String realPath) { int type = checkContentType(resourcePath); boolean status = false; // 如果符合转换文件类型
if (type == 0) { status = processFLV(resourcePath, fileName, realPath);
}
return status;
} // 检查文件的类型
private static int checkContentType(String resourcePath) {
String type = resourcePath.substring(resourcePath.lastIndexOf(".") + 1,
resourcePath.length()).toLowerCase(); if (type.equals("avi")) {
return 0;
} else if (type.equals("mpg")) {
return 0;
} else if (type.equals("wmv")) {
return 0;
} else if (type.equals("3gp")) {
return 0;
} else if (type.equals("mov")) {
return 0;
} else if (type.equals("mp4")) {
return 0;
} else if (type.equals("asf")) {
return 0;
} else if (type.equals("asx")) {
return 0;
} else if (type.equals("flv")) {
return 0;
} else if (type.equals("mpeg")) {
return 0;
} else if (type.equals("mpe")) {
return 0;
} else if (type.equals("wmv9")) {
return 1;
} else if (type.equals("rm")) {
return 1;
} else if (type.equals("rmvb")) {
return 1;
}
return 9;
} private static boolean checkfile(String path) {
File file = new File(path);
if (!file.isFile()) {
return false;
}
return true;
} private static boolean processFLV(String resourcePath, String fileName,
String realPath) { if (!checkfile(resourcePath)) {
System.out.println(resourcePath + " is not file");
return false;
}
try {
Runtime runtime = Runtime.getRuntime();
Process proce;
String cmd = "";
String realPath1 = realPath + "//Vedio//";
String realPath2 = realPath + "//Vedio//";
Runtime runtime1 = Runtime.getRuntime();
Process proce1;
proce1 = runtime1.exec("c://encoder.bat " + resourcePath + " "+ realPath2 + fileName);
proce1.waitFor();
proce = runtime.exec("c://makeing.bat " + resourcePath + " "
+ realPath1 + fileName + ".jpg");
proce.waitFor();
System.out.println(realPath2 + fileName);
//File flvFile = new File(realPath2 + fileName); // 如果转换成功,文件存在并且长度>0
//boolean success = flvFile.exists() && flvFile.length() > 0; return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
} public static void main(String[] args) { //System.out.println("处理中......");
//if (process("D://KISS.mp4", "rexue.flv", "D://transfer")) {
// System.out.println("ok");
// //最好在D盘 里一个文件夹 d:transfer\Vedio
//}
String s="ab.cd.e.fg";
String[] str=s.split("\\.");
System.out.println(str[1]);
}}