Recherche avancée

Médias (0)

Mot : - Tags -/configuration

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

Autres articles (56)

  • 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 (...)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • 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 (6328)

  • Error in writing video file using moviepy and ffmpeg

    29 décembre 2023, par Divakar Sharma

    I have been working with moviepy library for the first time. I have a video clip around 7 hours long, and I'd like to clip it into small clips. I have a list of start and end time.

    


    video = VideoFileClip("videoFile.mp4")
clips = []
for cut in cuts:
   clip = video.subclip(cut[0], cut[1])
   clips.append(clip)
clips
clip = video.subclip("7:32:18", "7:38:38")
clips.append(clip)
for clip, title in zip(clips, title_list):
 clip.write_videofile(title + '.mp4', threads=8, fps=24, audio=True, codec='libx264',preset=compression)
video.close()


    


    clips[] contain the start and end time for clipping. I have a list of title too which I have scraped from youtube. I have not included the two lists here but a small example could be :

    


    cuts = [('0:00', '2:26'),
 ('2:26', '5:00'),
 ('5:00', '7:15'),
 ('7:15', '10:57'),
 ('10:57', '18:00'),
 ('18:00', '18:22'),
 ('18:22', '19:57'),
 ('19:57', '20:37'),
 ('20:37', '28:27'),
 ('28:27', '40:32'),
 ('40:32', '49:57'),...
title_list = ['Introduction (What is Todoist?), tech stack talk', 'Showing the final application (with dark mode!)', 'Installing create react app', "Clearing out what we don't need from create react app", "Let's get building our components!", 'Installing packages using Yarn', 'Building the Header component', 'Building the Content component',...


    


    OSError: [Errno 32] Broken pipe

MoviePy error: FFMPEG encountered the following error while writing file Introduction(WhatisTodoist?),techstacktalkTEMP_MPY_wvf_snd.mp3:

b'Introduction(WhatisTodoist?),techstacktalkTEMP_MPY_wvf_snd.mp3: Invalid argument\r\n'

In case it helps, make sure you are using a recent version of FFMPEG (the versions in the Ubuntu/Debian repos are deprecated).


    


    Above is the error I am getting after running the write_videofile(). I have looked at the documentation and the issues on github, I tried updating the ffmpeg through pip too. I don't know why it can't write the audio file.

    


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

  • How to configure B-frames (no leading P-frames) in x265

    5 mars 2020, par Alearner

    I have been rolling around with my studies in x265 encoder for days. Guess now I get better click on how x265 works than my first day. I usually use the HEVC reference software, and so think I am too comfortable with its environment because now I cannot figure out how to set the x265 encoder to code only I- and B-frames as if the Random Access or Low-Delay-B configurations in HEVC.

    I set my encoder with this CLI option to encode 500 frames of BasketballPass sequence :

    --input BasketballPass_416x240_50.yuv --input-res 416x240 --fps 50 --frames 500 --rd 4 --no-lossless --csv-log-level 2 --csv infoQP37.csv --no-wpp --psnr --ssim -b 16 --b-pyramid 0 --b-adapt 0 --keyint 48

    Instead of get only I- and B-frames encoded, P-frames also show up in my log file :

    Enc.order Type      POC
    0         I-SLICE   0
    **1       P-SLICE   17**
    2         B-SLICE   9
    3         b-SLICE   1
    4         b-SLICE   2
    5         b-SLICE   3
    6         b-SLICE   4
    7         b-SLICE   5
    8         b-SLICE   6
    9         b-SLICE   7
    10        b-SLICE   8
    11        b-SLICE   10
    12        b-SLICE   11
    13        b-SLICE   12
    14        b-SLICE   13
    15        b-SLICE   14
    16        b-SLICE   15
    17        b-SLICE   16
    **18          P-SLICE   34**
    19        B-SLICE   26
    20        b-SLICE   18
    21        b-SLICE   19
    22        b-SLICE   20
    23        b-SLICE   21
    24        b-SLICE   22
    25        b-SLICE   23
    26        b-SLICE   24
    27        b-SLICE   25
    28        b-SLICE   27
    29        b-SLICE   28
    30        b-SLICE   29
    31        b-SLICE   30
    32        b-SLICE   31
    33        b-SLICE   32
    34        b-SLICE   33
    35        i-SLICE   48
    ......

    My question is, can the x265 configure encoder as in RA or LDB of HEVC ? If yes, I’d appreciate any guidance to do it. Or How can we encode only I- and B-frame only (without P-frame) in x265 ?