Recherche avancée

Médias (91)

Autres articles (40)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

Sur d’autres sites (6757)

  • Convert wma stream to mp3 stream with C# and ffmpeg

    24 septembre 2012, par user1363468

    Is it possible to convert a wma stream to an mp3 stream real time ?

    I have tried doing something like this but not having any luck :

       WebRequest request = WebRequest.Create(wmaUrl);
       HttpWebResponse response = (HttpWebResponse)request.GetResponse();
       int block = 32768;
       byte[] buffer = new byte[block];

       Process p = new Process();
       p.StartInfo.UseShellExecute = false;
       p.StartInfo.ErrorDialog = false;
       p.StartInfo.RedirectStandardInput = true;
       p.StartInfo.RedirectStandardOutput = true;
       p.StartInfo.RedirectStandardError = true;
       p.StartInfo.FileName = "c:\\ffmpeg.exe";
       p.StartInfo.Arguments = "-i - -y -vn -acodec libspeex -ac 1 -ar 16000 -f mp3 ";

       StringBuilder output = new StringBuilder();

       p.OutputDataReceived += (sender, e) =>
       {
         if (e.Data != null)
         {
           output.AppendLine(e.Data);
           //eventually replace this with response.write code for a web request
         }
       };

       p.Start();
       StreamWriter ffmpegInput = p.StandardInput;

       p.BeginOutputReadLine();

       using (Stream dataStream = response.GetResponseStream())
       {
          int read = dataStream.Read(buffer, 0, block);

          while (read > 0)
          {
             ffmpegInput.Write(buffer);
             ffmpegInput.Flush();
             read = dataStream.Read(buffer, 0, block);
          }
       }

       ffmpegInput.Close();

       var getErrors = p.StandardError.ReadToEnd();

    Just wondering if what I am trying to do is even possible (Convert byte blocks of wma to byte blocks of mp3). Open to any other possible C# solutions if they exist.

    Thanks

  • Get Proper Progress Updates on Two Long Waited Concurrent Processes in ASP.NET

    17 juillet 2012, par irfanmcsd

    I implemented background video processing using .net ffmpeg wrapper http://www.mediasoftpro.com with progress bar indication to calculate how much video is processed and send information to web page to update progress bar indicator. Its working fine if only single process works at a time, but in case of two concurrent processes (start two video publishing at once let say from two different computers), progress bar suddenly mixed progress status.
    Here is my code where i used static objects to properly send information of single instance to progress bar.

    static string FileName = "grey_03";
    protected void Page_Load(object sender, EventArgs e)
    {
       if (!Page.IsPostBack)
       {
           if (Request.Params["file"] != null)
           {
               FileName = Request.Params["file"].ToString();
           }
       }
    }
    public static double ProgressValue = 0;
    public static MediaHandler _mhandler = new MediaHandler();

    [WebMethod]
    public static string EncodeVideo()
    {
       // MediaHandler _mhandler = new MediaHandler();
       string RootPath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath);
       _mhandler.FFMPEGPath = HttpContext.Current.Server.MapPath("~\\ffmpeg_july_2012\\bin\\ffmpeg.exe");
       _mhandler.InputPath = RootPath + "\\contents\\original";
       _mhandler.OutputPath = RootPath + "\\contents\\mp4";
       _mhandler.BackgroundProcessing = true;
       _mhandler.FileName = "Grey.avi";
       _mhandler.OutputFileName =FileName;
       string presetpath = RootPath + "\\ffmpeg_july_2012\\presets\\libx264-ipod640.ffpreset";
       _mhandler.Parameters = " -b:a 192k -b:v 500k -fpre \"" + presetpath + "\"";
       _mhandler.OutputExtension = ".mp4";
       _mhandler.VCodec = "libx264";
       _mhandler.ACodec = "libvo_aacenc";
       _mhandler.Channel = 2;
       _mhandler.ProcessMedia();
       return _mhandler.vinfo.ErrorCode.ToString();
    }

    [WebMethod]
    public static string GetProgressStatus()
    {
       return Math.Round(_mhandler.vinfo.ProcessingCompleted, 2).ToString();
       // if vinfo.processingcomplete==100, then you can get complete information from vinfo object and store it in database and perform other processing.
    }

    Here is jquery functions responsible for updating progress bar indication after every second etc.

    $(function () {
            $("#vprocess").on({
                click: function (e) {
                    ProcessEncoding();
                    var IntervalID = setInterval(function () {
                        GetProgressValue(IntervalID);
                    }, 1000);
                    return false;
                }
            }, '#btn_process');

        });
        function GetProgressValue(intervalid) {
            $.ajax({
                type: "POST",
                url: "concurrent_03.aspx/GetProgressStatus",
                data: "{}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (msg) {
                    // Do something interesting here.
                    $("#pstats").text(msg.d);
                    $("#pbar_int_01").attr('style', 'width: ' + msg.d + '%;');
                    if (msg.d == "100") {
                        $('#pbar01').removeClass("progress-danger");
                        $('#pbar01').addClass("progress-success");
                        if (intervalid != 0) {
                            clearInterval(intervalid);
                        }
                        FetchInfo();
                    }
                }
            });
        }

    The problem arises due to static mediahandler object

    public static MediaHandler _mhandler = new MediaHandler();

    I need a way to keep two concurrent processes information separate from each other in order to update progress bar with value exactly belong to that process.

  • Add error message for unknown errors

    21 juillet 2014, par tkleinhakisa
    Add error message for unknown errors
    

    Currently the `fail` option sets `file.error = true` when an unknown error occurs (eg : restart the web server during upload) so it is not possible to change or translate the error message, and in any case true was not a very good error message :)