Last post Feb 11, 2010 12:42 AM by qwe123kids
Member
28 Points
224 Posts
Feb 10, 2010 02:16 PM|nayanancha|LINK
Hi, I am trying to convert the avi file to flv but its not converting, Its creating the .flv file in the folder but its corrupted I guess, its not opening that file.
Is there anything wrong in my code?
Thanks,
.aspx:
<tr> <td> File : </td> <td> <asp:FileUpload ID="upload_imgstatic" runat="server" />only jpg or jpeg </td> </tr> <tr> <td colspan="2"> <br /> <asp:Button ID="Button1" runat="server" Text="Save" OnClick="save_CommandStatic" /><hr /> </td> </tr>
.cs:
protected void save_CommandVideopersonal(object sender, EventArgs e) { // tb_artist tb_name tb_album tb_genre FileUpload1 if (upload_videopersonal.HasFile) { string ext = Path.GetExtension(upload_videopersonal.FileName).ToLower(); //if (ext == ".flv") { string defext = ".flv"; string filename = DateTime.Now.ToString("yyyyMMddHHmmssfff"); string filepath = "FuneralPersonalVideos/" + filename + ext; upload_videopersonal.SaveAs(Server.MapPath("~/" + filepath)); //filename = filepath; string video = Server.MapPath("~/" + "FuneralPersonalVideos/" + filename + ext); //@"D:\Projects\testapp\Uploads\videowmv.wmv"; string mpg = Server.MapPath("~/" + "FuneralPersonalVideos/" + filename + defext); //@"D:\Projects\testapp\Uploads\videoflv.flv"; string cmd = " -i " + "" + video + " " + " " + "" + mpg + "" + ""; System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.StartInfo.FileName = Server.MapPath("~/" + "ffmpeg/ffmpeg.exe");//@"D:\Projects\Gastro\bin\ffmpeg"; proc.StartInfo.Arguments = cmd; proc.StartInfo.UseShellExecute = false; proc.StartInfo.CreateNoWindow = true; proc.StartInfo.RedirectStandardOutput = false; proc.Start(); //upload_videopersonal.SaveAs(mpg); int eid = Convert.ToInt32(Session["AdminEventID"]); //CommonFunctions.CreateThumbnail(filename, this.Page); //db.InsertFuneralPersonalVideo(eid, tb_titlevideopersonal.Text, filename); CommonFunctions.JavaScriptAlertMessage("Your Video has been uploaded.", this.Page); tb_titlevideopersonal.Text = ""; } //else // CommonFunctions.JavaScriptAlertMessage("Only flv files allowed!", this.Page); grid_videopersonal.DataBind(); } }
All-Star
32861 Points
7877 Posts
Feb 11, 2010 12:42 AM|qwe123kids|LINK
Hi, this paramter ffmpeg -i <in.avi> -metadata title="my title" <out.flv> oR http://ffmpeg.org/ffmpeg-doc.html chk the above link
Member
28 Points
224 Posts
Not Converting from avi to flv using FFmpeg
Feb 10, 2010 02:16 PM|nayanancha|LINK
Hi, I am trying to convert the avi file to flv but its not converting, Its creating the .flv file in the folder but its corrupted I guess, its not opening that file.
Is there anything wrong in my code?
Thanks,
.aspx:
<tr>
<td>
File :
</td>
<td>
<asp:FileUpload ID="upload_imgstatic" runat="server" />only jpg or jpeg
</td>
</tr>
<tr>
<td colspan="2">
<br />
<asp:Button ID="Button1" runat="server" Text="Save" OnClick="save_CommandStatic" /><hr />
</td>
</tr>
.cs:
protected void save_CommandVideopersonal(object sender, EventArgs e)
{
// tb_artist tb_name tb_album tb_genre FileUpload1
if (upload_videopersonal.HasFile)
{
string ext = Path.GetExtension(upload_videopersonal.FileName).ToLower();
//if (ext == ".flv")
{
string defext = ".flv";
string filename = DateTime.Now.ToString("yyyyMMddHHmmssfff");
string filepath = "FuneralPersonalVideos/" + filename + ext;
upload_videopersonal.SaveAs(Server.MapPath("~/" + filepath));
//filename = filepath;
string video = Server.MapPath("~/" + "FuneralPersonalVideos/" + filename + ext); //@"D:\Projects\testapp\Uploads\videowmv.wmv";
string mpg = Server.MapPath("~/" + "FuneralPersonalVideos/" + filename + defext); //@"D:\Projects\testapp\Uploads\videoflv.flv";
string cmd = " -i " + "" + video + " " + " " + "" + mpg + "" + "";
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = Server.MapPath("~/" + "ffmpeg/ffmpeg.exe");//@"D:\Projects\Gastro\bin\ffmpeg";
proc.StartInfo.Arguments = cmd;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.RedirectStandardOutput = false;
proc.Start();
//upload_videopersonal.SaveAs(mpg);
int eid = Convert.ToInt32(Session["AdminEventID"]);
//CommonFunctions.CreateThumbnail(filename, this.Page);
//db.InsertFuneralPersonalVideo(eid, tb_titlevideopersonal.Text, filename);
CommonFunctions.JavaScriptAlertMessage("Your Video has been uploaded.", this.Page);
tb_titlevideopersonal.Text = "";
}
//else
// CommonFunctions.JavaScriptAlertMessage("Only flv files allowed!", this.Page);
grid_videopersonal.DataBind();
}
}
All-Star
32861 Points
7877 Posts
Re: Not Converting from avi to flv using FFmpeg
Feb 11, 2010 12:42 AM|qwe123kids|LINK
Hi,
this paramter
ffmpeg -i <in.avi> -metadata title="my title" <out.flv>
oR
http://ffmpeg.org/ffmpeg-doc.html
chk the above link
Avinash Tiwari
Remember to click “Mark as Answer” on the post, if it helps you.