
Recherche avancée
Médias (1)
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (57)
-
Publier sur MédiaSpip
13 juin 2013Puis-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 -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Emballe médias : à quoi cela sert ?
4 février 2011, parCe 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" ;
Sur d’autres sites (10383)
-
avfilter : update filter timeline state only on main link
1er mars 2024, par Gyan Doshiavfilter : update filter timeline state only on main link
At present, consume_update evaluates timeline state on all links for
a multi-input filter. This can lead to the filter being incorrectly
en/dis-abled when evaluation on a frame on a secondary link leads to
a different result than the frame on the current main link next in
line for processing. -
lavu/hwcontext_qsv : Join the download/upload session to the main session
11 mars 2024, par Haihao Xiang -
Java Process start a subprocess and the main process cannot be terminated [closed]
10 avril 2024, par Dodge_XI use java Process to run a script, the main process of the script start a subprocess, and the subprocess hanging, so I could not monitor if the script is closed.


Process process = processBuilder.command(commands).start();
 try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()))) {
 String line;
 while ((line = reader.readLine()) != null) {
 log.info("win exec get msg:{}", line);
 }
 }

 // cannot be finished here 
 int exitCode = process.waitFor();
 log.info("script exited with code: " + exitCode);



This command executes a python script, which uses ffmpeg to generate a video.


import subprocess
import time
import signal


command = "ffmpeg -framerate 5 -i F:\\screenshots\\screenshot_%04d.png -c:v libx264 -pix_fmt yuv420p -y F:\\website_recording.mp4"
p = subprocess.Popen(command, shell=True, close_fds=True)

pid = p.pid
time.sleep(10)
p.send_signal(signal.SIGTERM)

print("process finished")



The problem is that the ffmpeg subprocess is attached to the java started process, so it could not be terminated while the script was exiting. I have to kill the ffmpeg subprocess first that the exit code can be obtained.