
Recherche avancée
Médias (1)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (92)
-
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 (7826)
-
How to rename and move files in a subdirectory with an index and the folder name ... better ?
29 octobre 2014, par krismajeanI’m putting together a script to take .mp4 files organized into folders that described the video (eg. cat) and I’d like to do the following :
- rename them with the folder name and a number ;
- move the video into a folder named and numbered in the same manner
- parse the video into frames using ffmpeg
I’m posting this here to be a reference for others and to ask about how this could be done better. It works well but I’m wondering how to make it better.
for dir in /path/to/parent/directory/*; do
cd "$dir" && result=${PWD##*/}
cd video
echo $result
a=1
for i in *.mp4; do
dafile="$(printf "_%02d.mp4" ${a})"
dafolder="$(printf "_%02d" ${a})"
newfolder=$result$dafolder
newfile=$result$dafile
mkdir ${newfolder}
mv ${i} ${newfolder}/${newfile}
cd ${newfolder}
ffmpeg -i ${newfile} -r 30 -f image2 ${newfolder}-\%04d.png
cd ..
let a=a+1
done
doneI used the following links to figure out a bunch of ideas for the code :
- Get current directory name (without full path) in Bash Script
- Renaming files in a folder to sequential numbers
-
Announcement : Piwik to focus on Reliability, Performance and Security
To our valued team and community,
Well, we have moved fast and achieved so much during the past few months. Relentlessly releasing major version after major version… We got a lot done including several major new features !
The speed of adding new features was a great showcase of how agile our small teams and the larger community are. And I’m so proud to see automated testing becoming common practice among everyone hacking on Piwik !
For the next few months until the new year we will focus on making what we have better. We will fix those rare but longstanding critical bugs, and aim to solve all Major issues and other must-have performance and general improvements. The core team and Piwik PRO will have the vision of making the existing Piwik and all plugins very stable and risk free. This includes edge cases, general bugs but also specific performance issues for high traffic or issues with edge case data payloads.
We’ll be more pro-active and take Piwik platform to the next level of Performance, Security, Privacy & Reliability ! We will prove to the world that Free/Libre Web software can be of the highest standard of quality. By focusing on quality we will make Piwik even easier to maintain and improve in the future. We are building the best open platform that will let every user liberate their data and keep full control of it.
If you have any feedback or questions get in touch or let’s continue the discussion in the forum.
Thank you for your trust and for liberating your data with Piwik,
Matthieu Aubry
Piwik founderMore information
- How long is each release of Piwik maintained for ? (FAQ)
- When is the next release of Piwik ? What is the release schedule ? (FAQ)
- Pulse of Piwik : our monthly pulse report shows 27 different people contributed to Piwik core in the last month !
This is an amazing testament of the power of free/libre software and yet we think this is just the beginning. We hope more developers will join and contribute to the Piwik project !
-
Executing ffmpeg command using Popen
21 septembre 2014, par dragonatorI have a strange problem trying to execute
ffmpeg
command using Popen.
I have the following piece of code, which I use for executing an external commands in Python :from subprocess import Popen, PIPE
from datetime import datetime
class Executor(object):
@classmethod
def execute(cls, command):
"""
Executing a given command and
writing into a log file in cases where errors arise.
"""
p = Popen(command, stdin=PIPE, stdout=PIPE, stderr=PIPE)
output, err = p.communicate()
if p.returncode:
with open("failed_commands.log", 'a') as log:
now = datetime.now()
log.write('{}/{}/{} , {}:{}:{}\n\n'.format(now.day, now.month,
now.year, now.hour,
now.minute,
now.second))
log.write("COMMAND:\n{}\n\n".format(" ".join(command)))
log.write("OUTPUT:\n{}\n\n".format(output.decode("utf-8")))
log.write("ERRORS:\n{}\n".format(err.decode("utf-8")))
log.write('-'*40)
log.write('\n')
return ''
if not output:
output += ' '
return outputI’ve tested it with others commands, but when I try to execute
ffmpeg
command - it fails.
I’m trying to convert some audio format to mp3 format.
Here is an example of my command :ffmpeg -i "/path/old_song.m4a" "/path/new_song.mp3"
...simple as that.When I run it in terminal it works fine, but when I try to execute it using the above function it fails.
Here is the exact error :----------------------------------------
21/9/2014 , 19:48:50
COMMAND:
ffmpeg -i "/path/old_song.m4a" "/path/new_song.mp3"
OUTPUT:
ERRORS:
ffmpeg version 2.2.3 Copyright (c) 2000-2014 the FFmpeg developers
built on Jun 9 2014 08:01:43 with gcc 4.9.0 (GCC) 20140521 (prerelease)
configuration: --prefix=/usr --disable-debug --disable-static --enable-avisynth --enable-avresample --enable-dxva2 --enable-fontconfig --enable-gnutls --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-pic --enable-postproc --enable-runtime-cpudetect --enable-shared --enable-swresample --enable-vdpau --enable-version3 --enable-x11grab
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libavresample 1. 2. 0 / 1. 2. 0
libswscale 2. 5.102 / 2. 5.102
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
"/path/old_song.m4a": No such file or directory
Conversion failed!
----------------------------------------...and as you can think of - the file exists.
I think there is something in passing the command to
Popen.communicate
but I don’t know exactly.Kind regards,
Teodor D.
PS : I’m passing the command toExecutor.execute as Python
list.PSS : Calling the
Executor.execute
:def process_conversion(self):
for song in self.files_to_convert:
current_format = song.rsplit('.', 1)[-1]
old_file = '"{}{}{}"'.format(self.target_dir, os.sep, song)
new_file = '"{}{}{}"'.format(self.target_dir, os.sep,
song.replace(current_format, 'mp3'))
command = ["ffmpeg", "-i", old_file, new_file]
Executor.execute(command)