首页上一页 1  下一页尾页 5 条记录 1/1页
        播客网图片截取
                 	
                        发表在ASP.NET图书答疑
                        2010-08-23                                                
                    		
                                                                            	
                        
                        
                    
                    
                    	是否精华
                    	是
                    	否
                    
                    
                    
                            版块置顶:
                            是
                            否
                        
                    
                                           ASP.NET开发实例中的播客网上传视频时图片截取不了是怎么回事?视频可以播放
upVideo.aspx中代码为:if (upExtension == "flv")
{
//如果为flv格式直接保存到指定路径下
File.Copy(fileupVideo.PostedFile.FileName, Server.MapPath("../" + playFile));
//调用公共类中的catchImg方法截取视频图片
operateMethod.catchImg("../" + playFile, Server.MapPath("../" + imgFile));
//operateMethod.catchImg(playFile);
//调用自定义insertVideoInfo方法将视频的信息保存到数据库中
insertVideoInfo(playFile, imgFile);
}
catchImg方法为:
public static void catchImg(string fileName,string imgFile)
{
//获取截图工具路径
string ffmpeg = System.Web.HttpContext.Current.Server.MapPath("../") + ffmpegtool;
//string ffmpeg = System.Web.HttpContext.Current.Server.MapPath(ffmpegtool);
//获取截图后保存的路径
//string flv_img = imgFile;
string flv_img = imgFile+".jpg";
//获取截取图片的大小
string FlvImgSize = sizeOfImg;
Process pss = new Process();
//设置启动程序的路径
pss.StartInfo.FileName = ffmpeg;
pss.StartInfo.Arguments = " -i " + fileName + " -y -f image2 -ss 2 -vframes 1 -s " + FlvImgSize + " " + flv_img;
//启动进程
pss.Start();
     
}
请版主来解答一下,谢谢
                
        	
        
        
    upVideo.aspx中代码为:if (upExtension == "flv")
{
//如果为flv格式直接保存到指定路径下
File.Copy(fileupVideo.PostedFile.FileName, Server.MapPath("../" + playFile));
//调用公共类中的catchImg方法截取视频图片
operateMethod.catchImg("../" + playFile, Server.MapPath("../" + imgFile));
//operateMethod.catchImg(playFile);
//调用自定义insertVideoInfo方法将视频的信息保存到数据库中
insertVideoInfo(playFile, imgFile);
}
catchImg方法为:
public static void catchImg(string fileName,string imgFile)
{
//获取截图工具路径
string ffmpeg = System.Web.HttpContext.Current.Server.MapPath("../") + ffmpegtool;
//string ffmpeg = System.Web.HttpContext.Current.Server.MapPath(ffmpegtool);
//获取截图后保存的路径
//string flv_img = imgFile;
string flv_img = imgFile+".jpg";
//获取截取图片的大小
string FlvImgSize = sizeOfImg;
Process pss = new Process();
//设置启动程序的路径
pss.StartInfo.FileName = ffmpeg;
pss.StartInfo.Arguments = " -i " + fileName + " -y -f image2 -ss 2 -vframes 1 -s " + FlvImgSize + " " + flv_img;
//启动进程
pss.Start();
}
请版主来解答一下,谢谢

 
	
                                                 VIP会员
VIP会员 购物车
购物车

 私信
                         私信 
                     发表新帖
发表新帖 立即签到
立即签到 
        		  
        		 
         		 关注
关注
                  回复
 回复 支持(
                	支持( 反对(
                    反对( 
               			  
                







 
                     
                     
					 
						 
						 
						 
						