Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (48)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • 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.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (9636)

  • Revision f9d69bd0fd : Add pre decode frame hook to decoder test class. Adds a hook that derived test

    10 décembre 2013, par Frank Galligan

    Changed Paths :
     Modify /test/decode_test_driver.cc


     Modify /test/decode_test_driver.h



    Add pre decode frame hook to decoder test class.

    Adds a hook that derived test classes can implement to be notified
    before every call to decode a frame.

    Change-Id : Iefa836459cf3e5d7df9ee27f8198daf82b1be088

  • Revision 994a552c09 : Merge "Add pre decode frame hook to decoder test class."

    12 décembre 2013, par Frank Galligan

    Merge "Add pre decode frame hook to decoder test class."

  • Concurrently redirect Process stdin and stdout in Process Class

    3 décembre 2013, par Andrew Simpson

    I have a desktop application written in C#.

    I am using ffmpeg using the Process class.

    Currently there are 2 stages in my code.

    The first is that I supply byte arrays (each array is a jpeg) to the stdin to create an ogg file.

    This is the code for that :

      public byte[] EncodeAndUploadImages(string _args1, string _fn)  
       {
           byte[] _data = null;
           try
           {
               clientBuild = new Process();
               clientBuild.StartInfo.WorkingDirectory = Environment.CurrentDirectory;
               clientBuild.StartInfo.Arguments = " -f mjpeg -r 30 -i - -c:v libtheora -q:v 7 -r 30 -f ogg -";
               clientBuild.StartInfo.FileName = Environment.CurrentDirectory + @"\ffmpeg.exe";
               clientBuild.StartInfo.UseShellExecute = false;
               clientBuild.StartInfo.RedirectStandardOutput = true;
               clientBuild.StartInfo.RedirectStandardError = true;
               clientBuild.StartInfo.RedirectStandardInput = true;
               clientBuild.StartInfo.CreateNoWindow = true;
               clientBuild.StartInfo.LoadUserProfile = false;
               clientBuild.EnableRaisingEvents = true;    
               clientBuild.Start();

               using (BinaryWriter bw = new BinaryWriter(clientBuild.StandardInput.BaseStream))
               {
                   for (int i = 1; i < 20; i++)
                   {
                       using (MemoryStream ms = new MemoryStream())
                       {
                           System.Diagnostics.Debug.Write(i.ToString("00000"));
                           Bitmap bmp = new Bitmap("h:\\streamin\\" + i.ToString("00000") + ".jpg");
                           bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
                           bw.Write(ms.ToArray());                          
                           bmp.Dispose();
                           ms.Close();
                       }
                   }
                   bw.Close();
               }

               mStandardOutput = clientBuild.StandardOutput.BaseStream;
               mStandardOutput.BeginRead(mReadBuffer, 0, mReadBuffer.Length, StandardOutputReadCallback, null);
               clientBuild.WaitForExit();
               _data = mStandardOutputMs.ToArray();
               mStandardOutput.Close();
           }
           catch (Exception _ex)
           {

           }
           finally
           {
               clientBuild.Dispose();
           }
           return _data;
       }

    The stdout gives me that ogg file in a new byte array.

    The second part of my code takes a ogg file on my hard disk and extracts all the jpegs contained init to stdout in byte array format.

    Here is that code :

      private void ExtractImagesFromVideo(byte[] data,string _args)
       {
           try
           {
               build = new Process();
               build = new Process();
               build.StartInfo.WorkingDirectory = Environment.CurrentDirectory;
               build.StartInfo.Arguments =  "-i \"h:\\streamout\\cache.ogg\" -vf scale=640:-1 -an -vframes 100 -r 1 -f image2pipe -";
               build.StartInfo.FileName = @"C:\inetpub\wwwroot\bin\ffmpeg.exe";
               build.StartInfo.UseShellExecute = false;
               build.StartInfo.RedirectStandardOutput = true;
               build.StartInfo.RedirectStandardError = true;
               build.StartInfo.RedirectStandardInput = true;
               build.StartInfo.CreateNoWindow = true;
               build.StartInfo.LoadUserProfile = false;
               build.EnableRaisingEvents = true;    
               build.Start();


               mStandardOutput = build.StandardOutput.BaseStream;
               mStandardOutput.BeginRead(mReadBuffer, 0, mReadBuffer.Length, StandardOutputReadCallback, null);
               build.WaitForExit();
               byte[] _data5 = mStandardOutputMs.ToArray();
               mStandardOutput.Close();
           }
           catch (Exception _ex)
           {

           }
           finally
           {
               build.Dispose();
           }
       }

    Now I would like to fuse the 2 processes. The ultimate aim is to supply stdin from a ogg file in byte array format and to extract the contaomed jpegs in byte array format.

    But if i do this :

      private void ExtractImagesFromVideo(byte[] data,string _args)
       {
           try
           {
               build = new Process();
               build = new Process();
               build.StartInfo.WorkingDirectory = Environment.CurrentDirectory;
               build.StartInfo.Arguments = "-i pipe:0 -vf scale=640:-1 -an -vframes 100 -r 1 -f image2pipe -";
               build.StartInfo.FileName = @"C:\inetpub\wwwroot\bin\ffmpeg.exe";
               build.StartInfo.UseShellExecute = false;
               build.StartInfo.RedirectStandardOutput = true;
               build.StartInfo.RedirectStandardError = true;
               build.StartInfo.RedirectStandardInput = true;
               build.StartInfo.CreateNoWindow = true;
               build.StartInfo.LoadUserProfile = false;
               build.EnableRaisingEvents = true;    
               build.Start();


               using (BinaryWriter bw = new BinaryWriter(build.StandardInput.BaseStream))
               {
                   bw.Write(data);  //code hangs here!!!!
               }

               mStandardOutput = build.StandardOutput.BaseStream;
               mStandardOutput.BeginRead(mReadBuffer, 0, mReadBuffer.Length, StandardOutputReadCallback, null);
               build.WaitForExit();
               byte[] _data5 = mStandardOutputMs.ToArray();
               mStandardOutput.Close();
           }
           catch (Exception _ex)
           {

           }
           finally
           {
               build.Dispose();
           }
       }

    The code hangs where I indicated.

    Can anyone advise please ?

    Thanks