
Recherche avancée
Médias (2)
-
Granite de l’Aber Ildut
9 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
Géodiversité
9 septembre 2011, par ,
Mis à jour : Août 2018
Langue : français
Type : Texte
Autres articles (43)
-
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans 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, parAfin 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, parTo 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 JakeMy 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()
{ 
 OpenFileDialog openFileDialog = new OpenFileDialog();
 openFileDialog.Multiselect = true;
 
 if (openFileDialog.ShowDialog() == true)
 {
 AllSplices.Clear();
 AllSplices = new ObservableCollection<splicemodel>();
 IsBusy = true;
 IsBusyMessage = "Extracting Metadata";
 IsBusyBackgroundVisible = "Visible";
 NotifyPropertyChanged(nameof(IsBusy));
 NotifyPropertyChanged(nameof(IsBusyMessage));
 NotifyPropertyChanged(nameof(IsBusyBackgroundVisible));
 metaTasks = new List>(); 
 extractFramesTask = new List();
 
 foreach (string file in openFileDialog.FileNames)
 {
 FileInfo fileInfo = new FileInfo(file);
 bool canAdd = true;
 var tempFileName = fileInfo.Name;
 
 foreach (var video in AllVideos)
 {
 if (file == video.VideoPath)
 {
 canAdd = false;
 break;
 }

 if (video.VideoName.Contains(tempFileName))
 {
 video.VideoName = "_" + video.VideoName; 
 } 
 }
 if (canAdd)
 { 
 metaTasks.Add(System.Threading.Tasks.Task.Run(() => ProcessMetaData(file))); 
 } 
 }
 var metaDataResults = await System.Threading.Tasks.Task.WhenAll(metaTasks); 
 
 foreach (var vid in metaDataResults)
 { 
 if(vid == null)
 {
 continue;
 }
 
 vid.IsNewVideo = true; 
 AllVideos.Add(vid);
 
 // This list of task launches up to 200 video processing processes to FFMPEG
 extractFramesTask.Add(System.Threading.Tasks.Task.Run(() => ExtractFrames(vid)));
 
 vid.IsProgressVisible = "Visible";
 TotalDuration += vid.VideoDuration;
 vid.NumberOfFrames = Convert.ToInt32(vid.VideoDuration.TotalSeconds * 30);
 _ = ReportProgress(vid);
 }
 
 IsBusyMessage = "Importing Frames";
 NotifyPropertyChanged(nameof(IsBusyMessage)); 
 await System.Threading.Tasks.Task.WhenAll(extractFramesTask); 
 }
</splicemodel>


-
Python 3 subprocess.popen() doesn't work on linux. Works on windows [closed]
30 avril 2021, par user2628458process = subprocess.Popen(
 cmd, shell=True,
 stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
 universal_newlines=True)
for line in process.stdout:
 # ...



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 Linuxsubprocess.Popen()
. Can you please point me the right way to fix this ?

-
ffmpeg piped to python and displayed with cv2.imshow slides rightward and changes colors
10 septembre 2021, par MichaelCode :


import cv2
import time
import subprocess
import numpy as np

w,h = 1920, 1080
fps = 15

def ffmpegGrab():
 """Generator to read frames from ffmpeg subprocess"""
 cmd = f'.\\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 -' 

 proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 while True:
 raw_frame = proc.stdout.read(w*h*3)
 frame = np.fromstring(raw_frame, np.uint8)
 frame = frame.reshape((h, w, 3))
 yield frame

# Get frame generator
gen = ffmpegGrab()

# Get start time
start = time.time()

# Read video frames from ffmpeg in loop
nFrames = 0
while True:
 # Read next frame from ffmpeg
 frame = next(gen)
 nFrames += 1

 frame = cv2.resize(frame, (w // 4, h // 4))

 cv2.imshow('screenshot', frame)

 if cv2.waitKey(1) == ord("q"):
 break

 fps = nFrames/(time.time()-start)
 print(f'FPS: {fps}')


cv2.destroyAllWindows()



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 ?