
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 (82)
-
Amélioration de la version de base
13 septembre 2013Jolie 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 (...) -
Menus personnalisés
14 novembre 2010, parMediaSPIP 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 ; (...) -
Configuration spécifique pour PHP5
4 février 2011, parPHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
Modules spécifiques
Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)
Sur d’autres sites (4612)
-
FFMPEG cropping size is always wrong
19 avril 2020, par SamsyI need a bunch of video to be EXACTLY 1024x512 ( power of 2 video ), not a pixel less, not a pixel more..



I'm scaling them first to 1024 width



Then cropping them to 1024x512



Problem is..



result always ends up with 1 pixel more or 2 less pixels in width etc...



Source dimension : 1624 × 1080
Output dimension : 1022 × 512




Source dimension : 1264 × 720
Output dimension : 1025 × 512




rm -R ./output

mkdir output

cd input

for i in *.mp4;

 do name=`echo "$i" | cut -d'.' -f1`

 FILE="${name}"

 TMP="temp.mp4"

 INPUT="${FILE}.mp4"

 OUT_PUT="../output/${FILE}.mp4"

 JPEG_OUTPUT="../output/${FILE}.jpg"

 echo FILE

 echo INPUT

 ffmpeg -i $INPUT -filter:v scale=1024:-2 -c:a copy ${TMP}

 ffmpeg -i ${TMP} -filter:v "crop=1024:512:exact=1" -c:a copy ${OUT_PUT}

 # ffmpeg -loglevel panic -i $OUT_PUT -vframes 1 -f image2 $JPEG_OUTPUT

 rm ${TMP}

done



-
Returning a success or failure from ffmpeg
2 novembre 2017, par user3331834I have some code executed in PHP after meeting some criteria through if/then statements which looks something like this :
if(in_array($ext,$video)&&($ext!=="mp4")){
exec("ffmpeg -i ".$fileName.".".$ext." -s 640x360 ".$fileName.".mp4");
/*
if(successful){
unlink($fileName.$ext);
$status="Video entry approved. File converted.";
}
*/
}As you can see, the issue I’m having is trying to figure out what should go in place of
if(successful)
. The point of this section of the code is to check the files extension against an array of known extensions that are in video format, and that aren’t already in the mp4 format. If it passes this check, ffmpeg should run and convert to mp4.So a few questions here. Firstly, how can I return a status to tell me if it is converting, succeeded, or failed ? Secondly, how can this be run asynchronously ? That is, if I wanted to convert multiple files, would I be able to do so ? Would I be able to limit ffmpeg to ensure it does not take up all of my server’s processing power and inadvertently bring the site to a grinding halt ?
Or is there a better way to go about converting files than this ? I’m pretty sure my method must be crude.
EDIT : In addition to this, how does one run ffmpeg in the background, so that the page can be closed, and/or another instance from the same page can be started up by the user for multiple simultaneous conversions ? Is it possible to include a real-time progress status of each conversion ?
-
Returning a success or failure from ffmpeg
16 mars 2014, par user3331834I have some code executed in PHP after meeting some criteria through if/then statements which looks something like this :
if(in_array($ext,$video)&&($ext!=="mp4")){
exec("ffmpeg -i ".$fileName.".".$ext." -s 640x360 ".$fileName.".mp4");
/*
if(successful){
unlink($fileName.$ext);
$status="Video entry approved. File converted.";
}
*/
}As you can see, the issue I'm having is trying to figure out what should go in place of
if(successful)
. The point of this section of the code is to check the files extension against an array of known extensions that are in video format, and that aren't already in the mp4 format. If it passes this check, ffmpeg should run and convert to mp4.So a few questions here. Firstly, how can I return a status to tell me if it is converting, succeeded, or failed ? Secondly, how can this be run asynchronously ? That is, if I wanted to convert multiple files, would I be able to do so ? Would I be able to limit ffmpeg to ensure it does not take up all of my server's processing power and inadvertently bring the site to a grinding halt ?
Or is there a better way to go about converting files than this ? I'm pretty sure my method must be crude.
EDIT : In addition to this, how does one run ffmpeg in the background, so that the page can be closed, and/or another instance from the same page can be started up by the user for multiple simultaneous conversions ? Is it possible to include a real-time progress status of each conversion ?