Recherche avancée

Médias (91)

Autres articles (35)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 is the first MediaSPIP stable release.
    Its official release date is June 21, 2013 and is announced here.
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (5089)

  • FFProbe as .NET Process gives error while command line does not

    13 février 2024, par Ron O

    I've got a sample mp4 (a copy can be found here [sample_tagged.mp4, 562KB]) I've tagged with metadata using FFMpeg. Using a command line, if I issue a general command to view the metadata, I get everything.

    


    > ffprobe.exe -hide_banner -loglevel error -show_entries 'format_tags' sample_tagged.mp4
[FORMAT]
TAG:minor_version=512
TAG:major_brand=isom
TAG:compatible_brands=isomiso2avc1mp41
TAG:IMDB=tt0012345
TAG:Title=Sample MP4
TAG:synopsis=Watch MP4 sample
TAG:Rating=3.30
TAG:TMDB=tv/12345
TAG:Subtitle=Samples for all!
TAG:year=2000
TAG:date=2000:01:01T00:00:00
TAG:ReleaseDate=2000:01:01
TAG:genre=Beach;Windy;Sample
TAG:encoder=Lavf60.3.100
[/FORMAT]


    


    Also using the command line, if I limit it to a specific tag, I only get the specific tag as expected.

    


    > ffprobe.exe -hide_banner -loglevel error -show_entries 'format_tags=TMDB' sample_tagged.mp4
[FORMAT]
TAG:TMDB=tv/12345
[/FORMAT]


    


    I've set up a C# Process (in LINQPad) to mimic this behavior and return the results as a collection of key/value pairs.

    


    async Task Main()
{
  var sample = await FFProbe.GetProperties("sample_tagged.mp4");
  sample.Dump("Sample");

  var targeted = await FFProbe.GetProperties("sample_tagged.mp4", "TMDB");
  targeted.Dump("Sample Targeted");
}

class FFProbe
{
  const string _exeName = @"ffprobe.exe";
  const string _arguments = @"-hide_banner -loglevel error -show_entries 'format_tags{0}' ""{1}""";

  static Encoding _Utf8NoBOM = new UTF8Encoding(false);

  public static async Task>> GetProperties(string filename, params string[] targetProperties)
  {
    using (var probe = new Process())
    {
      var propsRead = new List>();

      probe.EnableRaisingEvents = true;
      probe.OutputDataReceived += (object sender, DataReceivedEventArgs e) =>
      {
        e.Dump("Output");
        if (e?.Data is null)
          return;
        
        if (e.Data.StartsWith("TAG"))
        {
          var eq = e.Data.IndexOf('=');

          if (eq > 1)
          {
            var key = e.Data.Substring(4, eq - 4);
            var value = e.Data.Substring(eq + 1).Trim();

            if (!targetProperties.Any() || targetProperties.Any(tp => key.Equals(tp, StringComparison.InvariantCultureIgnoreCase)))
            {
              if (value.Contains("\\r\\n"))
                value = value.Replace("\\r\\n", Environment.NewLine);

              propsRead.Add(new KeyValuePair(key, value));
            }
          }
        }
      };
      probe.ErrorDataReceived += (object sender, DataReceivedEventArgs e) =>
      {
        e.Dump("Error");
        if (e?.Data is null)
          return;
      };

      probe.StartInfo.FileName = _exeName;
      
      var tagLimiter = string.Empty;
      
      if (targetProperties.Any())
        tagLimiter = $"={string.Join(',', targetProperties)}";
      
      var arguments = string.Format(_arguments, tagLimiter, filename);
      arguments.Dump();

      probe.StartInfo.Arguments = arguments;
      probe.StartInfo.UseShellExecute = false;
      probe.StartInfo.CreateNoWindow = true;
      probe.StartInfo.RedirectStandardOutput = true;
      probe.StartInfo.RedirectStandardError = true;
      probe.StartInfo.StandardOutputEncoding = _Utf8NoBOM;
      probe.StartInfo.StandardErrorEncoding = _Utf8NoBOM;

      probe.Start();
      probe.BeginOutputReadLine();
      probe.BeginErrorReadLine();
      
      await probe.WaitForExitAsync();

      return propsRead;
    }
  }
}


    


    The output for the full sample dump matches the full metadata list. But when getting the targeted tag, I get two error responses.

    


    No match for section 'format_tags=TMDB'
Failed to set value ''format_tags=TMDB'' for option 'show_entries': Invalid argument


    


    From the output, the arguments sent into the process match those of the command line above :

    


    -hide_banner -loglevel error -show_entries 'format_tags=TMDB' "sample_tagged.mp4"


    


    I've copy/pasted the generated arguments to the command line call and it returns the value expected.

    


    What am I missing and/or need correction in setting up the call to get the same results via a Process as the command line ?

    


  • Some Java Process objects finish and close, but some finish and stall

    28 mars 2020, par brendanw36

    My program uses ProcessBuilder to make various calls to ffmpeg. My problem is that with certain commands I can create a Process, have it run, and when it is done it will terminate/exit/close itself and the program will end whereas other commands will run and create a finished output (in my case it will finish encoding a file with no corruption or anything at the end of the video), but won’t close at which point I need to force terminate the program. I have tested the ffmpeg commands that I am running in Windows Command Prompt and they all run fine without need for user input or anything. I will show some examples of commands that do and don’t work, but ultimately what I need is a way to tell why certain Processes do and don’t work. You probably don’t even need to read the rest of this post if you know the inner workings of the Process class better than I do.

    How I create my processes :

    ProcessBuilder pb = new ProcessBuilder(commandGoesHere);
    Process p = pb.start();
    p.waitFor();

    Works :
    ffmpeg -i test.y4m -f segment -segment_times timecodeList .temp/sgmnt_%d.y4m

    This command takes a y4m(raw video format/large file size/1.7 GB for 53s of 720p video) and cuts it in to chunks.

    Doesn’t work (sometimes) :
    ffmpeg -i chunkname.y4m outputName.mkv

    This command takes the chunked video and encodes it as h.264/AVC video. When I create a process with this command it only works if the chunk is small in which case the Process will start, do its work, and close.

    Doesn’t work ever :
    ffmpeg -i test.mkv -c:v copy -f segment -segment_times timecodeList .temp/sgmnt_%d.mkv

    This command takes and h.264/AVC input video and cut it in to chunks, but this one doesn’t terminate/exit/close when it’s done. I’m forced to terminate the program which I do after seeing the Process’s CPU utilization drop to 0% in Task Manager. When I force terminate the program and check the output folder, all the chunks are there and not corrupted so I know it finished running successfully.

  • What happens when I use too much RAM from spawning process with Popen in Python ? [closed]

    2 février 2020, par lms702

    I have a Python script that is rendering a video with FFmpeg where I have all the images and audio I need. I am currently invoking FFmpeg via multiprocessing.Popen, which works very quickly on my computer but the Task Manager shows that I am using 12 GB of RAM while doing so (since there end up being 100s of instances of FFmpeg.exe running). I want to deploy this on a linux server one day with much less RAM, but I worry that I’ll run into problems with my approach. Does Python/the OS handle this or should I limit the number of processes I spawn myself ?