Recherche avancée

Médias (3)

Mot : - Tags -/image

Autres articles (43)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • 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

Sur d’autres sites (5968)

  • C# execute external program and capture (stream) the output

    15 août 2018, par Roberto Correia

    I’m making a program to work with some video files.

    I’m using the ffmpeg executable to merge several files in a single file.
    This command takes several minutes to finish, so, I need a way to "monitor" the output, and show a progress bar on GUI.

    Looking at the following stackoverflow topics :

    I made this code :

    Process ffmpeg = new Process
    {
     StartInfo =
     {
       FileName = @"d:\tmp\ffmpeg.exe",
       Arguments = "-f concat -safe 0 -i __sync.txt -c copy output.mp4",
       UseShellExecute = false,
       RedirectStandardOutput = true,
       CreateNoWindow = true,
       WorkingDirectory = @"d:\tmp"
     }
    }

    ffmpeg.EnableRaisingEvents = true;
    ffmpeg.OutputDataReceived += (s, e) => Debug.WriteLine(e.Data);
    ffmpeg.ErrorDataReceived += (s, e) => Debug.WriteLine($@"Error: {e.Data}");
    ffmpeg.Start();
    ffmpeg.BeginOutputReadLine();
    ffmpeg.WaitForExit();

    When I run this code, the ffmpeg start to merge files, I can see the ffmpeg process on Windows Task Manager, and if I wait long enough, the ffmpeg finish the job without any error. But, the Debug.WriteLine(e.Data) is never called (no output on Debug window). Tried to change to Console.WriteLine too (again, no output).

    So, after this, I tried this another version :

    Process ffmpeg = new Process
    {
     StartInfo =
     {
       FileName = @"d:\tmp\ffmpeg.exe",
       Arguments = "-f concat -safe 0 -i __sync.txt -c copy output.mp4",
       UseShellExecute = false,
       RedirectStandardOutput = true,
       CreateNoWindow = true,
       WorkingDirectory = @"d:\tmp"
     }
    }

    ffmpeg.Start();
    while (!ffmpeg.StandardOutput.EndOfStream)
    {
     var line = ffmpeg.StandardOutput.ReadLine();
     System.Diagnostics.Debug.WriteLine(line);
     Console.WriteLine(line);
    }
    ffmpeg.WaitForExit();

    Again, the ffmpeg is started without any error, but the C# "hangs" on While (!ffmpeg.StandardOutput.EndOfStream) until ffmpeg is finished.

    If I execute the exact command on Windows prompt, a lot of output text is showed with progress of ffmpeg.

  • C# execute external program and capture (stream) the output

    22 mars 2017, par Roberto Correia

    I’m making a program to work with some video files.

    I’m using the ffmpeg executable to merge several files in a single file.
    This command takes several minutes to finish, so, I need a way to "monitor" the output, and show a progress bar on GUI.

    Looking at the following stackoverflow topics :

    I made this code :

    Process ffmpeg = new Process
    {
     StartInfo =
     {
       FileName = @"d:\tmp\ffmpeg.exe",
       Arguments = "-f concat -safe 0 -i __sync.txt -c copy output.mp4",
       UseShellExecute = false,
       RedirectStandardOutput = true,
       CreateNoWindow = true,
       WorkingDirectory = @"d:\tmp"
     }
    }

    ffmpeg.EnableRaisingEvents = true;
    ffmpeg.OutputDataReceived += (s, e) => Debug.WriteLine(e.Data);
    ffmpeg.ErrorDataReceived += (s, e) => Debug.WriteLine($@"Error: {e.Data}");
    ffmpeg.Start();
    ffmpeg.BeginOutputReadLine();
    ffmpeg.WaitForExit();

    When I run this code, the ffmpeg start to merge files, I can see the ffmpeg process on Windows Task Manager, and if I wait long enough, the ffmpeg finish the job without any error. But, the Debug.WriteLine(e.Data) is never called (no output on Debug window). Tried to change to Console.WriteLine too (again, no output).

    So, after this, I tried this another version :

    Process ffmpeg = new Process
    {
     StartInfo =
     {
       FileName = @"d:\tmp\ffmpeg.exe",
       Arguments = "-f concat -safe 0 -i __sync.txt -c copy output.mp4",
       UseShellExecute = false,
       RedirectStandardOutput = true,
       CreateNoWindow = true,
       WorkingDirectory = @"d:\tmp"
     }
    }

    ffmpeg.Start();
    while (!ffmpeg.StandardOutput.EndOfStream)
    {
     var line = ffmpeg.StandardOutput.ReadLine();
     System.Diagnostics.Debug.WriteLine(line);
     Console.WriteLine(line);
    }
    ffmpeg.WaitForExit();

    Again, the ffmpeg is started without any error, but the C# "hangs" on While (!ffmpeg.StandardOutput.EndOfStream) until ffmpeg is finished.

    If I execute the exact command on Windows prompt, a lot of output text is showed with progress of ffmpeg.

  • Extract individual frames from video and pipe them to StandardOutput in FFmpeg

    13 novembre 2019, par Nicke Manarin

    I’m trying to extract frames from a video using FFmpeg. But instead of letting FFmpeg write the files to disk, I’m trying to get the frames directly from StandardOutput.

    I’m not sure if it’s feasible. I’m expecting to get each frame individually as they get decoded by reading and waiting until all frames are extracted.

    With the current code, I think that I’m getting all frames at once.


    Command

    ffmpeg -i "C:\video.mp4" -r 30 -ss 00:00:10.000 -to 00:01:20.000 -hide_banner -c:v png -f image2pipe -

    Code

    var start = TimeSpan.FromMilliseconds(SelectionSlider.LowerValue);
    var end = TimeSpan.FromMilliseconds(SelectionSlider.UpperValue);

    var info = new ProcessStartInfo(UserSettings.All.FfmpegLocation)
    {
       Arguments = $" -i \"{VideoPath}\" -r {fps} -ss {start:hh\\:mm\\:ss\\.fff} " +
           "-to {end:hh\\:mm\\:ss\\.fff} -hide_banner -c:v png -f image2pipe -",
       CreateNoWindow = true,
       ErrorDialog = false,
       UseShellExecute = false,
       RedirectStandardError = true,
       RedirectStandardOutput = true
    };

    var process = new Process();
    process.StartInfo = info;
    process.Start();

    while (!process.StandardOutput.EndOfStream)
    {
       if (_cancelled)
       {
           process.Kill();
           return;
       }

       //This returns me the entire byte array, of all frames.
       var bytes = default(byte[]);
       using (var memstream = new MemoryStream())
       {
           process.StandardOutput.BaseStream.CopyTo(memstream);
           bytes = memstream.ToArray();
       }
    }

    I also tried to use process.BeginOutputReadLine() and wait for each frame in OutputDataReceived. But it returns parts of each frame, like the 10 first bytes, than other 50 bytes, it’s erratic.

    Is there any way to get the frames separately via the output stream ?