Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (68)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • Mediabox : ouvrir les images dans l’espace maximal pour l’utilisateur

    8 février 2011, par

    La visualisation des images est restreinte par la largeur accordée par le design du site (dépendant du thème utilisé). Elles sont donc visibles sous un format réduit. Afin de profiter de l’ensemble de la place disponible sur l’écran de l’utilisateur, il est possible d’ajouter une fonctionnalité d’affichage de l’image dans une boite multimedia apparaissant au dessus du reste du contenu.
    Pour ce faire il est nécessaire d’installer le plugin "Mediabox".
    Configuration de la boite multimédia
    Dès (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

Sur d’autres sites (9046)

  • C# process FFMPEG output from standard out (pipe) [duplicate]

    30 janvier 2018, par Alexander Streckov

    This question already has an answer here :

    I want to extract the current image from the FFMPEG standard output and show it on a C# form. The stream source itself is a h264 raw data which converted into image and piped to the standard output. Here is my code, but I have no idea how to process the output (maybe MemoryStream) :

    public Process ffproc = new Process();
    private void xxxFFplay()
    {
       ffproc.StartInfo.FileName = "ffmpeg.exe";
       ffproc.StartInfo.Arguments = "-y -i udp://127.0.0.1:8888/ -q:v 1 -huffman optimal -update 1 -f mjpeg -";

       ffproc.StartInfo.CreateNoWindow = true;
       ffproc.StartInfo.RedirectStandardOutput = true;
       ffproc.StartInfo.UseShellExecute = false;

       ffproc.EnableRaisingEvents = true;
       ffproc.OutputDataReceived += (o, e) => Debug.WriteLine(e.Data ?? "NULL", "ffplay");
       fproc.ErrorDataReceived += (o, e) => Debug.WriteLine(e.Data ?? "NULL", "ffplay");
       ffproc.Exited += (o, e) => Debug.WriteLine("Exited", "ffplay");
       ffproc.Start();

       worker = new BackgroundWorker();
       worker.DoWork += worker_DoWork;
       worker.WorkerReportsProgress = true;
       worker.ProgressChanged += worker_ProgressChanged;
       worker.RunWorkerAsync();
    }

    public void worker_DoWork(object sender, DoWorkEventArgs e)
    {
       try
       {
           var internalWorker = sender as BackgroundWorker;
           Process p = e.Argument as Process;
           buffer = new MemoryStream();
           bufferWriter = new BinaryWriter(buffer);
           using (var reader = new BinaryReader(p.StandardOutput.BaseStream))
           {
               while (true)
               {
                   bufferWriter.Write(1);
                   var img = (Bitmap)Image.FromStream(buffer);
                   pictureBox1.Image = img;
                   //get the jpg image
               }
            }
        }
        catch (Exception ex)
        {
              // Log the error, continue processing the live stream
        }
    }

    Any help would be appreciated !

  • python - subprocess.Popen fails to pipe urllib3 Response to ffmpeg

    11 février 2018, par user2963567

    I want to open a file over a network and pipe it directly to ffmpeg using subprocess.Popen. The goal is to stream the audio file data directly into ffmpeg. Here is the code :

    # test.py
    import subprocess, sys, urllib3, time

    http = urllib3.PoolManager()
    r = http.urlopen('GET', sys.argv[1], preload_content=False)

    args = 'ffmpeg -i - -y audio.mp3'.split(' ')
    subprocess.Popen(args, stdin=r)

    r.close()

    If I run a local HTTP server and give the program the url, it works successfully, and ffmpeg processes it.

    $ python3 test.py http://192.168.1.200/original.webm

    However if I try to retrieve from a remote server, such as that below, ffmpeg fails.

    $ python3 test.py https://cdn.discordapp.com/attachments/304959901376053248/412003156638040084/original.webm

    with the following output

    pipe:: Invalid data found when processing input

    I expected this code to produce the same results as running this terminal command. This command succeeds for both the discord cdn URL and a local HTTP server url.

    $ curl [file url] | ffmpeg -i - -y audio.mp3

    I’m using python 3.5 on Linux, and ffmpeg 3.4.1.

  • python - subprocess.Popen fails to correctly pipe urllib3 Response

    11 février 2018, par user2963567

    I want to open a file over a network and pipe it directly to ffmpeg using subprocess.Popen. The goal is to stream the audio file data directly into ffmpeg. Here is the code :

    # test.py
    import subprocess, sys, urllib3, time

    http = urllib3.PoolManager()
    r = http.urlopen('GET', sys.argv[1], preload_content=False)

    args = 'ffmpeg -i - -y audio.mp3'.split(' ')
    subprocess.Popen(args, stdin=r)

    r.close()

    If I run a local HTTP server and give the program the url, it works successfully, and ffmpeg processes it.

    $ python3 test.py http://192.168.1.200/original.webm

    However if I try to retrieve from a remote server, such as that below, ffmpeg fails.

    $ python3 test.py https://cdn.discordapp.com/attachments/304959901376053248/412003156638040084/original.webm

    with the following output

    pipe:: Invalid data found when processing input

    I expected this code to produce the same results as running this terminal command. This command succeeds for both the discord cdn URL and a local HTTP server url.

    $ curl [file url] | ffmpeg -i - -y audio.mp3

    I’m using python 3.5 on Linux, and ffmpeg 3.4.1.

    edit 1

    I’m now leaning towards thinking it’s not ffmpeg’s fault, and more about how Popen is reading/writing the urllib response to a process’ stdin. By running a local netcat server and sending the output to a file ($ nc -l 1234 > nc_output.webm) and adjusting the script like so :

    import subprocess, sys, urllib3, time

    http = urllib3.PoolManager()
    r = http.urlopen('GET', sys.argv[1], preload_content=False)

    args = 'nc 192.168.1.200 1234'.split(' ')
    subprocess.run(args, stdin=r)

    r.close()

    Then running as $ python3 test.py https://cdn.discordapp.com/attachments/304959901376053248/412003156638040084/original.webm

    By comparing nc_output.webm with the original.webm file, I can immediately see that nc_output.webm is slightly larger (4017585 bytes, vs 4008589 bytes). Attempting to play nc_output.webm (mpv, vlc, ffprobe) also fails, which explains why ffmpeg was complaining. Whatever Popen is doing to the stream’s bytes is sufficient to make the output file useless.

    However, the problem still ceases to occur if the URL points to a local HTTP server, such as one run from python -m SimpleHTTPServer which leads me to think that this is related to the latency associated with reading from a remote origin.