Recherche avancée

Médias (91)

Autres articles (40)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

  • Contribute to translation

    13 avril 2011

    You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
    To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
    MediaSPIP is currently available in French and English (...)

  • Le plugin : Gestion de la mutualisation

    2 mars 2010, par

    Le plugin de Gestion de mutualisation permet de gérer les différents canaux de mediaspip depuis un site maître. Il a pour but de fournir une solution pure SPIP afin de remplacer cette ancienne solution.
    Installation basique
    On installe les fichiers de SPIP sur le serveur.
    On ajoute ensuite le plugin "mutualisation" à la racine du site comme décrit ici.
    On customise le fichier mes_options.php central comme on le souhaite. Voilà pour l’exemple celui de la plateforme mediaspip.net :
    < ?php (...)

Sur d’autres sites (3536)

  • How to hide the output of yt-dl in CMD ? python

    10 février, par Qais Albeaiz

    I'm coding program that download mp3 audio from youtube videos but I have an issue that yt-dl show some output in console

    &#xA;

    my code :

    &#xA;

    with open(&#x27;Links.txt&#x27;) as f:&#xA;    content = f.readlines()&#xA;    for links in content:&#xA;&#xA;        ydl_opts = {&#xA;            &#x27;format&#x27;: &#x27;bestaudio/best&#x27;,&#xA;            &#x27;postprocessors&#x27;: [{&#xA;                &#x27;key&#x27;: &#x27;FFmpegExtractAudio&#x27;,&#xA;                &#x27;preferredcodec&#x27;: &#x27;mp3&#x27;,&#xA;                &#x27;preferredquality&#x27;: &#x27;192&#x27;,&#xA;            }],&#xA;        }&#xA;        with youtube_dl.YoutubeDL(ydl_opts) as ydl:&#xA;            ydl.download([links])&#xA;

    &#xA;

    photo of output :&#xA;enter image description here

    &#xA;

    and i need the option or some way to hide the output.

    &#xA;

  • how to play m3u8 videos from laravel storage

    10 mars 2019, par Farzane Khazaei

    I used ffmpeg to convert my MP4 videos to M3U8 format to have multiple qualities and stream my videos. because of security reason I have to put my videos in storage folder (not public) and now when I try to watch videos the browser just download M3U8 text file and video wont display. I install chrome extension to display M3U8 videos and i can see my M3U8 videos if I put the files in public folder and call the URL directly. this is my code

    $fileName = $product->details()['sample_file_name'];
    $filePath = $product->type.'s/'.$product->id.'/'.$fileName;      
    $fileContents = Storage::disk('products')->path($filePath);
    $header = ['Content-type' => Storage::disk('products')->mimeType($filePath)];
    $header = ['Content-Disposition' => 'attachment; filename='.basename($filePath)];
    $response = Response::download($fileContents, $fileName, $header);
    return $response;

    please help me what headers should i set for my download response.

  • 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 ?