
Recherche avancée
Autres articles (69)
-
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 ; (...) -
Gestion de la ferme
2 mars 2010, parLa ferme est gérée dans son ensemble par des "super admins".
Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
Dans un premier temps il utilise le plugin "Gestion de mutualisation"
Sur d’autres sites (6935)
-
FFMPEG not working as intended in a bash script
9 mai 2024, par rcpI'm trying to get the mean volume of a recording and the echo the expected value. When I do it line by line, everything works fine, but as soon as I execute it in a bash script, I have a problem with the FFMPEG line. I identified the problem, which is that
&> analysis
is not doing anything for some reason and instead of saving the output in a file it prints it in the shell.

I don't know how to fix it since it works fine when not in a script.


#!/bin/bash

# Record sound
sh aud2.sh

# Run ff.sh in the background to analyze volume and save results
ffmpeg -i test.wav -af "volumedetect" -vn -sn -dn -f null - &> analysis.vol

# Extract mean_volume and save to mean.vol
grep "mean_volume" analysis.vol > mean.vol

# Extract numerical value and save to val.vol
sed -n 's/^.*mean_volume: \([-0-9.]*\) dB.*/\1/p' < mean.vol > val.vol

# Read the value from val.vol into the variable volume
volume=$(code>


Expected output when line by line




I expected the shell output to be saved in a file.


-
Why is `subprocess.call` not invoking the command
6 juin 2014, par ShookieI’m trying to run a .wav file through ffmpeg using the
subprocess.call(shell=True)
in the following code and it doesn’t seem to run. I know this because theoutput_file
isn’t created and I’m getting an exception in theopen()
method.
What am I doing wrong ?try:
import pocketsphinx
except:
import pocketsphinx as ps
import sphinxbase
import subprocess
import os
hmmd = "../../Pocketsphinx_Files/en-us-8khz"
lmdir = "../../Pocketsphinx_Files/cmusphinx-5.0-en-us.lm"
dictp = "../../Pocketsphinx_Files/cmu07a.dic"
output_filename = "../../temp/ps_output.wav"
def recognize(filename="../../temp/temp_output.wav"):
command = "ffmpeg -i "+filename+" -ac 1 -ab 16 -ar 16000 "+output_filename
subprocess.call(command,shell=True)
wavFile = open(output_filename,"rb")
speechRec = ps.Decoder(hmm = hmmd, lm = lmdir, dict = dictp)
wavFile.seek(44)
speechRec.decode_raw(wavFile)
result = speechRec.get_hyp()
#os.remove(filename)
#os.remove(output_filename)
return result
if __name__=="__main__":
print(recognize())edit : I’ve got ffmpeg installed.
Furthermore, when I run the subprocess.call() command from the python interpreter it seems to work. This is why I’m stumped. -
What does the variable ${i%.*} mean in terminal ?
17 mars 2020, par wongzThis shell command converts all .avi to .mp4 as per this answer by @llogan
Can someone explain how $i%.* works ?
In particular, what does % do ?for i in *.avi; do ffmpeg -i "$i" "${i%.*}.mp4"; done