
Recherche avancée
Médias (2)
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (21)
-
(Dés)Activation de fonctionnalités (plugins)
18 février 2011, parPour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...) -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)
Sur d’autres sites (4164)
-
ctrl+c doesn't wait for child process (background process) to finish with trap
11 avril 2019, par phischI have a script which registers a SIGINT trap and starts a ffmpeg background process that records part of the screen. The SIGINT trap sends a SIGINT signal to the background ffmpeg process to get it to gracefully stop and finish the recording.
When this script is run in a terminal, and terminated from a separate terminal with
kill -INT [SCRIPT_PID]
, the ffmpeg background process terminates gracefully and outputs confirmation in terminal 1.When the script is run in a terminal and stopped with
ctrl+c
the background process just dies instantly. (even if ctrl+c should just send a SIGINT signal)Why does ctrl+c behave differently than killing the script with
kill -INT
in this case ?
How can i make sure the ffmpeg background process ends gracefully when ending the script with ctrl+c ?#!/bin/bash
exit_script() {
kill -INT $ffmpeg_pid
wait $ffmpeg_pid
printf "\n\nffmpeg should say 'exiting normally, received signal 2' before this message is printed!\n\n"
}
trap exit_script SIGINT
ffmpeg -f x11grab -s 500x500 -i :0.0+0,0 ~/video_`date +%s`.webm &
ffmpeg_pid=$!
waitedit : it seems like ffmpeg receives 2 int signals in the case of
ctrl+c
, but i don’t know why -
look for an mp4 file inside a directory and send it to different directory after converting to mp3 in php ?
13 mai 2019, par flashI have a directory called incoming_folder in which there is an mp4 file.
What I want to achieve through php code is to scan a incoming_folder directory, look for an mp4 file and send it to outgoing_folder after converting it into mp3. Technically outgoing_folder should have mp3 version of mp4 from incoming_folder
Tried with the following code although its scanning the incoming_folder directory but no conversion is happening through ffmpeg.
<?php
$dir = 'in_folder'; /* Place where mp4 file is present */
$files1 = scandir($dir);
print_r($files1); /* It lists all the files in a directory including mp4 file*/
$destination = 'out_folder'; /* Place where mp3 file need to be send after conversion from mp4 */
foreach($files1 as $f)
{
$parts = pathinfo($f);
switch($parts['extension'])
{
case 'mp4' :
system('ffmpeg -i '.$f.' -map 0:2 -ac 1 '.$destination.DS. $parts['filename'].'.mp3', $result);
if ($result) {
// Do something with result if you want
// log for example
}
break;
case 'mp3' :
// copy($f, $destination. DS . $parts['filename']. '.' . $parts['extension']);
copy($f, $destination.DS.$parts['filename'].'.mp3');
break;
}
}
?> -
look for a mp4 file inside a directory and send it to different directory after converting to mp3 in php ?
13 mai 2019, par flashI have a directory called incoming_folder in which there is a mp4 file.
What I want to achieve through php code is to scan a incoming_folder directory, look for an mp4 file and send it to outgoing_folder after converting it into mp3.
Technically outgoing_folder should have mp3 version of mp4 from incoming_folder
Here is the pictorial representation of what I want :
Tried with the following code although its scanning the incoming_folder directory but no conversion is happening through ffmpeg.
<?php
$dir = 'in_folder'; /* Place where mp4 file is present */
$files1 = scandir($dir);
print_r($files1); /* It lists all the files in a directory including mp4 file*/
$destination = 'out_folder'; /* Place where mp3 file need to be send after conversion from mp4 */
<?php
foreach($files1 as $f)
{
$parts = pathinfo($f);
switch($parts['extension'])
{
case 'mp4' :
system('ffmpeg -i '.$f.' -map 0:2 -ac 1 '.$destination.DS. $parts['filename'].'.mp3', $result);
if ($result) {
// Do something with result if you want
// log for example
}
break;
case 'mp3' :
// copy($f, $destination. DS . $parts['filename']. '.' . $parts['extension']);
copy($f, $destination.DS.$parts['filename'].'.mp3');
break;
}
}
?>Problem Statement :
I am wondering what changes I should make in the php code so that conversion of file happens from incoming_folder and it should go to outgoing_folder.