The method to convert video to .flv is too easy. You can downlaod following files from .net
1)ffmpeg.exe
2) ffplay.exe
3) pthreadGC2.dll
After dowloading all the files
Follow the steps wrtitren:-
1)Make a new .net web site or windows application.
2)Copy and paste all the 3 above written files to root location
3)Copy and Paste code written below
4)Put an upload to page and rename to “ fileuploadImageVideo”
5)put and button and rename to btn_Submit
6)Make 3 folders OriginalVideo, ConvertVideo, Thumbs
7)Import Class “using System.IO;”
private bool ReturnVideo(string fileName)
{
string html = string.Empty;
//rename if file already exists
int j = 0;
string AppPath;
string inputPath;
string outputPath;
string imgpath;
AppPath = Request.PhysicalApplicationPath;
//Get the application path
inputPath = AppPath + "OriginalVideo";
//Path of the original file
outputPath = AppPath + "ConvertVideo";
//Path of the converted file
imgpath = AppPath + "Thumbs";
//Path of the preview file
string filepath = Server.MapPath("~/OriginalVideo/" + fileName);
while (File.Exists(filepath))
{
j = j + 1;
int dotPos = fileName.LastIndexOf(".");
string namewithoutext = fileName.Substring(0, dotPos);
string ext = fileName.Substring(dotPos + 1);
fileName = namewithoutext + j + "." + ext;
filepath = Server.MapPath("~/OriginalVideo/" + fileName);
}
try
{
this.fileuploadImageVideo.SaveAs(filepath);
}
catch
{
return false;
}
string outPutFile;
outPutFile = "~/OriginalVideo/" + fileName;
int i = this.fileuploadImageVideo.PostedFile.ContentLength;
System.IO.FileInfo a = new System.IO.FileInfo(Server.MapPath(outPutFile));
while (a.Exists == false)
{
return true;
}
private void ConvertNow(string cmd)
{
string exepath;
string AppPath = Request.PhysicalApplicationPath;
//Get the application path
exepath = AppPath + "ffmpeg.exe";
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = exepath;
//Path of exe that will be executed, only for "filebuffer" it will be "flvtool2.exe"
proc.StartInfo.Arguments = cmd;
//The command which will be executed
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.RedirectStandardOutput = false;
proc.Start();
I have tried to convert the .mpeg file to .flv using the script you have given. i have followed the process you have given to me but i am not getting the converted files. Can you please help me for the same.
Its working fine in my local machine. My local machine is windows XP, but when I upload it to the live server (Windows 2000.) it is not working,
I uploaded all two exe(ffmpeg.exe, ffplay.exe) and a dll (pthreadGC2.dll) to server
nice code.
This code is working fine when I try to
convert files upto 100kb or 1200 kb. but it
do not convert the file when the size of file if
more than 1.5 MB. It shows the error "Connection Interrupted". can you trace the problem and show the possible solution???
There are many ffmpeg wrappers are also available which are very easy to integrate such Media Manager Pro (http://www.all4dotnet.com/features.aspx)
etc which requires only 5-10 lines of code.
convert 3gpconvert videosconvert movpost watermarkwatermark videosflv to aviconvert aviConvert flvavi to flvconvert videos in .netconvert mpgvideo convertvideo conversionthumbsgrab thumbnails
Thanks
Rashid Ansari
Email : rashid0715@gmail.com
----------------------------
Please remember to 'Mark as Answer' if this post answered your question!
narendersing...
Member
68 Points
26 Posts
Convert Viedo to .Flv Using c#.net on Web.
Dec 04, 2008 04:29 AM|LINK
1)ffmpeg.exe
2) ffplay.exe
3) pthreadGC2.dll
After dowloading all the files
Follow the steps wrtitren:-
1)Make a new .net web site or windows application.
2)Copy and paste all the 3 above written files to root location
3)Copy and Paste code written below
4)Put an upload to page and rename to “ fileuploadImageVideo”
5)put and button and rename to btn_Submit
6)Make 3 folders OriginalVideo, ConvertVideo, Thumbs
7)Import Class “using System.IO;”
private bool ReturnVideo(string fileName)
{
string html = string.Empty;
//rename if file already exists
int j = 0;
string AppPath;
string inputPath;
string outputPath;
string imgpath;
AppPath = Request.PhysicalApplicationPath;
//Get the application path
inputPath = AppPath + "OriginalVideo";
//Path of the original file
outputPath = AppPath + "ConvertVideo";
//Path of the converted file
imgpath = AppPath + "Thumbs";
//Path of the preview file
string filepath = Server.MapPath("~/OriginalVideo/" + fileName);
while (File.Exists(filepath))
{
j = j + 1;
int dotPos = fileName.LastIndexOf(".");
string namewithoutext = fileName.Substring(0, dotPos);
string ext = fileName.Substring(dotPos + 1);
fileName = namewithoutext + j + "." + ext;
filepath = Server.MapPath("~/OriginalVideo/" + fileName);
}
try
{
this.fileuploadImageVideo.SaveAs(filepath);
}
catch
{
return false;
}
string outPutFile;
outPutFile = "~/OriginalVideo/" + fileName;
int i = this.fileuploadImageVideo.PostedFile.ContentLength;
System.IO.FileInfo a = new System.IO.FileInfo(Server.MapPath(outPutFile));
while (a.Exists == false)
{
}
long b = a.Length;
while (i != b)
{
}
string cmd = " -i \"" + inputPath + "\\" + fileName + "\" \"" + outputPath + "\\" + fileName.Remove(fileName.IndexOf(".")) + ".flv" + "\"";
ConvertNow(cmd);
string imgargs = " -i \"" + outputPath + "\\" + fileName.Remove(fileName.IndexOf(".")) + ".flv" + "\" -f image2 -ss 1 -vframes 1 -s 280x200 -an \"" + imgpath + "\\" + fileName.Remove(fileName.IndexOf(".")) + ".jpg" + "\"";
ConvertNow(imgargs);
return true;
}
private void ConvertNow(string cmd)
{
string exepath;
string AppPath = Request.PhysicalApplicationPath;
//Get the application path
exepath = AppPath + "ffmpeg.exe";
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = exepath;
//Path of exe that will be executed, only for "filebuffer" it will be "flvtool2.exe"
proc.StartInfo.Arguments = cmd;
//The command which will be executed
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.RedirectStandardOutput = false;
proc.Start();
while (proc.HasExited == false)
{
}
}
protected void btn_Submit_Click(object sender, EventArgs e)
{
ReturnVideo(this.fileuploadImageVideo.FileName.ToString());
}
Now run the application select a video file, that will get converted and come to ConvertVideo Folder
video Web forms C# 2005 Flv
Narender Singh
mukeshshukla
Member
2 Points
1 Post
Re: Convert Viedo to .Flv Using c#.net on Web.
Dec 27, 2008 06:13 AM|LINK
Hello,
I have tried to convert the .mpeg file to .flv using the script you have given. i have followed the process you have given to me but i am not getting the converted files. Can you please help me for the same.
you can mail me on mukesh.shukla@augustsol.com
rami_nassar
Contributor
3608 Points
828 Posts
Re: Convert Viedo to .Flv Using c#.net on Web.
Dec 30, 2008 03:18 AM|LINK
Helpful & interesting... greate job
Nassar, Rami (MCP, MCTS, MCPD)
My Blog || E-Mail
Don't forget to click "Mark as Answer" on the post that helped you.
manoj0682
Star
8479 Points
1499 Posts
Re: Convert Viedo to .Flv Using c#.net on Web.
Dec 30, 2008 03:26 AM|LINK
check out this link
http://successontheweb.blogspot.com/2008/10/using-aspnet-to-convert-wmv-to-flv.html
Manoj Karkera
coolduderaj
Member
2 Points
3 Posts
Re: Convert Viedo to .Flv Using c#.net on Web.
Mar 27, 2009 06:17 AM|LINK
Hi,
Thanks for your code.
Its working fine in my local machine. My local machine is windows XP, but when I upload it to the live server (Windows 2000.) it is not working,
I uploaded all two exe(ffmpeg.exe, ffplay.exe) and a dll (pthreadGC2.dll) to server
I think there is some IIS related issues.
There is any think need to set in IIS server,
Please help me
I am waiting for your reply
email address is rajesh.jaiswal1982@gmail.com
Thanks
Raj
vohrasohilhi...
Member
16 Points
8 Posts
Re: Convert Viedo to .Flv Using c#.net on Web.
Apr 01, 2009 11:35 AM|LINK
nice code.
This code is working fine when I try to convert files upto 100kb or 1200 kb. but it do not convert the file when the size of file if more than 1.5 MB. It shows the error "Connection Interrupted". can you trace the problem and show the possible solution???
System Analyst & Developer
Stalwart-India Pvt Ltd
Ahmedabad (Gujarat - India)
rashid0715
Member
92 Points
59 Posts
Re: Convert Viedo to .Flv Using c#.net on Web.
Apr 08, 2009 11:28 AM|LINK
There are many ffmpeg wrappers are also available which are very easy to integrate such Media Manager Pro (http://www.all4dotnet.com/features.aspx) etc which requires only 5-10 lines of code.
convert 3gp convert videos convert mov post watermark watermark videos flv to avi convert avi Convert flv avi to flv convert videos in .net convert mpg video convert video conversion thumbs grab thumbnails
Rashid Ansari
Email : rashid0715@gmail.com
----------------------------
Please remember to 'Mark as Answer' if this post answered your question!
ledo_moon
Member
48 Points
47 Posts
Re: Convert Viedo to .Flv Using c#.net on Web.
Apr 28, 2010 01:16 PM|LINK
check this i found a near subject on this blog hope it will be usefull for u http://blog.waleedmohamed.net/2010/04/convert-avi-video-to-jpg-images-capture.html
Tros12
Member
2 Points
1 Post
Re: Convert Viedo to .Flv Using c#.net on Web.
Aug 16, 2010 06:16 AM|LINK
The best way to convert flv to or from avi is use melodyCan)
you can try it_)) It's easy and fast converter)
http://convert-any-media.com/
togius
Member
35 Points
57 Posts
Re: Convert Viedo to .Flv Using c#.net on Web.
Nov 08, 2010 08:08 AM|LINK
this code above runs correctly. Can i add watermark converted video?