video streaming youtube help help

Last post 12-19-2007 10:52 PM by mod84. 2 replies.

Sort Posts:

  • video streaming youtube help help

    12-18-2007, 7:39 AM
    • Member
      4 point Member
    • chandra550
    • Member since 12-17-2007, 8:13 AM
    • Posts 10

      I have to ask when we upload a video in youtube it is converted in flv format and then played by flv player.


    I too preparing a site like youtube with has least fuctionality as in youtube, my question is

    When i have to convert the video in flv format ,will it happen when a user uploading a video and at that time i convert it in flv format and save,that means uploading and converting it in flv format should be done simultaneously.

    or

    whether, first i upload the video in any format and save in server and later convert it into the flv format.

  • Re: video streaming youtube help help

    12-19-2007, 10:29 PM
    Answer

    Hi,

    Based on my understanding, you want to convert video to flv format. If I have misunderstood you, please feel free to let me know.

    There is a great sample from: http://www.codeproject.com/KB/aspnet/ffmpeg_csharp.aspx. It contains the illumination about file format converting.

    I list it and change something to meet your requirement.

    using System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.Diagnostics;
        protected void Button1_Click(object sender, EventArgs e)
        {
            // preview frame
    
             Process ffmpeg; // creating process
             string video;
             string thumb;
             video = Page.MapPath("first.3gp"); // setting video input name with path
             thumb = Page.MapPath("") +"\\frame.jpg"; // thumb name with path !
             ffmpeg = new Process();
    
             ffmpeg.StartInfo.Arguments = " -i \""+video+"\" -s 108*80  -vframes 1 -f image2 -vcodec mjpeg \""+thumb+"\""; // arguments !
             ffmpeg.StartInfo.FileName = Page.MapPath("ffmpeg.exe");
             ffmpeg.Start(); // start !
    
    
        }
        protected void convert_Click(object sender, EventArgs e)
        {
            //converting video 1.wmv to video.flv
    
            Process ffmpeg; // creating process
            string video;
            string mpg;
            video = Page.MapPath("1.wmv"); // setting video input name with path
            mpg = Page.MapPath("") + "\\video.flv"; // thumb name with path !
            ffmpeg = new Process();
    
            ffmpeg.StartInfo.Arguments = " -i \"" + video + "\" -target vcd \"" + mpg + "\""; // arguments !
            ffmpeg.StartInfo.FileName = Page.MapPath("ffmpeg.exe");
            ffmpeg.Start(); // start !
    
        }

    You have to download ffmpeg.exe into your WebSite MagPath. There is a link available to download this file: http://ffdshow.faireal.net/mirror/ffmpeg/

    After downloading ffmpeg.rev11143.7z(newest) in above link, please put pthreadGC2.dll and ffmpeg.exe into your associated path in WebSite.

     

    Hope this can help.

     

     


    Vince Xu
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: video streaming youtube help help

    12-19-2007, 10:52 PM
    • Participant
      797 point Participant
    • mod84
    • Member since 04-02-2007, 3:30 PM
    • Posts 275

    most php sites i see do this first upload the file, then have a cronjob running the converter every few minutes on files that arent converted 

    EXPERT .NET DEVELOPER
Page 1 of 1 (3 items)