Recherche avancée

Médias (3)

Mot : - Tags -/spip

Autres articles (56)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

Sur d’autres sites (4983)

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