M.L. Martin
asked on
Convert other file types to .mp4 on upload (ASP.Net)
I want to make it very clear that what I am asking help with is definitely beyond my coding expertise. I will need lots of help to do this. I am building a website that allows members to upload short videos. I store the video in a directory and I store the reference to the video in SQL Server 2008R2. I use Flowplayer to stream the video and play when the user selects one of them. My major issue is I won't be able to determine what video format a user is uploading. And if I did I would not prevent them. What I desperately need to be able to do us convert any video the user uploads to MP4 or .mp4. I am using an ASP.Net FileUpload control to upload the video. The upload and playback works perfectly but again I want to convert the files on the upload. Example...User uploads a .3gp file. I want to convert the file to .mp4 and store it as mp4. My hope is that someone can provide code that can be added to what I am pasting here to make this work. Thank you all in advance for your help.
.......................... ......The code behind that handles the file uploading................. .......... .........
Imports System.Data
Imports System.Data.SqlClient
Imports System.IO
Partial Class member1001glf
  Inherits System.Web.UI.Page
  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    'exercisename.Attributes.A dd("onblur ", "WaterMark(this, event);")
    'exercisename.Attributes.A dd("onfocu s", "WaterMark(this, event);")
    'bodypartmg.Attributes.Add ("onblur", "bodypart(this, event);")
    'bodypartmg.Attributes.Add ("onfocus" , "bodypart(this, event);")
    Image78.ImageUrl = "Images/menu-icon-large2.p ng"
  End Sub
  Protected Sub Option_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    Image78.ImageUrl = "Images/" & DirectCast(sender, LinkButton).Text & ".png"
  End Sub
  Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    ' Before attempting to save the file, verify
    ' that the FileUpload control contains a file.
    If (FileUpload1.HasFile) Then
      ' Call a helper method routine to save the file.
      SaveFile(FileUpload1.Poste dFile)
    Else
      ' Notify the user that a file was not uploaded.
      UploadStatusLabel.Text = "You did not specify a file to upload."
    End If
  End Sub
  Sub SaveFile(ByVal file As HttpPostedFile)
    ' Specify the path to save the uploaded file to.
    Dim savePath As String = HttpContext.Current.Server .MapPath(" memuploads \")
    ' Get the name of the file to upload.
    Dim fileName As String = FileUpload1.FileName
    ' Create the path and file name to check for duplicates.
    Dim pathToCheck As String = savePath + fileName
    ' Create a temporary file name to use for checking duplicates.
    Dim tempfileName As String
    ' Check to see if a file already exists with the
    ' same name as the file to upload.    Â
    If (System.IO.File.Exists(pat hToCheck)) Then
      Dim counter As Integer = 2
      While (System.IO.File.Exists(pat hToCheck))
        ' If a file with this name already exists,
        ' prefix the filename with a number.
        tempfileName = counter.ToString() + fileName
        pathToCheck = savePath + tempfileName
        counter = counter + 1
      End While
      fileName = tempfileName
      ' Notify the user that the file name was changed.
      UploadStatusLabel.Text = "A file with the same name already exists." + "<br />" + _
                   "Your file was saved as " + fileName
    Else
      ' Notify the user that the file was saved successfully.
      UploadStatusLabel.Text = "Your file was uploaded successfully."
    End If
    ' Append the name of the file to upload to the path.
    savePath += fileName
    ' Call the SaveAs method to save the uploaded
    ' file to the specified directory.
    FileUpload1.SaveAs(savePat h)
    Dim MemUser As MembershipUser
    MemUser = Membership.GetUser()
    UserId.Value = MemUser.ProviderUserKey.To String()
    Dim strConnString As [String] = System.Configuration.Confi gurationMa nager.Conn ectionStri ngs("ConnS tringUploa d").Connec tionString
    Dim con As New SqlConnection(strConnStrin g)
    Dim strQuery As String = "insert into tblFiles (UserId, savedfor, searchcode, exercisename, bodypartmg, bodypartspecific, description, FileName, FilePath) values(@UserId, @savedfor, @searchcode, @exercisename, @bodypartmg, @bodypartspecific, @description, @FileName, @FilePath)"
    Dim cmd As New SqlCommand(strQuery)
    cmd.Parameters.Add("@UserI d", SqlDbType.VarChar).Value = MemUser.ProviderUserKey.To String()
    cmd.Parameters.Add("@Saved For", SqlDbType.VarChar).Value = savedfor.Text
    cmd.Parameters.Add("@searc hcode", SqlDbType.VarChar).Value = searchcode.Text
    cmd.Parameters.Add("@exerc isename", SqlDbType.VarChar).Value = exercisename.Text
    cmd.Parameters.Add("@bodyp artmg", SqlDbType.VarChar).Value = bodypartmg.Text
    cmd.Parameters.Add("@bodyp artspecifi c", SqlDbType.VarChar).Value = bodypartspecific.Text
    cmd.Parameters.Add("@descr iption", SqlDbType.VarChar).Value = description.Text
    cmd.Parameters.AddWithValu e("@FileNa me", fileName)
    cmd.Parameters.AddWithValu e("@FilePa th", "memuploads\" & fileName)
    cmd.CommandType = CommandType.Text
    cmd.Connection = con
    Try
      con.Open()
      cmd.ExecuteNonQuery()
    Catch ex As Exception
      Response.Write(ex.Message)
    Finally
      con.Close()
      con.Dispose()
    End Try
  End Sub
End Class
------------------------Th e aspx (User Interface) for uploading the file---------------------- ---------- -----
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="member1001glf.as px.vb" Inherits="member1001glf" %>
 <%@ Register Assembly="AjaxControlToolk it" Namespace="AjaxControlTool kit" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
  <%--<meta charset="utf-8" />--%>
  <meta name="viewport" content="width=device-widt h, initial-scale=1.0" />
   <script type="text/javascript" src="jwplayer.js"></script >
  <title>Upload Files To DataBase</title>
   <link href="MobileCss.css" rel="stylesheet" type="text/css" />
  <link href="trial_menu_files/css 3menu1/sty le.css" rel="stylesheet" />
  <link href="final_menu/style.css " rel="stylesheet" />
  <%--Exercise Name Java Script Here--%>
  <script language="javascript" type="text/javascript">
    function en(txtName, event) {
      var defaultText = "Enter Exercise Name*";
      // Condition to check textbox length and event type
      if (txtName.value.length == 0 & event.type == "blur") {
        //if condition true then setting text color and default text in textbox
        txtName.style.color = "Gray";
        txtName.value = defaultText;
      }
      // Condition to check textbox value and event type
      if (txtName.value == defaultText & event.type == "focus") {
        txtName.style.color = "black";
        txtName.value = "";
      }
    }
</script>
  <%--End JavaScript--%>
  <%--Major Bodypart Java Script Here--%>
  <script language="javascript" type="text/javascript">
    function bp(txtName, event) {
      var defaultText = "Enter Bodypart*";
      // Condition to check textbox length and event type
      if (txtName.value.length == 0 & event.type == "blur") {
        //if condition true then setting text color and default text in textbox
        txtName.style.color = "Gray";
        txtName.value = defaultText;
      }
      // Condition to check textbox value and event type
      if (txtName.value == defaultText & event.type == "focus") {
        txtName.style.color = "black";
        txtName.value = "";
      }
    }
</script>
  <%--End JavaScript--%>
  <%--Major Bodypart Specific Java Script Here--%>
  <script language="javascript" type="text/javascript">
    function bps(txtName, event) {
      var defaultText = "Target Bodypart";
      // Condition to check textbox length and event type
      if (txtName.value.length == 0 & event.type == "blur") {
        //if condition true then setting text color and default text in textbox
        txtName.style.color = "Gray";
        txtName.value = defaultText;
      }
      // Condition to check textbox value and event type
      if (txtName.value == defaultText & event.type == "focus") {
        txtName.style.color = "black";
        txtName.value = "";
      }
    }
</script>
  <%--End JavaScript--%>
  <%--Trainee's Name Java Script Here--%>
  <script language="javascript" type="text/javascript">
    function trainee(txtName, event) {
      var defaultText = "Trainee's Name";
      // Condition to check textbox length and event type
      if (txtName.value.length == 0 & event.type == "blur") {
        //if condition true then setting text color and default text in textbox
        txtName.style.color = "Gray";
        txtName.value = defaultText;
      }
      // Condition to check textbox value and event type
      if (txtName.value == defaultText & event.type == "focus") {
        txtName.style.color = "black";
        txtName.value = "";
      }
    }
</script>
  <%--End JavaScript--%>
  <%--Trainee's Name Java Script Here--%>
  <script language="javascript" type="text/javascript">
    function code(txtName, event) {
      var defaultText = "Enter Keyword";
      // Condition to check textbox length and event type
      if (txtName.value.length == 0 & event.type == "blur") {
        //if condition true then setting text color and default text in textbox
        txtName.style.color = "Gray";
        txtName.value = defaultText;
      }
      // Condition to check textbox value and event type
      if (txtName.value == defaultText & event.type == "focus") {
        txtName.style.color = "black";
        txtName.value = "";
      }
    }
</script>
  <%--End JavaScript--%>
  <%--Trainee's Name Java Script Here--%>
  <script language="javascript" type="text/javascript">
    function desc(txtName, event) {
      var defaultText = "Brief Description";
      // Condition to check textbox length and event type
      if (txtName.value.length == 0 & event.type == "blur") {
        //if condition true then setting text color and default text in textbox
        txtName.style.color = "Gray";
        txtName.value = defaultText;
      }
      // Condition to check textbox value and event type
      if (txtName.value == defaultText & event.type == "focus") {
        txtName.style.color = "black";
        txtName.value = "";
      }
    }
</script>
  <%--End JavaScript--%>
</head>
  <style type="text/css">
    .smallfont {
      font-size: 8pt;
      font-family:arial, Verdana;
    }
   Â
    .watermark
    {
     width:150px;
     font:Verdana;
     font-style:italic;
     color:GrayText;
    }
  </style>
<body class="grad">
  <form id="form1" runat="server">
    <div id="pageTop" class="TopNav"><table style="margin-top: -6px"><tr><td id="5" valign="center"><asp:Toolk itScriptMa nager ID="ToolkitScriptManager1" runat="server"></asp:Toolk itScriptMa nager>
    <asp:DropDownExtender ID="DropDownExtender1" runat="server"
         DropDownControlID="Panel1" TargetControlID="Image78"> </asp:Drop DownExtend er>
        <asp:Image ID="Image78" runat="server" BorderStyle="None" ImageUrl="~/images/menu-ic on-large2. png">
        </asp:Image>
                   Â
          Â
         Â
      <asp:Panel ID="Panel1" runat="server"  Width="100%" BackColor="#428BCA"
            HorizontalAlign="Left" BorderWidth="1px" BorderColor="White"
            Font-Names="Arial" Font-Size="9pt"  Font-Bold="False" ForeColor="#00FFFF">
        Â
        <table style="font-family: Arial, Helvetica, sans-serif; font-size: 9pt; font-weight: normal; color: #FFFFFF;">
        <tr><td style="color: #FFFFFF">
          <asp:LinkButton ID="LinkButton8" runat="server" PostBackUrl="~/register.as px"
           CssClass="linkbutton">Free Membership</asp:LinkButton ></td></tr >
        <tr><td><asp:LinkButton ID="LinkButton11" runat="server" PostBackUrl="~/support.asp x"
           CssClass="linkbutton">Memb er Sharing PIN</asp:LinkButton></td>< /tr>
        <tr><td class="style129"><asp:Link Button ID="LinkButton10" runat="server" PostBackUrl="~/Default.asp x"
           CssClass="linkbutton">GoLi veFitness Home</asp:LinkButton></td> </tr>
        <tr><td class="style129">
        <asp:LinkButton ID="option3" runat="server" PostBackUrl="~/m_search.as px"
           >Search Exercises</asp:LinkButton> <br />
          </td>
          </tr>
          <tr><td class="style129"><asp:Link Button ID="LinkButton1" runat="server" PostBackUrl="~/Support.asp x"
          >Support</asp:LinkButton>< /td></tr>
         Â
          <tr><td class="style129"><asp:Link Button ID="LinkButton2" runat="server" PostBackUrl="~/thefitcafe. aspx"
          >The Fit Cafe</asp:LinkButton></td> </tr>
         Â
          <tr><td class="style129"><asp:Link Button ID="LinkButton3" runat="server" PostBackUrl="~/modelgaller y.aspx"
          >Model Photo Gallery</asp:LinkButton></ td></tr>
         Â
          <tr><td class="style129"><asp:Link Button ID="LinkButton4" runat="server" PostBackUrl="~/sponsors.as px"
          ForeColor="#49649B" >Sponsorships</asp:LinkBut ton></td>< /tr>
         Â
          <tr><td class="style129"><asp:Link Button ID="LinkButton5" runat="server" PostBackUrl="~/traincoach. aspx"
          ForeColor="#49649B" >Trainers, Fitness Coaches</asp:LinkButton></ td></tr>
          <tr><td class="style129"><asp:Link Button ID="LinkButton6" runat="server" PostBackUrl="~/exermodels. aspx"
          ForeColor="#49649B" >Become an Exercise Performer</asp:LinkButton> </td></tr>
          <tr><td class="style129"><asp:Link Button ID="LinkButton7" runat="server" PostBackUrl="~/events.aspx "
          ForeColor="#49649B" >Scheduled Events</asp:LinkButton></t d></tr>
          <tr><td class="style129"><asp:Link Button ID="LinkButton9" runat="server" PostBackUrl="~/searchbymod el.aspx"
          ForeColor="#49649B" >Exercises by Models</asp:LinkButton></t d></tr>
          <tr><td>zzzzzzzzzz</td></t r>
          </table>
         Â
      </asp:Panel></td><td id="10" valign="center"><table>
  <tr><td width="100%" height="100%" align="left" valign="top" border width="1">
   </td>
    <td width="100%" height="100%" align="left" valign="center" border width="1">
    <asp:TextBox ID="search" runat="server" Text = "Enter Bodypart"  ForeColor = "Gray" onblur = "WaterMark(this, event);" onfocus = "WaterMark(this, event);" Height="22px"></asp:TextBo x>
    </td><td>
      <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/searchP ng2.png" PostBackUrl="~/m_newdirect .aspx" /></td>
  </table></td></tr></table>
  </div>
    <div id="infoHeader" style="font-family: Arial, Helvetica, sans-serif; font-size: 9pt; font-style: normal; font-variant: small-caps; text-transform: capitalize; color: #428BCA; font-weight: bolder; padding-top: 5px;">Mobile GoLiveFitness: Search<br /> 1000's of exercises and upload<br /> your own!</div>
 <div>
  Â
      <asp:LoginName ID="LoginName1" runat="server" Font-Names="Arial" Font-Size="8pt" />
     Â
   <p class="smallfont">Members upload your <br />exercise video</p>
    <asp:FileUpload type="file" accept="video/.mp4" ID="FileUpload1" runat="server" Width="180px" /><br />
    <asp:RegularExpressionVali dator ID="uplValidator" runat="server" ControlToValidate="FileUpl oad1"
 ErrorMessage="Only .mp4 video formats are supported"
 ValidationExpression="^([0 -9a-zA-Z_\ -~ :\\])+(.3gp|.3GP|.mov|.MOV |.wav|.WAV |.wmv|.WMV |.M4V|.m4v |.mp4|.MP4 )$" Font-Names="Arial" Font-Size="8pt" ForeColor="Red"></asp:Regu larExpress ionValidat or><br />
    <asp:Button ID="btnUpload" runat="server" Text="Upload" OnClick="btnUpload_Click" />
    <br />
    <asp:Label ID="lblMessage" runat="server" Font-Names = "Arial" Font-Size="8pt" ForeColor="#ABABAB"></asp: Label>
  </div>
    <div>
      <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SQL2008R 2_504887_g olivefitne sConnectio nString %>" SelectCommand="SELECT [id], [Name], [ContentType] FROM [tblFiles]"></asp:SqlDataS ource>
    </div>
    <div></div>
    <div>
      <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:SQL2008R 2_504887_g olivefitne sConnectio nString %>" SelectCommand="SELECT [Data] FROM [tblFiles] WHERE ([id] = 6)">
        <SelectParameters>
          <asp:Parameter DefaultValue="6" Name="id" Type="Int32" />
        </SelectParameters>
      </asp:SqlDataSource>
    </div>
    <div>
      <asp:Label ID="UploadStatusLabel" runat="server"></asp:Label >
    </div>
    <div>
      <asp:TextBox ID="exercisename" runat="server" Text = "Enter Exercise Name*"  ForeColor = "Gray" onblur = "en(this, event);" onfocus = "en(this, event);" BackColor="#D7EBFF"></asp: TextBox>
    </div>
    <div>
      <asp:TextBox ID="bodypartmg" runat="server" Text = "Enter Bodypart*"  ForeColor = "Gray" onblur = "bp(this, event);" onfocus = "bp(this, event);" BackColor="#D7EBFF"></asp: TextBox></ div>
   Â
    <div>
      <asp:TextBox ID="bodypartspecific" runat="server" Text = "Target Bodypart"  ForeColor = "Gray" onblur = "bps(this, event);" onfocus = "bps(this, event);" BackColor="#D7EBFF"></asp: TextBox></ div>
   Â
      <div>
      <asp:TextBox ID="savedfor" runat="server" Text = "Trainee's Name"  ForeColor = "Gray" onblur = "trainee(this, event);" onfocus = "trainee(this, event);" BackColor="#D7EBFF"></asp: TextBox></ div>
    <div>
      <div>
      <asp:TextBox ID="searchcode" runat="server" Text = "Enter Keyword"  ForeColor = "Gray" onblur = "code(this, event);" onfocus = "code(this, event);" BackColor="#D7EBFF"></asp: TextBox></ div>
      <asp:TextBox ID="description" runat="server" Height="60px" Rows="3" Text = "Brief Description"  ForeColor = "Gray" onblur = "desc(this, event);" onfocus = "desc(this, event);" BackColor="#D7EBFF"></asp: TextBox></ div>
    <div>
      <asp:HiddenField ID="UserId" runat="server" />
    </div>
  </form>
  <p>
    </p>
</body>
</html>
..........................
Imports System.Data
Imports System.Data.SqlClient
Imports System.IO
Partial Class member1001glf
  Inherits System.Web.UI.Page
  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    'exercisename.Attributes.A
    'exercisename.Attributes.A
    'bodypartmg.Attributes.Add
    'bodypartmg.Attributes.Add
    Image78.ImageUrl = "Images/menu-icon-large2.p
  End Sub
  Protected Sub Option_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    Image78.ImageUrl = "Images/" & DirectCast(sender, LinkButton).Text & ".png"
  End Sub
  Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    ' Before attempting to save the file, verify
    ' that the FileUpload control contains a file.
    If (FileUpload1.HasFile) Then
      ' Call a helper method routine to save the file.
      SaveFile(FileUpload1.Poste
    Else
      ' Notify the user that a file was not uploaded.
      UploadStatusLabel.Text = "You did not specify a file to upload."
    End If
  End Sub
  Sub SaveFile(ByVal file As HttpPostedFile)
    ' Specify the path to save the uploaded file to.
    Dim savePath As String = HttpContext.Current.Server
    ' Get the name of the file to upload.
    Dim fileName As String = FileUpload1.FileName
    ' Create the path and file name to check for duplicates.
    Dim pathToCheck As String = savePath + fileName
    ' Create a temporary file name to use for checking duplicates.
    Dim tempfileName As String
    ' Check to see if a file already exists with the
    ' same name as the file to upload.    Â
    If (System.IO.File.Exists(pat
      Dim counter As Integer = 2
      While (System.IO.File.Exists(pat
        ' If a file with this name already exists,
        ' prefix the filename with a number.
        tempfileName = counter.ToString() + fileName
        pathToCheck = savePath + tempfileName
        counter = counter + 1
      End While
      fileName = tempfileName
      ' Notify the user that the file name was changed.
      UploadStatusLabel.Text = "A file with the same name already exists." + "<br />" + _
                   "Your file was saved as " + fileName
    Else
      ' Notify the user that the file was saved successfully.
      UploadStatusLabel.Text = "Your file was uploaded successfully."
    End If
    ' Append the name of the file to upload to the path.
    savePath += fileName
    ' Call the SaveAs method to save the uploaded
    ' file to the specified directory.
    FileUpload1.SaveAs(savePat
    Dim MemUser As MembershipUser
    MemUser = Membership.GetUser()
    UserId.Value = MemUser.ProviderUserKey.To
    Dim strConnString As [String] = System.Configuration.Confi
    Dim con As New SqlConnection(strConnStrin
    Dim strQuery As String = "insert into tblFiles (UserId, savedfor, searchcode, exercisename, bodypartmg, bodypartspecific, description, FileName, FilePath) values(@UserId, @savedfor, @searchcode, @exercisename, @bodypartmg, @bodypartspecific, @description, @FileName, @FilePath)"
    Dim cmd As New SqlCommand(strQuery)
    cmd.Parameters.Add("@UserI
    cmd.Parameters.Add("@Saved
    cmd.Parameters.Add("@searc
    cmd.Parameters.Add("@exerc
    cmd.Parameters.Add("@bodyp
    cmd.Parameters.Add("@bodyp
    cmd.Parameters.Add("@descr
    cmd.Parameters.AddWithValu
    cmd.Parameters.AddWithValu
    cmd.CommandType = CommandType.Text
    cmd.Connection = con
    Try
      con.Open()
      cmd.ExecuteNonQuery()
    Catch ex As Exception
      Response.Write(ex.Message)
    Finally
      con.Close()
      con.Dispose()
    End Try
  End Sub
End Class
------------------------Th
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="member1001glf.as
 <%@ Register Assembly="AjaxControlToolk
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
  <%--<meta charset="utf-8" />--%>
  <meta name="viewport" content="width=device-widt
   <script type="text/javascript" src="jwplayer.js"></script
  <title>Upload Files To DataBase</title>
   <link href="MobileCss.css" rel="stylesheet" type="text/css" />
  <link href="trial_menu_files/css
  <link href="final_menu/style.css
  <%--Exercise Name Java Script Here--%>
  <script language="javascript" type="text/javascript">
    function en(txtName, event) {
      var defaultText = "Enter Exercise Name*";
      // Condition to check textbox length and event type
      if (txtName.value.length == 0 & event.type == "blur") {
        //if condition true then setting text color and default text in textbox
        txtName.style.color = "Gray";
        txtName.value = defaultText;
      }
      // Condition to check textbox value and event type
      if (txtName.value == defaultText & event.type == "focus") {
        txtName.style.color = "black";
        txtName.value = "";
      }
    }
</script>
  <%--End JavaScript--%>
  <%--Major Bodypart Java Script Here--%>
  <script language="javascript" type="text/javascript">
    function bp(txtName, event) {
      var defaultText = "Enter Bodypart*";
      // Condition to check textbox length and event type
      if (txtName.value.length == 0 & event.type == "blur") {
        //if condition true then setting text color and default text in textbox
        txtName.style.color = "Gray";
        txtName.value = defaultText;
      }
      // Condition to check textbox value and event type
      if (txtName.value == defaultText & event.type == "focus") {
        txtName.style.color = "black";
        txtName.value = "";
      }
    }
</script>
  <%--End JavaScript--%>
  <%--Major Bodypart Specific Java Script Here--%>
  <script language="javascript" type="text/javascript">
    function bps(txtName, event) {
      var defaultText = "Target Bodypart";
      // Condition to check textbox length and event type
      if (txtName.value.length == 0 & event.type == "blur") {
        //if condition true then setting text color and default text in textbox
        txtName.style.color = "Gray";
        txtName.value = defaultText;
      }
      // Condition to check textbox value and event type
      if (txtName.value == defaultText & event.type == "focus") {
        txtName.style.color = "black";
        txtName.value = "";
      }
    }
</script>
  <%--End JavaScript--%>
  <%--Trainee's Name Java Script Here--%>
  <script language="javascript" type="text/javascript">
    function trainee(txtName, event) {
      var defaultText = "Trainee's Name";
      // Condition to check textbox length and event type
      if (txtName.value.length == 0 & event.type == "blur") {
        //if condition true then setting text color and default text in textbox
        txtName.style.color = "Gray";
        txtName.value = defaultText;
      }
      // Condition to check textbox value and event type
      if (txtName.value == defaultText & event.type == "focus") {
        txtName.style.color = "black";
        txtName.value = "";
      }
    }
</script>
  <%--End JavaScript--%>
  <%--Trainee's Name Java Script Here--%>
  <script language="javascript" type="text/javascript">
    function code(txtName, event) {
      var defaultText = "Enter Keyword";
      // Condition to check textbox length and event type
      if (txtName.value.length == 0 & event.type == "blur") {
        //if condition true then setting text color and default text in textbox
        txtName.style.color = "Gray";
        txtName.value = defaultText;
      }
      // Condition to check textbox value and event type
      if (txtName.value == defaultText & event.type == "focus") {
        txtName.style.color = "black";
        txtName.value = "";
      }
    }
</script>
  <%--End JavaScript--%>
  <%--Trainee's Name Java Script Here--%>
  <script language="javascript" type="text/javascript">
    function desc(txtName, event) {
      var defaultText = "Brief Description";
      // Condition to check textbox length and event type
      if (txtName.value.length == 0 & event.type == "blur") {
        //if condition true then setting text color and default text in textbox
        txtName.style.color = "Gray";
        txtName.value = defaultText;
      }
      // Condition to check textbox value and event type
      if (txtName.value == defaultText & event.type == "focus") {
        txtName.style.color = "black";
        txtName.value = "";
      }
    }
</script>
  <%--End JavaScript--%>
</head>
  <style type="text/css">
    .smallfont {
      font-size: 8pt;
      font-family:arial, Verdana;
    }
   Â
    .watermark
    {
     width:150px;
     font:Verdana;
     font-style:italic;
     color:GrayText;
    }
  </style>
<body class="grad">
  <form id="form1" runat="server">
    <div id="pageTop" class="TopNav"><table style="margin-top: -6px"><tr><td id="5" valign="center"><asp:Toolk
    <asp:DropDownExtender ID="DropDownExtender1" runat="server"
         DropDownControlID="Panel1"
        <asp:Image ID="Image78" runat="server" BorderStyle="None" ImageUrl="~/images/menu-ic
        </asp:Image>
                   Â
          Â
         Â
      <asp:Panel ID="Panel1" runat="server"  Width="100%" BackColor="#428BCA"
            HorizontalAlign="Left" BorderWidth="1px" BorderColor="White"
            Font-Names="Arial" Font-Size="9pt"  Font-Bold="False" ForeColor="#00FFFF">
        Â
        <table style="font-family: Arial, Helvetica, sans-serif; font-size: 9pt; font-weight: normal; color: #FFFFFF;">
        <tr><td style="color: #FFFFFF">
          <asp:LinkButton ID="LinkButton8" runat="server" PostBackUrl="~/register.as
           CssClass="linkbutton">Free
        <tr><td><asp:LinkButton ID="LinkButton11" runat="server" PostBackUrl="~/support.asp
           CssClass="linkbutton">Memb
        <tr><td class="style129"><asp:Link
           CssClass="linkbutton">GoLi
        <tr><td class="style129">
        <asp:LinkButton ID="option3" runat="server" PostBackUrl="~/m_search.as
           >Search Exercises</asp:LinkButton>
          </td>
          </tr>
          <tr><td class="style129"><asp:Link
          >Support</asp:LinkButton><
         Â
          <tr><td class="style129"><asp:Link
          >The Fit Cafe</asp:LinkButton></td>
         Â
          <tr><td class="style129"><asp:Link
          >Model Photo Gallery</asp:LinkButton></
         Â
          <tr><td class="style129"><asp:Link
          ForeColor="#49649B" >Sponsorships</asp:LinkBut
         Â
          <tr><td class="style129"><asp:Link
          ForeColor="#49649B" >Trainers, Fitness Coaches</asp:LinkButton></
          <tr><td class="style129"><asp:Link
          ForeColor="#49649B" >Become an Exercise Performer</asp:LinkButton>
          <tr><td class="style129"><asp:Link
          ForeColor="#49649B" >Scheduled Events</asp:LinkButton></t
          <tr><td class="style129"><asp:Link
          ForeColor="#49649B" >Exercises by Models</asp:LinkButton></t
          <tr><td>zzzzzzzzzz</td></t
          </table>
         Â
      </asp:Panel></td><td id="10" valign="center"><table>
  <tr><td width="100%" height="100%" align="left" valign="top" border width="1">
   </td>
    <td width="100%" height="100%" align="left" valign="center" border width="1">
    <asp:TextBox ID="search" runat="server" Text = "Enter Bodypart"  ForeColor = "Gray" onblur = "WaterMark(this, event);" onfocus = "WaterMark(this, event);" Height="22px"></asp:TextBo
    </td><td>
      <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/searchP
  </table></td></tr></table>
  </div>
    <div id="infoHeader" style="font-family: Arial, Helvetica, sans-serif; font-size: 9pt; font-style: normal; font-variant: small-caps; text-transform: capitalize; color: #428BCA; font-weight: bolder; padding-top: 5px;">Mobile GoLiveFitness: Search<br /> 1000's of exercises and upload<br /> your own!</div>
 <div>
  Â
      <asp:LoginName ID="LoginName1" runat="server" Font-Names="Arial" Font-Size="8pt" />
     Â
   <p class="smallfont">Members upload your <br />exercise video</p>
    <asp:FileUpload type="file" accept="video/.mp4" ID="FileUpload1" runat="server" Width="180px" /><br />
    <asp:RegularExpressionVali
 ErrorMessage="Only .mp4 video formats are supported"
 ValidationExpression="^([0
    <asp:Button ID="btnUpload" runat="server" Text="Upload" OnClick="btnUpload_Click" />
    <br />
    <asp:Label ID="lblMessage" runat="server" Font-Names = "Arial" Font-Size="8pt" ForeColor="#ABABAB"></asp:
  </div>
    <div>
      <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SQL2008R
    </div>
    <div></div>
    <div>
      <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:SQL2008R
        <SelectParameters>
          <asp:Parameter DefaultValue="6" Name="id" Type="Int32" />
        </SelectParameters>
      </asp:SqlDataSource>
    </div>
    <div>
      <asp:Label ID="UploadStatusLabel" runat="server"></asp:Label
    </div>
    <div>
      <asp:TextBox ID="exercisename" runat="server" Text = "Enter Exercise Name*"  ForeColor = "Gray" onblur = "en(this, event);" onfocus = "en(this, event);" BackColor="#D7EBFF"></asp:
    </div>
    <div>
      <asp:TextBox ID="bodypartmg" runat="server" Text = "Enter Bodypart*"  ForeColor = "Gray" onblur = "bp(this, event);" onfocus = "bp(this, event);" BackColor="#D7EBFF"></asp:
   Â
    <div>
      <asp:TextBox ID="bodypartspecific" runat="server" Text = "Target Bodypart"  ForeColor = "Gray" onblur = "bps(this, event);" onfocus = "bps(this, event);" BackColor="#D7EBFF"></asp:
   Â
      <div>
      <asp:TextBox ID="savedfor" runat="server" Text = "Trainee's Name"  ForeColor = "Gray" onblur = "trainee(this, event);" onfocus = "trainee(this, event);" BackColor="#D7EBFF"></asp:
    <div>
      <div>
      <asp:TextBox ID="searchcode" runat="server" Text = "Enter Keyword"  ForeColor = "Gray" onblur = "code(this, event);" onfocus = "code(this, event);" BackColor="#D7EBFF"></asp:
      <asp:TextBox ID="description" runat="server" Height="60px" Rows="3" Text = "Brief Description"  ForeColor = "Gray" onblur = "desc(this, event);" onfocus = "desc(this, event);" BackColor="#D7EBFF"></asp:
    <div>
      <asp:HiddenField ID="UserId" runat="server" />
    </div>
  </form>
  <p>
    </p>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Both of these look like they will get the job done. I have read good reviews on the products so I will give them a try.
MoveAvi
http://www.movavi.com/video-converter-command-line/how-it-works.html
Format Factory
A command line along these lines (I got this from http://www.wxforum.net/index.php?topic=18011.0)
"C:\Program Files (x86)\FreeTime\FormatFacto
"All to WMV" and "High quality and size" are actually parameters passed to formatfactory. "k:\mymovie.avi" is the avi created by MovieSalsa. "%1" points to the output wmv file.