Recherche avancée

Médias (2)

Mot : - Tags -/documentation

Autres articles (68)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

  • Librairies et logiciels spécifiques aux médias

    10 décembre 2010, par

    Pour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
    Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)

Sur d’autres sites (13697)

  • Shell out to FFMPEG from Windows Service sometimes hangs

    17 avril 2013, par Jake Stevenson

    We have a windows service which runs on multiple machines, waiting for MSMQ messages telling it to convert various files for us. Sometimes the files are video files and we shell out an ffmpeg process to do the conversion and wait for the process to complete or error before moving on. And on some occasions, that ffmpeg process appears to "hang" and we have to RDP to the machine as an admin and manually kill it off using task manager before it can continue to accept new messages. This hung ffmpeg process will stay that way indefinitely, I've waited several days on some occasions. The services all run under a special account.

    The conversion process involves multiple steps— First copying the file locally, then running ffmpeg to convert, then running mp4box for "hinting", then another ffmpeg for a thumbnail. When it hangs, it is always on the first ffmpeg portion. Killing the ffmpeg process causes that code to receive an error and allows it to handle things normally from there.

    Here is the code for that first FFMPEG process. As you can see, we've tried several things to detect a hung process :

    public class FFMPEGEncoder : IEncoder
    {
       [DllImport("kernel32.dll", SetLastError = true)]
       static extern int SetErrorMode(int wMode);

       private ILogger _logger = NullLogger.Instance;
       public ILogger Logger
       {
           get { return _logger; }
           set { _logger = value; }
       }

       private static readonly string ffmpeg = System.IO.Path.Combine(ConfigurationManager.AppSettings["FFMPEG_Dir"], "ffmpeg.exe");

       private const string ffmpegArgs =
           "-r 30000/1001 -b 200k -bt 240k -vcodec libx264 -coder 0 -bf 0 -flags2 -wpred-dct8x8 -level 13 -maxrate 768k -acodec libfaac -ac 2 -ar 48000 -ab 192k -s 480x320 -async 1";

       public EncoderResult EncodeTheFile(string originalFile)
       {
           var newFileName =
               VideoFileNameHelper.GetVideoFileName(originalFile);
           Logger.Debug("Encoding {0} to {1} with ffmpeg", originalFile, newFileName);
           RunEncoding(originalFile, newFileName);

           return new EncoderResult { Filename = newFileName };
       }

       private void RunEncoding(string originalFile, string newFileName)
       {
           var process = new System.Diagnostics.Process
                             {
                                 StartInfo =
                                     {
                                         CreateNoWindow = true,
                                         WorkingDirectory = ConfigurationManager.AppSettings["FFMPEG_Dir"],
                                         UseShellExecute = false,
                                         FileName = ffmpeg,
                                         Arguments = "-i \"" + originalFile + "\" " + ffmpegArgs + " \"" + newFileName + "\"",
                                         RedirectStandardOutput = false,
                                         RedirectStandardError = true
                                     }
                             };
           Logger.Debug("Launching ffmpeg with the following arguments:");
           Logger.Debug(process.StartInfo.Arguments);
           int oldMode = SetErrorMode(3);
           var startTime = DateTime.Now;
           process.Start();

           var output = process.StandardError.ReadToEnd();
           Logger.Debug("ffmpeg output:");
           Logger.Debug(output);
           while(!process.WaitForExit(3000))
           {
               if (!process.Responding)
               {
                   process.Kill();
                   SetErrorMode(oldMode);
                   throw new Exception("Process hung");
               }
               if (DateTime.Now.Subtract(startTime) > new TimeSpan(0, 0, 30, 0))
               {
                   process.Kill();
                   SetErrorMode(oldMode);
                   throw new Exception("Process hung");
               }
           }
           SetErrorMode(oldMode);

           var exitCode = process.ExitCode;
           if (exitCode != 0)
           {
               //We got an error from ffmpeg  
               process.Close();
               if (System.IO.File.Exists(newFileName))
               {
                   System.IO.File.Delete(newFileName);
               }
               Logger.Error("Error converting video {0}", originalFile);
               throw new Exception(string.Format("Unable to process the video {0}", originalFile));
           }
           process.Close();
       }

    }

    Despite the errormode setting code AND the code that tries to kill the process after 30 minutes, I still end up with it hung occasionally and have to manually kill the process. What am I doing wrong that would allow my system to more gracefully handle the "hung" ffmpeg processes ?

  • FFMPEG - format not available ?

    16 mai 2013, par Julien Greard

    I'm converting some code from FFMPEG 0.8 to FFMPEG 1.2. I have an error during the call to the method avcodec_open2() : "Specified pixel format %s is invalid or not supported". The format I use is : AV_PIX_FMT_RGB24. It should be enabled by default, right ?

    Below is my code :

    av_register_all();

    codec = avcodec_find_encoder(AV_CODEC_ID_MPEG2VIDEO);

    if(!codec)
    {
       throw SystemException("codec not found");
    }

    codecContext = avcodec_alloc_context3(codec);

    codecContext->bit_rate = 200000;
    codecContext->time_base.den = 1;
    codecContext->time_base.num = 90000;
    codecContext->gop_size = 8;
    codecContext->pix_fmt = AV_PIX_FMT_RGB24;

    _codecContext->width = 320
    _codecContext->height = 240

    if(avcodec_open2(_codecContext, _codec, NULL) < 0)
    {
       throw SystemException("Unable to open codec");
    }
  • Anomalie #4384 (Nouveau) : spip_loader, pclzip.php:28 : Warning : Use of undefined constant _DIR_TM...

    19 septembre 2019, par David SAUVAGE

    spip_loader 3.0.5
    PHP Version 7.2.22

    Warning : Use of undefined constant _DIR_TMP - assumed ’_DIR_TMP’ (this will throw an Error in a future version of PHP) in [truncated]/pclzip.php on line 28