Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (75)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (8137)

  • 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

  • Révision 82048 : le message ’probleme_technique’ a l’envoi d’un mail merite une class erreur plut...

    21 avril 2014, par Fil Up
  • Révision 82049 : le message ’probleme_technique’ a l’envoi d’un mail merite une class erreur plut...

    21 avril 2014, par Fil Up