Recherche avancée

Médias (2)

Mot : - Tags -/kml

Autres articles (43)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

Sur d’autres sites (5311)

  • Trying to find a way to limit the number of List that can run at one time

    14 mars 2024, par Jake

    My application has a List of Tasks. Each Task launches a FFMPEG process that requires a lot of resources on my machine. At times, this list can contain 200+ processes to FFMPEG. While processing, my memory is at 99% and everything freezes up.

    


    I need to limit the amount of processes that can run at one time. I have read a little about SemaphoreSlim ; however, I cannot wrap my mind around it's implementation.

    


    Is this a solution for this particular problem and if so, any ideas on how to implement it in my code ?

    


    Below is my code :

    


    public async System.Threading.Tasks.Task GetVideoFiles()&#xA;{            &#xA;    OpenFileDialog openFileDialog = new OpenFileDialog();&#xA;    openFileDialog.Multiselect = true;&#xA;    &#xA;    if (openFileDialog.ShowDialog() == true)&#xA;    {&#xA;        AllSplices.Clear();&#xA;        AllSplices = new ObservableCollection<splicemodel>();&#xA;        IsBusy = true;&#xA;        IsBusyMessage = "Extracting Metadata";&#xA;        IsBusyBackgroundVisible = "Visible";&#xA;        NotifyPropertyChanged(nameof(IsBusy));&#xA;        NotifyPropertyChanged(nameof(IsBusyMessage));&#xA;        NotifyPropertyChanged(nameof(IsBusyBackgroundVisible));&#xA;        metaTasks = new List>();                &#xA;        extractFramesTask = new List();&#xA;        &#xA;        foreach (string file in openFileDialog.FileNames)&#xA;        {&#xA;            FileInfo fileInfo = new FileInfo(file);&#xA;            bool canAdd = true;&#xA;            var tempFileName = fileInfo.Name;&#xA;            &#xA;            foreach (var video in AllVideos)&#xA;            {&#xA;                if (file == video.VideoPath)&#xA;                {&#xA;                    canAdd = false;&#xA;                    break;&#xA;                }&#xA;&#xA;                if (video.VideoName.Contains(tempFileName))&#xA;                {&#xA;                    video.VideoName = "_" &#x2B; video.VideoName;                            &#xA;                }                        &#xA;            }&#xA;            if (canAdd)&#xA;            {                        &#xA;                metaTasks.Add(System.Threading.Tasks.Task.Run(() => ProcessMetaData(file)));                        &#xA;            }                       &#xA;        }&#xA;        var metaDataResults = await System.Threading.Tasks.Task.WhenAll(metaTasks);              &#xA;        &#xA;        foreach (var vid in metaDataResults)&#xA;        {                    &#xA;            if(vid == null)&#xA;            {&#xA;                continue;&#xA;            }&#xA;            &#xA;            vid.IsNewVideo = true;                    &#xA;            AllVideos.Add(vid);&#xA;            &#xA;            // This list of task launches up to 200 video processing processes to FFMPEG&#xA;            extractFramesTask.Add(System.Threading.Tasks.Task.Run(() => ExtractFrames(vid)));&#xA;            &#xA;            vid.IsProgressVisible = "Visible";&#xA;            TotalDuration &#x2B;= vid.VideoDuration;&#xA;            vid.NumberOfFrames = Convert.ToInt32(vid.VideoDuration.TotalSeconds * 30);&#xA;            _ = ReportProgress(vid);&#xA;        }&#xA;       &#xA;        IsBusyMessage = "Importing Frames";&#xA;        NotifyPropertyChanged(nameof(IsBusyMessage));                              &#xA;        await System.Threading.Tasks.Task.WhenAll(extractFramesTask);              &#xA;    }&#xA;</splicemodel>

    &#xA;

  • Python 3 subprocess.popen() doesn't work on linux. Works on windows [closed]

    30 avril 2021, par user2628458
    process = subprocess.Popen(&#xA;    cmd, shell=True,&#xA;    stdout=subprocess.PIPE, stderr=subprocess.STDOUT,&#xA;     universal_newlines=True)&#xA;for line in process.stdout:&#xA;    # ...&#xA;

    &#xA;

    I have this line that executes an FFmpeg job and throws out every line in the output to a variable. It works fine on Windows, but doesn't work at all on Linux. The for loop never gets executed. I can't find anything about this, or the difference between Windows and Linux subprocess.Popen(). Can you please point me the right way to fix this ?

    &#xA;

  • ffmpeg piped to python and displayed with cv2.imshow slides rightward and changes colors

    10 septembre 2021, par Michael

    Code :

    &#xA;

    import cv2&#xA;import time&#xA;import subprocess&#xA;import numpy as np&#xA;&#xA;w,h = 1920, 1080&#xA;fps = 15&#xA;&#xA;def ffmpegGrab():&#xA;    """Generator to read frames from ffmpeg subprocess"""&#xA;    cmd = f&#x27;.\\Resources\\ffmpeg.exe -f gdigrab -framerate {fps} -offset_x 0 -offset_y 0 -video_size {w}x{h} -i desktop -pix_fmt bgr24 -vcodec rawvideo -an -sn -f image2pipe -&#x27; &#xA;&#xA;    proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)&#xA;    while True:&#xA;        raw_frame = proc.stdout.read(w*h*3)&#xA;        frame = np.fromstring(raw_frame, np.uint8)&#xA;        frame = frame.reshape((h, w, 3))&#xA;        yield frame&#xA;&#xA;# Get frame generator&#xA;gen = ffmpegGrab()&#xA;&#xA;# Get start time&#xA;start = time.time()&#xA;&#xA;# Read video frames from ffmpeg in loop&#xA;nFrames = 0&#xA;while True:&#xA;    # Read next frame from ffmpeg&#xA;    frame = next(gen)&#xA;    nFrames &#x2B;= 1&#xA;&#xA;    frame = cv2.resize(frame, (w // 4, h // 4))&#xA;&#xA;    cv2.imshow(&#x27;screenshot&#x27;, frame)&#xA;&#xA;    if cv2.waitKey(1) == ord("q"):&#xA;        break&#xA;&#xA;    fps = nFrames/(time.time()-start)&#xA;    print(f&#x27;FPS: {fps}&#x27;)&#xA;&#xA;&#xA;cv2.destroyAllWindows()&#xA;

    &#xA;

    The code does display the desktop capture however the color format seems to switch and the video scrolls rightward as if it is repeated. Am I going about this in the correct way ?

    &#xA;