Recherche avancée

Médias (0)

Mot : - Tags -/flash

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (38)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (4374)

  • Ffmpeg Ignore stream if it doesn't exist

    14 juillet 2017, par Martin Dawson

    I’m using ffmpeg to convert files to .mp3 and extract cover images from the metadata.

    This works fine for files that have cover images, files that don’t throw the error :

    Output #1 does not contain any stream

    ffmpeg -i kalimba.mp3 -y test.mp3 -acodec copy test.jpg

    How can I tell ffmpeg to just ignore streams if they don’t exist and continue converting to .mp3 if no cover image exists in the metadata ?

  • C# Process Multitasking and Limitations

    30 juin 2017, par Komak57

    To give you a intro, me and some guys have suddenly come across a need for a dedicated encoding machine to receive dynamic requests from a server. I wrote a TCP Server, and put it on a Pi to listen for requests. I also wrote a TCP Client that will connect to the Pi, tell it how many cores it has, how many encoders it can run, what kind of latency is involved and other system relevant information. When the Server receives instruction, it will send a request to a valid TCP Client that will then begin a Process to use FFMPEG to start encoding based on some parameters. I’ve been having some weird issues where, when stress testing an 8-core system, it starts 8 encoders, but only 3 of them are actually encoding. The remaining 5 sit at 0% idle waiting for a slot to open up.

    tl ;dr - I’ve determined that using Process.StartInfo.UseShellExecute == false manages the processes in a thread based system, and due to my systems current limitations, only allows 3 threads to run simultaneously. This command is required for Process.BeginOutputReadLine() and Process.BeginErrorReadLine() to get useful information about the encoding process.

    Program.cs

    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Linq;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Threading;
    using System.Threading.Tasks;

    namespace EncodeMinimum
    {
       class Program
       {
           private static int threadCount = 0;
           /// <summary>
           /// Returns the number of available CPU Threads
           /// </summary>
           public static int ThreadCount
           {
               set
               {
                   threadCount = value;
                   CoreStatus = new bool[threadCount];
               }
               get
               {
                   return threadCount;
               }
           }
           private static int lastCore = -1;
           /// <summary>
           /// Increment to next available core and return. Causes IndexOutOfRangeException if there are no available cores.
           /// </summary>
           private static int nextCore
           {
               get
               {
                   int start = lastCore;
                   lastCore++;
                   if (lastCore >= ThreadCount)
                       lastCore = 0;
                   while (CoreStatus[lastCore] &amp;&amp; lastCore != start)
                   {
                       lastCore++;
                       if (lastCore >= ThreadCount)
                           lastCore = 0;
                   }
                   if (lastCore == start &amp;&amp; CoreStatus[lastCore])
                   {
                       throw new IndexOutOfRangeException("No valid cores available.");
                   }
                   return lastCore;
               }
           }
           private static bool[] CoreStatus = new bool[0];
           private static Dictionary tasks = new Dictionary();

           /// <summary>
           /// IntPtr representing the affinity of a single core. Max of 1 of 16 cores.
           /// </summary>
           public static IntPtr[] SingleCore = new IntPtr[]{ (IntPtr)0x0001, (IntPtr)0x0002, (IntPtr)0x0004, (IntPtr)0x0008,
                                                       (IntPtr)0x0010,(IntPtr)0x0020,(IntPtr)0x0040,(IntPtr)0x0080,
                                                       (IntPtr)0x0100,(IntPtr)0x0200,(IntPtr)0x0400,(IntPtr)0x0800,
                                                       (IntPtr)0x1000,(IntPtr)0x2000,(IntPtr)0x4000,(IntPtr)0x8000};

           /// <summary>
           /// Allows for compatibility between Linux and Windows operating systems, sorta.
           /// </summary>
           public static bool IsLinux
           {
               get
               {
                   PlatformID p = Environment.OSVersion.Platform;
                   return (p == PlatformID.Unix);
               }
           }

           static void Main(string[] args)
           {
               Console.WriteLine("[" + DateTime.Now.ToString("h:mm:ss") + "] Program Start");
               ThreadCount = Environment.ProcessorCount;
               bool HandleText = true;
               for (int id = 0; id &lt; ThreadCount; id++)
               {
                   Console.WriteLine("[" + DateTime.Now.ToString("h:mm:ss") + "] Creating Encoding process for ID " + id);
                   tasks.Add(id, new Encoder(id, new Process(), nextCore));
                   CoreStatus[tasks[id].Core] = true;

                   if (Program.IsLinux)
                       tasks[id].Process.StartInfo.FileName = "/usr/bin/ffmpeg";
                   else
                       tasks[id].Process.StartInfo.FileName = @"C:\FFMEPG\ffmpeg.exe";
                   tasks[id].Process.StartInfo.Arguments = String.Format("-y -i {0} -threads 1 -c:v libx264 -preset ultrafast -s {1} -r {2} -b:v {3}k -c:a aac -b:a 41k -f flv {4}", "./original.mp4", "1280x720", "60", "7500", "./out-"+id+".flv");
                   tasks[id].Process.StartInfo.Verb = "runas";
                   if (HandleText)
                   {
                       tasks[id].Process.StartInfo.CreateNoWindow = true; // true
                       tasks[id].Process.StartInfo.UseShellExecute = false; //false
                       tasks[id].Process.StartInfo.StandardOutputEncoding = Encoding.UTF8;
                       tasks[id].Process.OutputDataReceived += new DataReceivedEventHandler(ScannerHandler);
                       tasks[id].Process.ErrorDataReceived += new DataReceivedEventHandler(ScannerHandler);
                       tasks[id].Process.StartInfo.RedirectStandardOutput = true; // true
                       tasks[id].Process.StartInfo.RedirectStandardError = true; // true
                   } else
                   {
                       tasks[id].Process.StartInfo.CreateNoWindow = false;
                       tasks[id].Process.StartInfo.UseShellExecute = true;
                   }

                   try
                   {
                       Console.WriteLine("[" + DateTime.Now.ToString("h:mm:ss") + "] Starting Encoder for stream " + id);
                       tasks[id].Process.Start();
                       if (HandleText)
                       {
                           tasks[id].Process.BeginOutputReadLine();
                           tasks[id].Process.BeginErrorReadLine();
                       }
                       tasks[id].Process.ProcessorAffinity = Program.SingleCore[tasks[id].Core];
                       // Used in multithreaded operations to immediately notify when a process has closed
                       /*tasks[id].Process.WaitForExit();
                       CoreStatus[tasks[id].Core] = false;
                       tasks.Remove(id);*/
                   }
                   catch (Exception e)
                   {
                       Console.WriteLine("[" + DateTime.Now.ToString("h:mm:ss") + "] Failed to start Encoder: " + e.ToString());
                       CoreStatus[tasks[id].Core] = false;
                       tasks.Remove(id);
                   }
               }

               // Asynchronously look for Escape Key
               Thread keyscan = new Thread(new ThreadStart(CheckKeys));
               keyscan.Start();

               // Sleep until Escape Key found
               while (keyscan.IsAlive)
                   Thread.Sleep(100);

               for(int i = 0; i &lt; tasks.Count; i++)
               {
                   tasks[i].Process.Kill();
               }
           }

           /// <summary>
           /// Scans for Escape key 10 time a second
           /// </summary>
           static void CheckKeys()
           {
               // run thread until key is pressed
               while (Console.ReadKey(true).Key != ConsoleKey.Escape)
                   Thread.Sleep(100);
               return;
           }

           /// <summary>
           /// Prints output from processes directly to console.
           /// </summary>
           private static void ScannerHandler(object sendingProcess,
               DataReceivedEventArgs errLine)
           {
               if (!String.IsNullOrEmpty(errLine.Data))
               {
                   Process p = sendingProcess as Process;
                   string msg = errLine.Data.ToString().Trim();
                   Console.WriteLine("[" + DateTime.Now.ToString("h:mm:ss") + "] &lt;" + p.Id + ">: " + msg);
               }
           }
       }
    }

    Encoder.cs

    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Linq;
    using System.Text;
    using System.Threading;
    using System.Threading.Tasks;

    namespace EncodeMinimum
    {
       public class Encoder
       {
           public Process Process;
           public Thread Task;
           public int ID;
           public int Core;
           public Encoder(int ID, Process Task, int Core)
           {
               this.ID = ID;
               this.Process = Task;
               this.Core = Core;
           }
       }
    }

    I need a way to handle the output from each process created in a live-update manner, while being able to handle any number of simultaneous processes. I might be able to command the process to output to a text file, and read changes from it, but because there’s so little documentation on doing so, I’m not sure how to begin. Are there any alternatives to reading a Processes output without running into this threading issue ?

  • LGPL Xuggle : ConverterFactory.createConverter not supported

    24 mars 2013, par jlengrand

    I am using Xuggle to create an mpeg-ts stream.
    Everything was working nice until I realized that I was using the GPL version of ffmpeg, which I cannot.

    So I recompiled the whole library, and removed the —enable-nonfree and —enable-gpl flags from ffmpeg.

    The thing is that now my code would throw an error at me.

    The lines in question are :

    image = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR);
    IVideoPicture outFrame = ConverterFactory.createConverter(image, IPixelFormat.Type.YUV420P).toPicture(image, timeStamp);

    And the error I get is

    java.lang.UnsupportedOperationException: Converter class com.xuggle.xuggler.video.BgrConverter constructor failed with: java.lang.IllegalArgumentException: IVideoResampler not supported in this build
       at com.xuggle.xuggler.video.ConverterFactory.createConverter(ConverterFactory.java:347)

    The thing is that we were using the same code with the 3.3 version of Xuggle, and even though ffmpeg was throwing warnings at us saying that we had no hardware acceleration, everything was working fine.

    So did something important change between those versions ?
    And how can I overcome this ? I searched in the archive but couldn't find related issues so far.

    Thanks !